Somehow, I have ended up with my WordPress installations scattered over three different hosting accounts. This has been bothering me for a while, as I’m paying for three separate hosting accounts and I only need to be paying for one. To start the process, and as a form of catharsis, I thought I’d write a tutorial about how to migrate from one host to another. That way I feel like I’m doing something useful while actually I’m doing something boring.
To start with, I want to move my sites from GoDaddy to HostGator (my other sites are on Coolhandle who are even more useless than GoDaddy but I’ve got to start somewhere).
Before you get started it’s a good idea to tell anyone who works on the site that you’re migrating it and they should not make any changes to it until the migration is complete.
1. Backup your Database
First of all make a backup of your database. If you’re working on GoDaddy or something similar you’ll find your MySQL DBs under Databases > MySQL
Click the database you want to back up and enter the login details. Make sure you change your database type to English (UTF-8) when you log in.

Tip: If you can’t remember your database password you’ll find it in your wp-config.php file
Click on your database.

At the top you’ll see a tab that says “Export” click here.

Now you’ll be presented with options of what you wish to back up. Make sure that all of your database tables are selected, along with SQL.

Under Structure, make sure that the following are selected:
- Structure
- Add DROP TABLE / VIEW / PROCEDURE / FUNCTION
- Add IF NOT EXISTS
- Add AUTO_INCREMENT’
- Enclose table and field names with backquotes

Make sure the “Data” checkbox is ticked.

You should end up with something that looks a bit like this:

Select “Save as File” and then click “Go”

Your database will back up. It may take a few minutes, depending on the size of your database.
Featured Plugin - WordPress + Google Maps = Perfect
2. Create Your New Database
Now I’m going to hop over to Hostgator where I’ll create my new database.
Log in to CPanel (or Plesk) on your new host and look for where you can create a new MySQL database. In Hostgator it’s about 2/3rds of the way down the page. Click on “MySQL Databases”.

Add the new database name.

Add a database user, or add an existing user to the database. I’m going to use one that I’ve already created.

3. Import Your Site’s Database
Once you have created your user return to your CPanel homepage. Scroll down until you find phpMyAdmin.

Click on the database that you want to access.

Look for the import tab at the top bar.

Browse for the file you want to import. Leave the character set as utf-8.

Make sure the Format is set to SQL. Click “Go.”
Leave it to do its thing.
Once it’s ready it’ll let you know. Your database for your site now has a new home on your new host (which isn’t stupid GoDaddy – w00t!)

Tip: if you are using a host which allows outside access to your MySQL databases you can use a trick from Vladimir Prelovac to avoid any downtime to your site. Unfortunately, it’s not going to work with Hostgator.
Featured Plugin - Start Your Own Powerful Membership Site
4. Download your Site
Open up your favorite FTP program and navigate to your site. Download all of the files onto your computer. This might take a while – go make a cup of tea!

Open up wp-config.php and update the MySQL details with your new database.
You will need to change the following:
- Db_name
- Db_user
- Db_password
- Db_host

5. Upload Your Site
With your new wp-config.php details inserted you’re ready to upload your site onto your server. Using your FTP program drag and drop the files you want onto your server.

6. Change Your Nameservers
Unless you have transferred your domain to your new hosting company, you’ll need to update your nameservers. This process can take anything from 2 hours to 48 hours.
Log into your Domain Manager. Select the site you want to edit and then click “Nameservers”

Click “Set Nameservers”.

You will get your new nameservers from your new host. When I signed up with Hostgator they came with the account info email.

Wait!
My site took about 10 minutes to transfer the nameservers – so you might be lucky! You can do a Whois lookup on DNS Stuff to see if your nameservers have moved.

And that’s it – your site is moved to your new host. Easy! Now I’ve only got another few dozen to do….
It gets a lot more complicated if you want to change your site’s domain. Want me to cover that too? Let me know in the comments – otherwise check out the WordPress Codex!




