How to move a blog to a new host

By Daniel Scocco

Daily Blog Tips was experiencing some downtime and slow server issues with my previous host (I will write about how to choose a good host soon). As a consequence I was forced to move to a faster and more reliable one. Despite my worries that something would certainly get messed on the transfer the move was really smooth. Below you will find the steps that you should follow to transfer your blog to a new host without losing any data and without experiencing any downtime.

  1. Disable the WordPress Cache and the WP-Cache plugin if you use it
  2. Use an FTP application to copy all your site files from the old host
  3. Backup your MySQL database (you can use phpMyAdmin to do this)
  4. Delete all the files inside the Wp-Content/Cache/ folder
  5. Upload all the site files to the new host
  6. Create a new MySQL Database on the new host, and import all the tables from your backup
  7. Change the wp-config.php file with the new user name, password and database name
  8. Change the DNS of your domain to the nameservers of the new host

It will take up to 48 hours for the new DNS to propagate across the Internet (sometimes it can be much faster), once all the search engine bots and visitors are being directed to the new host you can shut the old one down.

If after you make the transfer you start to get 404 errors on the links you should update the Permalink structure on the Control Panel and make sure that the new host has Mod Rewrite enabled.

Monetize Your Site




Share

15 Responses to “How to move a blog to a new host”

  • Mike Panic

    Nice write-up. I have a feeling I’ll be moving web hosts again in the next few months and I am not looking forward to moving my wordpress blog. Something about moving MySQL tables always makes me a bit nervous.

    I did find a nice little program to track your web hosts uptime, you can read about it here.

  • Daniel

    Mike, drop me an email if you run into any trouble. Once you have the MySQL database backed up you are really OK, even if things mess up on the installation you can just remove everything, install a frash WordPress pack and import the database.

  • Bes Z

    This is good Daniel. Unless you meant the information below in your step # 7 above, here is a tip too:

    Setup WP on the new host while keeping everything running on the previous host. Copy, not yet delete, the mysql databases and files to the new place. Then, on the old host, setup the WP config file to use the ip address of the new host instead of “localhost” to point to the mysql database on the new host.

    Then, change the names and settings and everything along with nameservers. That way, while the changes are happening, the mysql database on the new host will be updated even if the domain is showing pages/info from the previous host. Once you ping the domain name and see that things are running smoothly from the new host, delete everything on the previous host.

    That way, there will be no downtime whatsoever, as even when the old host is managing your site because of the nameservers pointing to the old host. The mysql on the new server will be the one that will be updated for every comment, post and other activities because of you putting the ip address for the mysql host in the WP config file.

    Hope that helps. 🙂

  • Daniel

    Bes, that is a very nice idea to keep the new database updated if people make comments or if you change things while the DNS is pointing still the to old host.

    Thanks for sharing!

  • Blake Acheson

    I hope your new hosting company would not have your mysql server internet accessible. Thats a serious security risk. Sure the probability of someone compromising your host’s mysql server are low but it’s always possible if a door exists.

  • assotte

    Good stuff, very nicely done.
    http://srubibablo.com
    All the best!

  • assotte

    Excellent site with fantastic references and reading…. well done indeed…!
    http://unikont.com
    There was merrily!

  • A Thankful visitor

    Thank you for this wonderful article! Straight to the point and saved me a lot of headache! Thanks again!

  • Bang Kritikus

    So good

  • Free Web Directory

    after moved my blog in to new host i can’t login my blog ??

    Why ??

Comments are closed.