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.
Man It solved my Problem.. Thanks
This has got to be the best tutorial out there…simple and to the point. Thank you, Nick for creating this. I’ve referenced to this post several times to make sure I do it the right way.
if i read this one before it will save me from hell
Thank You, :D
AM currently trying to create a local word press. anyways i have intentions of making it live. i installed XAMP and have installed word press. its working great locally. i want to add more stuff on it still though. well i want to know how to make it live and i want to host it myself. am not exactly a newbie to wordpress but i have never made any webpage or site live. i need help making my wordpress live. am googling some info and ama attempt some of them.
Thanks so much for the great tutorial! Worked perfectly, although with GoDaddy I had to change the host name to what GoDaddy was providing. Other than that, perfect!
i need help making my wordpress live. am googling some info and ama attempt some of them.
I am getting error code 1046 while importing MySQL database. Please help me to escape out of this error.
It’s nice tutorial, but i think better\easier way is to export xml file from wp dashboard, and to import it to new host like it’s described here…
http://wordpress.org/support/topic/using-importexport-when-moving-wordpress-to-a-new-host
But there’s more involved than just the stuff that wordpress gives you with the export xml file. There is theme options, widgets, etc.
Thanks! It’s very useful, but I don’t understand: if I want to export my local WordPress into WordPress.com, how can I do that? Do I need to put the local WordPress folder into the export/import section? It’s said it only works for comments, posts, etc..
Thanks.
hello there
it was the best tutorial i found out to import my wordpress site from older to newer one. i am still confused and did not be able to do what i wanted to do so. i have old site using all the same version of wordpress with all the plugins installed in new one, tried to import mysql using phpmyadmin but give me duplicate posts and error which ended in failure to import all my data. i replaced all my old domain name in the imported sql file using text editor as well and data base too changed. i will try again and may ask you fine people for help.
Thanks for nice post.
Awesome as always, Thanks. I usually hate anything to do with the databases but that made it so simple. It didn’t hurt at all!
gr8 info:) as always…
tnx!
Short and simple tutorial, but direct to the point, it’s what I’m looking for to transfer my other WordPress database to a new host. Thanks Nick, cool as always.
I loaded wordpress locally, designed the site, copied the files to the server, restore the database to the webserver phpmyadmin and changed the wp-config.php config file but it will not open the wordpress page, always says cannot find the database. I rename the .php file and recreate it and add the same database info and it connects to the database but i have to reload all widgets, themes and recreate all gallaries. All files are there the wordpress site just doesnt see any of them. Its like the database needs to recreate all the tables and then it works. Any ideas? P.s its not the database info in the .php file thats wrong. Could it be the naming of the database on my local machine and the nameing of the tables on the server?
Simple solution you’ve provide for the most complex process I was thinking before reading this tutorial. How to export WP database from one host to another ?
Thanks for the helpful info… WP doesn’t make it apparent how to backup the database.
so if I wanted to download a WP theme I already have loaded on a site running live would I have to copy all the folders locally in the WP themes folder … and change the wp-config.php file ?
well when i mean copy the files locally … I mean copy the folders from the server & then load them into my local WP theme folder.. yes
maybe all I need to do is copy the Theme folder locally from the server… yes ?
For a theme you don’t need to change the wp-config.php.
Just copy the themes map, usually has the map the name from the theme, from the website and place it in the themes map from the new site.
When you go to your admin panel and select themes you should see the newly added theme.
Hi
Great site, it gives straight fourth answers to thinks that look complicated.
I tried this reversed. So I replace all “http://www.yourdomain.eu” with “http://localhost:8888/”. Downloaded the entire htdocks from my webserver to my local mac. Changed the wp-config.php settings.
But when I go to the http://localhost:8888/ site everything is blank. I think I missed something but don’t know what.
Before I did this, I had a clean WP running just to be sure that everything worked just fine. Witch it did.
I have completed steps 1-3 but do not know how to proceed with #4 and # 5. Can someone walk be through this? I am stressing out a bit with trying to get this done under a deadline and help would be greatly appreciated.