Plus 1 for the “How to change your domain name also” tutorial. This was great! Thanks so much for taking the time!
Much easier and quicker if you use the plugin “Back Up Buddy” from ithemes.com. I have used it several times and it literally takes a few minutes.
iya betul. caranya terlalu rumit. tidak sederhana
Or you could use:
http://managewp.com/how-to-move-wordpress-site-to-new-hosting-using-managewp
Pingback: Running WordPress Multisite with MAMP « Socializing the Network
Great stuff, but moving a multisite is more difficult – even the codex says so….any tips there, from dev folder to root, or over to another server – both are fraught with difficulty – unless someone knows different, or there is a magic plugin somewhere..I wish..:-)
sweet! this tutorial is going to be very handy.
hey – just out of interest – why are you moving from GoDaddy?
when I signed up a few years ago they were excellent – but in the last year or two I’ve had frequent latency & downtime issues which GoDaddy has not resolved for me.
would you recommend Host Gator?
cheers
imacg: Same boat. Full of holes. Been trying options for two weeks with varying degrees of success. Complicated by going from Linux to Windows IIS.
I can get the data transferred, and see it all in phpmyadmin, but can “fix” the base tables to recognize any of it.
If you find a solution, please share / email.
Do these instructions work for multisite? I need to move from one server to another… any words of wisdom on how to best go about it??
Thanks!
This is good info. However I would suggest buying backupbuddy folks. http://pluginbuddy.com/purchase/backupbuddy/ best money I have ever spent. Saves me so much time. Although not advertised or technically supported, tt will move multisite flawlessly as well. Done it 10 or so times with out a hitch.
Got BackupBuddy and have been futzing with it for a month and have not been able to reliably move my multisite to the new server. I want to move to Amazon AWS EC2 infrastructure and not sure if that had anything to do with the issues encountered but right now I am back to looking at a manual process of transferring my multisite.
BackupBuddy is the best and only way to do it. Super Easy!!!
Does it migrate serialized arrays? as in replace url, then rewrite the serialized array with the correct index?
If you mean fix the urls in your content, yes. If you mean something else, I’m not sure you would have to ask the iThemes team.
Have you gone from Linux to Windows IIS?
My Linux multisite does not have a wp_options table.
The windows site does.
I can’t seem to get wp_1_options to be the default on the windows site.
Nice one, a great tutorial for the beginner :)
I do the same for the database (using phpmyadmin). I copy the files directly between the server using rsync. The way is much faster, after I’ve changed the database settings On the new server), it’s time to change the DNS.
I noticed that Super-Cache needs a new path too: just disable/enable the plugin and the path is updated (you need to restore the other settings after that)
Migrating when there is alot of serialized data in wp_options as well as wp_postmeta is what I am curious about, I always have issues when I have a site with plugins that utilize serialized data, especially when migrating from a dev environment to live. Any tips, pointers or tools to ease the pain?
Thanks!
Great Tutorial Thanks! I always follow a similar process for moving a WP installation from localhost (for development) to stage (domain 1) and then to live (domain 2) – So there’s a lot of moving ;) My questions is, when moving I always download the DB, open in Notepad then do a search and replace for the old domain, new domain in the SQL DB, save and then upload this “new” DB so that all links, images, etc work. Once uploaded all I usually have to do is update to permalink structure to write the .htaccess again and everything is 100%. Is this the right (optimal) way to do this?
Pingback: Migrating WordPress to a New Server | Wiki
Thanks for the great how-to article. It’s the best I’ve seen on the subject. The annotated screenshots are do a wonderful job of highlighting the relevant action needed. It will be the reference that I’ll point people to when they need help on how to move a WP site.
Hello,
Thanks for a great article.
What comes to moving from domain to another i have used a long time a tool called “Safe Search and Replace on Database with Serialized Data”.
The tool can be found here http://interconnectit.com/124/search-and-replace-for-wordpress-databases/
I have nothing to do with this tool other than it’s been a life saver many times.
Damn i was searching for this article.. Thank u. you helped me a lot :D
Pingback: most Popular wordpress tutorial part:3 | Write For Share
Pingback: A few Wordpress resources to end the year