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.
Everything worked just as the tutorial says! Thank you so much! : )
Does this work the other way around as well?
I mean can I make a local copy of my online site this way?
How can I use this process with 3.1? I have multisite locally, but need to move only 1 subsite online. I can export the single database, but not upload the whole wordpress folder cause it includes all my other site as well.
Please help!
oh man, your the best. I’ve never done this before and i;ve been struggling with this problem. Got it all solved finally. I just want to say THANKS.
Totally covers exporting local WordPress to a web host. Awesomeness!
It’s more like thinking outside the box right?
How do I know what my host is?
Very useful tutorial. Nice work!
Will I still be able to change and update my website locally, and then just upload the files to the web host?
Thank you very much for such a wonderful tutorial. My web hosting client was suffering how to make his WP site online. I googled and found this link. I gave him the link and he is almost successful.
Thanks,
San
Have learned lot from here, its time to do with my server,
Thanks a lot for valuable information buddy.
I’ve been trying to upload my wordpress but no sucess but now with your detailed description.. Perfect !!.. you guys are the best
There is a deep-rooted issue with this method. WordPress relies on PHP serialization for datasets stored within the database. The format of serialized PHP includes a character count. If this character count differs from the original it can unserialize incorrectly and screw up settings.
Specifically plugins and widgets are first and most obvious effected. The proper albeit more complicated method is to unserialize these with PHP, then replace and reserialize. It’s a stupid issue that could have been avoided in wordpress used JSON.
Big thanks for this tutorial. It’s really helpfull. High FIVE!
thanks thanks It’s really helpfull, i did it from bluehost to 1and1 and was perfect THANK YOU!
Hi,
thanks a lot.
awesome… thanks guys…
I was so happy when I found this because it helped me get further than ever. However, I get this message:
SQL query:
http– phpMyAdmin SQL Dump
– version 3.3.9.2
– http://www.phpmyadmin.net
–
– Host: localhost
– Generation Time: Aug 13, 2011 at 08:18 PM
– Server version: 5.5.9
– PHP Version: 5.3.6
SET SQL_MODE = “NO_AUTO_VALUE_ON_ZERO”;
MySQL said: Documentation
#1064 – You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘htt
When I get to step 3
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.
I’m usng MediaTemple and there is a “manage your databases” in the admin. I can easily create a new database (I believe, however, it is a ‘virtual’? database…? if that makes a difference) and there is no place to assign a user (as I already have the database for the account.
Very confusing, but I’m wondering if this is the problem.
Any help is greatly appreciated.As I say, this has gotten me the furthest in two years!
I am wondering if it’s easier to just upload the new custom theme into the wordpress theme folder and not mess around with any config files? That seems to work pretty well for me. Any thoughts Tyler?
Very usefull article, but i’m still need to edit my style.css file. but it’s ok now, thank you for sharing this..
Thanks for this tutorial