In the last two chapters, I talked about Installing WordPress Locally and Building Custom WordPress Theme. This chapter will cover exporting your local WordPress to a web host. Assume you are done with the local WordPress development, it is time to learn how to export and import WordPress. Then you can keep the local version for backup purpose and future development (ie. testing new themes, plugins, and upgrades).
1. Export Local Database
Login to your local phpMyAdmin, select the database from the dropdown. Click on the Export tab:
- Under the Export field, make sure all tables are selected
- Under the Structure field, tick "Add DROP TABLE / DROP VIEW"
- Tick "Save as File"
- Then click Go and it will prompt you to download a SQL file

2. Find & Replace All Local URLs
Open the database SQL file with a text editor. Find and replace all local URLs with your domain URL (eg. replace all "http://localhost:8888/mysite" with "http://www.yourdomain.com").

3. Import The Database
Login to your server cPanel, go to MySQL Databases, create a new database and assign a user. Now go to phpMyAdmin, select the database (the one that was just created) from the dropdown, click on the Import tab, browse the SQL file and click Go.

4. Upload WordPress
Upload the entire WordPress folder to your server.
5. Change The wp-config.php Setting
On your server, open the wp-config.php file. Change the database details to reflect your server settings.

6. Done
Go to your website and everything should work perfect.
Hi Nick, following step 2. (Find & Replace All Local URLs) It also imported categories, links etc..?
Importing the file usually those features are not imported or wrong!
thanks
Do you have a more tut’s about export/import?
hmmm, thanks for this timesaver…
i made it a couple of times like this tutorial, but didn’t thought about to open the sql file in the text editor and use the really basic and timesaving function “find and replace”…
oh, sometimes it is hard to see how easy life could be… ;-)
good job. greetings from kiel/germany
Hey, thanks for the timesaver! =]
Im just getting into wordpress, so this will help me comign from my local server’s.
Simple and easy to learn. Thanks a lot.
I have just explained this very process to a colleague, so I am really pleased to see an article written about it should I need to explain it again.
WP rocks. Thanx for the post.
Great article! Nice and easy to learn… The only drawback images are just too small to easy the details. Should provide a bigger version. Thanks a lot for sharing!
I’ m trying to do that…..
http://sferlazzorossella.wordpress.com
My god I should have see that before…
An easy how-to, but pretty important stuff… Just moved from Dreamhost to Media Temple and it was a PITA to move all the DBs…
I wrote an article about it: http://www.webmajor.com/2008/11/leaving-dreamhost-sort-of/
HI Nick, if I am doing this for someone else – and integrating their blog into their site like I mentioned earlier, do they need to download anything in their part? I am creating it on my mac, they are on a pc- once I am done with everything and they want to post now on their blog – do they need to do something first? Can you let me know? Thanks Nick. Really appreciate it!
Useful, thanks a lot for the tips. best
Great tip!
very useful article. thanks
one thing you didn’t mention… you must also find and replace the e-mail address you used when creating the wordpress installation… if it’s different, that is. If you don’t do this you can change the admin e-mail setting in wordpress, but I ran into a problem because somewhere in the database it held onto the old e-mail address and was sending site message to the old e-mail address… just fyi
WDW ajiiip!
great tips, thanks
WordPress is epic failure, stop pushing a craptastical cms
This actually is easier than it sounds. Thanks dude.