Update: I recommend using ManageWP to easily backup/restore/migrate your WordPress sites.
It often comes as a topic and I decided to write a quick tutorial on how to move your WordPress site from one host to another with zero downtime.
I will assume you are familiar with basic operations like database backup and FTP. So in order to transfer WordPress to new server you need to follow these steps:
- Backup the database from the old site and import it to the new site. Pay attention to database names.
- Change your wp-config.php in the old site to point to the database on the new site. Your old site will now run using database based on the new site and once you change the nameservers new site will have the up to date database. (You may want to check with your new hosting if they allow outside database access first. If not, you can skip this step and transfer the database at the end, when the nameserver change propagated)
- Backup your entire WordPress installation from the old site (this will include all your uploads, themes, plugins)
- Unpack your WordPress installation to the new site
- Change wp-config.php on the new site with new database details
- Change the nameservers to point to the new site
- That's all now you only need to wait :)
Since nameserver propagation can take up to one day, step 2 allows you to have up to date database at the moment it happens. Downside to this is slower site response in the meantime because site still runs from the old server and the database is on the new. But if you do this over the night or periods of low traffic it won't be that noticeable and you will not lose any comments or other activity on your site.
Update: You can use ManageWP to move a WordPress site with less hassle.
Suggested reading:
- How to do a full WordPress backup and restore
- Ultimate solution to weird UTF character encoding problem
- How to disable and delete post revisions in WordPress
Posted in: WordPress
TAGS:change server path wordpress, changing wordpress absolute path, install wordpress, move server wordpress, move servers wordpress, move wordpress, move wordpress database, move wordpress different server, move wordpress installation, moved wordpress photos missing, moving server nameserver, plugin change server wordpress, wordpress absolute path, wordpress another title, wordpress attachments absolute path, wordpress change server images, wordpress help, wordpress hosting, wordpress migrate server, wordpress move absolute path, wordpress moving, wordpress moving plugin, wordpress moving server, wordpress plugin downtime






70 Comments
Hi, thanks a lot! I have a question, step number 3, I download via ftp my wordpress directories in the old server, and then in the new server I install wordpress, and after that I upload the files I downloaded from the old server?
I hope you can reply, thanks a lot!
if you do this over the night or periods of low traffic it won't be that noticeable and you will not lose any comments or other activity on your site.
Hey, I just found a completely free wordpress plugin that will move an entire wordpress site with just a few clicks: http://www.movewordpress.com/
i want to use ur tips while changing my host for http://www.infoheaps.com
thanks
Thank you for your great instructions. But I still came across a question, which I didn't find a solution. How do you move all the links from the blogroll? In particular from a single installation wp 3.2.1 to wp 3.2.1 multisite?
- Martin
Ok...Thanks...for the interesting info...good for users :)
Grat info. Must read before selling on flippa !
Thanks for this, however something strange is happenong to me.
I've followed your steps ( not necesarily in that order) and have a working WP install at the new server location. However, instead of pulling all the DB info from the old server install ( posts and other options), it set up a brand new blog, as if it was not pulling anything from the DB.
However, it must be connecting to the right DB, otherwise I'd get a " error establishing connection" message... Is not that strange?
But how I change to the all URL to localhost to my domain name in my database ?
So glad for this blog. Thank you! I am moving a localhost site (Multisite) to Network Solutions. I followed step by step your instructions but I'm getting a "Error establishing a database connection" message in the browser when I check to see if my site transferred. Before I try it again what do you mean by "Pay attention to database names"? I created a new database name when I imported my database copy to NS hosting. I changed all references of localhost to netsolhost and changed the url too. Do these pieces of code look right in my wp-config.php file? Does MySql hostname seem right? It used to be localhost when I ran it locally.
/** MySQL hostname */
define('DB_HOST', 'netsolhost');
and
define('WP_DEBUG', false);
define('WP_ALLOW_MULTISITE', true);
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', false );
$base = '/wordpress/';
define( 'DOMAIN_CURRENT_SITE', 'tinasher.com' );
define( 'PATH_CURRENT_SITE', '/wordpress/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );
That would mean that WordPress could not connect to it's database.
Check your host,username and password in wp-config file. Make sure you have imported your database.
Finally, ask your hosting support for help that's their job.
That's just it... they referred me to your blog. Any help you can give me is appreciated! I'm doing your steps over because I think I replaced localhost and wordpress incorrectly in my mysql dump file and my wp-config file might be off too with the names. NS gives me this tip before I import the database:
"You will get the best performance from your database if you use the server name in your scripts and code that calls it. If you need the IP address for a database, select it, click "Edit" "
So this is my question: My "server name" generated by NS is mysqlv101. Should I replace all instances of "localhost" in both places with this? Is host my server name too or is it tinasher.com (my domain)? And does that mean that in my database sql file:
'http://localhost/wordpress/tinasher/portfolio-2/web/ becomes 'http://tinasher.com/wordpress/tinasher/portfolio-2/web/ ?
or
'http://localhost/wordpress/tinasher/portfolio-2/web/ becomes 'http://mysqlv101/wordpress/tinasher/portfolio-2/web/ ?
And where do I put the IP address?
I am thrown with all these naming definitions...
Hi Tina,
I know this is a late reply. But I found what is your problem. But this may help someone else.
You should give the Server Name generated by NS instead of 'localhost' in config.php
Change the 'netsolhost' to 'mysqlv101' in the config.php.
/** MySQL hostname */
define('DB_HOST', 'netsolhost'); /** Change this line*/