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.
Great tutorial, thank for teaching
Tq very much for the tutorial… Great..
Dude “YOU ROCK SO HARD!!!”
I will vote my socks off for you – thanks for this great tutorial series.
This is a very useful tutorial as I recommend everyone who has a word press theme to switch to your domain name because you never know when word press decides to reactivate your blog.
Nice tutorial. These are helpful. I had done the url replacement using SQL but hadn’t thought of the text editor option before. For those reading, be careful what text editor you use as it may change the quotes and lead to an issue.
Excellent tutorial. :)
This is very helpful! Thanks very much
thanks. nice post, great tutorial.
you can try this step to import your wordpress blog to joomla powered site/blog
Great tutorial over exporting WordPress but there needs to be a step six, especially for noobs.
6) Go to Settings > Miscellaneous > Store Uploads in This Folder
Change server value to:
/wp-content/uploadsIf you fail to do this, you will get errors whenever you try and upload multimedia onto your http live site via the wordpress uploading interface.
Great blog by the way,
j
Thanks for the great post, Nick! :-)
Awesome tutorial, thanks Nick! :)
hi everyone…i’m having some problems with a blog…I’ve followed many times this tutorial…everything works perfect locally.
When I upload it to my host, then something goes wrong…
Pages never seems to work…
This is what i’m talking about… http://www.justsimpa.com
Thanks in advance to anyone who’ll answer…
I’m trying to move my wordpress blog to a subdirectroy (http://www.brianandlindsaymiller.com/hardwalking) but getting a database connection error. I’ve modified the .sql file to reflect http://www.brianandlindsaymiller.com/hardwalking/, and the wp_config file. The blog works if I upload it to the root public_html directory but not the subdirectory. Is there something I have to do to the mySQL db or something?
I’m doing this because it will be used under an add-on domain once I get it uploaded and tested. I’ll then change the DNS.
Hey Brian, I’m having the same problem…would the kind gods of the web designer wall please assist us?
I’m having problems with this: 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. Can anyone help?
Brian and christoball, under Settings->General Settings there is a place for Blog Address. Did you put the subfolder name in there? Just a guess.
Fritz, If I’m not mistaking…by updating the .sql file with the new URL this should update the field you are referring to. So I did update all the URL’s in the .sql from my localhost to the new domain/subdirectory. If I’m wrong…I still can’t change this field because I can’t even login into WP without getting the database error. So in other words…I can’t get to WP in anyway because it won’t connect to the database.
Does this have something to do with the .htaccess file?
I’m using a mac and mamp. Is there anything like Cpanel for the mac?
Please help:)
Hi thanks for this tutorial.
but i got a some problem wordpress plugin such as wordpress sitemap
I do like this post very much, thanks. I can work off-line now.