You have to do the following steps in order to move the site from localhost to hosting site or vice versa.
- If you are using a custom theme, copy that folder to your host
- Copy your uploads folder (if you are using default setting that would be
- Backup your database, I use command line:
mysqldump --host=localhost --user=[your mysql username] -p [your database] > transfer.sqlSo if your username is user1 and your database name is database1 the command would be
mysqldump --host=localhost --user=user1 -p database1 > transfer.sqlYou could name transfer.sql whatever you want, but it must end .sql.
- Copy, or preferably rsync your database to your server
- Load your database to your server using this command:
mysql --host=[whatever your host is] --user=[your user name] -p [your database] < transfer.sqlThis will refresh your site with the latest posts and content.
- 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