WordPress – Moving from localhost to Hosting site Howto

You have to do the following steps in order to move the site from localhost to hosting site or vice versa.

  1. If you are using a custom theme, copy that folder to your host
  2. Copy your uploads folder (if you are using default setting that would be /PATH_TO_WORDPRESS/wp-content/uploads)
  3. Backup your database, I use command line: mysqldump --host=localhost --user=[your mysql username] -p [your database] > transfer.sql So if your username is user1 and your database name is database1 the command would be mysqldump --host=localhost --user=user1 -p database1 > transfer.sql You could name transfer.sql whatever you want, but it must end .sql.
  4. Copy, or preferably rsync your database to your server
  5. Load your database to your server using this command: mysql --host=[whatever your host is] --user=[your user name] -p [your database] < transfer.sql This will refresh your site with the latest posts and content.
  6. Go get the search and replace tool (this will do what octav is telling you to do in his answer – I prefer to use the tool because it prevents you from messing up your database, do not be like me and learn the hard way, use this tool) and place it somewhere in your wordpress installation. I would actually do this locally before I copy the database to the server, it is more secure that way. Make sure to rename the file as the site tells you to. In your web browser type the path to that php file. Follow the instructions until you get to the search and replace page. Place localhost/path in the search and your URL in the replace.

Also Refer¬†WordPress’s codex for moving your site: Moving WordPress

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s