About

I am Ajith Edassery, a software engineer and part time blogger from Bangalore, India. Blogging is my pastime and I use this space to write about Blogging Tips, Internet marketing, Search Engine Optimization and How to Earn Money Online. Read more in the about page and subscribe to my updates using the form below:

Partners

HostGator VPS
MAX CDN

Subscribe to RSS

Subscribe by Email

Your Email:

Communities

Move your WordPress Blog to another host or server in 10 easy steps

Ajith |  Aug 2009 | Blogging Tips, How Do I?

Last week I moved this WordPress based blog to HostGator. Moving the blog to a new host service is usually a delayed decision for most people. This is mainly because of the fear of loosing data, potential downtime, lack of technical knowledge and even worries about the new service’ quality. Many times, people pay a lot more for renewing their current hosting services than switching to a cheap hosting that offer better service due the above worries.

Get 25% Discount on any HostGator Hosting plan via Our Coupon code: DOLLARSHOWER25

hostgator-order-now

Moving your WordPress blog is no rocket science and it is so damn easy if you follow the steps given below.

10 Simple steps to transfer WordPress to new Server or Host

Step #1 Prepare the new host space

Create a directory on your new hosting space where your blog has to be moved to. If your new host supports multiple domain hosting, you might want to add an addon domain using the cPanel. As much as possible, try to use the same directory name as your existing blog installation directory in order to simplify the moving process.

Step #2 Do a fresh WordPress installation

Now use your new host’s cPanel Fantastico tool (or the famous 5 minute install) to do a fresh WordPress installation.

You have to make sure that:

  • The new WordPress release version is the same or higher than your current WP release
  • Use the same admin panel login & password as your current installation, to simplify things
  • Use the temporary WordPress installation URL to fill the WordPress address (URL) parameter in your WordPress Admin=>Settings=>General page. Also, change the Blog address (URL) accordingly (e.g. something like http://YourHostServerIPAddress/YourAccount/YourDomain.com/)

Visit your new blog installation using the ‘Blog address (URL)’ set above and make sure that the new WordPress installation (without your posts and theme) works fine. In order to avoid any accidental overwriting, you may want to keep a backup of your new wp-config.php in a safe place.

Step #3 Upgrade your current WordPress installation, if needed

From Step #2, if you installed a newer release of WordPress on your new host, make sure that your current WordPress installation is upgraded to that release via the standard upgrade process. It is better to complete the upgrade activities on your current playing field than on a new server and host. After the upgrade make sure that your upgraded WordPress blog and all your plugins work fine

(This step can be avoided if you decide to keep the target (new) WordPress release the same as your current one from Step #2. But this may not be possible when you use)

Step #4 Backup your current wp-content directory

Use your favorite FTP program (like the free FileZilla FTP tool) to backup the whole wp-content directory. In addition, you have to backup your robot.txt, wp-config.php and .htaccess files. Backup any other folders (e.g. download, temp, junk etc) and files that you might have created as well.

Step #5 Backup your current WordPress database

Use a tool such as phpMyAdmin (mostly available in your cPanel) to export your current WordPress database. Do not use the export feature in your WordPress admin panel as this would not take all your current settings but only the content (basically posts, pages, comments etc).

While using phpMyAdmin export, please make sure that you select:

  • All your WordPress tables and SQL as the Export option
  • Add DROP TABLE/VIEW/PROCEDURE/FUNCTION option
  • Save as File

Now, when you hit ‘Go’ you will be prompted to save the database backup file on to your disk.

Step #6 Upload wp-content folder, .htaccess and wp-config.php

Use your FTP program to connect to your new host to overwrite the new wp-content folder with the backup that you created from step #4. Also, make sure that the .htacces files are uploaded to your new blog directory.

Step #7 Import your WordPress database

Open the phpMyAdmin tool from your new host cPanel, select the new WordPress database (usually named YourAccountName_wrdp1), and click the import option. Select the database backup file from Step #5 to import the entire data into your new WordPress table.

Step #8 Test your blog with the new host

Now it’s time to test your blog on the new host but before that you have to change the following settings.

  • Just like you did in Step #2, change the General Settings blog URL to the temporary blog directory of your new host. With the database import, it may be now pointing to your actual domain name (e.g http://www.yourdomain.com)
  • You do not need to upload your wp-config.php file, if you started with a fresh installation of WordPress as in Step #2. But if you opted to create a new database from the backup (using Step #5) and then setup WordPress, the old wp-config.php values may be handy

Now, test your new WordPress installation with the imported content and your blog theme using the temporary blog URL just like you did in Step #2.

Step #9 Import your mails, save your new comments etc

Before you make your domain permanently point to your new WordPress blog installation, make sure that you:

  • POP (download) all mails from your previous host to your Outlook or your email client
  • Copy any new comments (Commenter’s name, email, URL, comment text) that might have come during your installation so that it can be manually added to relevant posts later

Step #10 Switch the name server values

Logon to your domain registrar account (sometimes it is the same as your old hosting provider) and change the name server values there to make it point to the nameservers provided by your new host. After this, you have to log on once to your new WordPress control panel and change the blog address (URL) and WordPress address (URL) values to make them point to http://www.YourDomain.com/ and its WordPress directory (only if WordPress was installed in a different directory – for example, http://www.YourDomain.com/wordpress). Make sure that everything works fine

Troubleshooting tips

If you did not make any mistake and religiously followed the above ten steps, things should just work fine. Most of the issues are related to the wrong Blog address and WordPress address in the General settings section of your new WordPress admin panel. If you are not able to access the admin panel itself, you may want to use phpMyAdmin to open your new WordPress database, go to table wp_options, browse the rows and check the value of siteurl there. If it’s still pointing to your temporary installation directory or some other wrong value (check for typos), you have to correct that row manually.

If things still do not work, disable your plugins one by one and test. I had some problems with the Google XML Sitemap plugin which needs the chmod values of your sitemap.xml and sitemap.xml.gz files to be set to 666. You can do chmod settings for these files from your FTP tool.

The other common problem is the wrong wp-config.php usage. If you can’t connect to WordPress at all, please make sure to open and check the DB_NAME and DB_USER values in your wp-config.php file.

Further tips and precautions

  • You can take the screenshots of your General settings, Permalink structure, Active plugins page and complicated settings pages of important plugins such as Google XML sitemaps, All-in-one-SEO plugin etc for future reference
  • Keep important long text value (e.g. keywords) in some text file
  • Before starting the upgrade itself, you may cut-paste backup the contents of all your widgets into some text file. I lost my widgets during the upgrade process
  • Once the upgrade and move is complete, make a complete back up of your new WordPress installation directory on the server itself renamed to something like WP_2.8.2_Backup so that in case of any mistake done, you could rename and use this directory
  • Never upgrade your plugins blindly even when the Plugin info claims that it is compatible with your WordPress release version. Make sure to backup the plugin folder before attempting to automatically upgrade it
  • Check with your hosting service support team if you can’t solve the issues yourself. HostGator provided me wonderful chat support to fix some of the issues that I faced
  • Choose an appropriate time to upgrade when your ISP is running in full throttle – I have minor issues with my ISP (Airtel) which suddenly slows down post midnight

I hope this ‘How to’ tutorial is useful to some of you and if so please do not forget to bookmark. Also, let me know if I missed out any point or steps. You can even ping me on twitter for free consulting if you encounter any problem with your WordPress move when you go for your next hosting provider.

Happy Blogging (with WordPress)!

Comments (50)

  1. My brother just asked me to learn how to move the files to the new host yesterday and you write this tutorial. I’ll be following your tutorial to move my files when I switch my current hosting to Hostgator! Thanks for this tutorial Ajith! :D

    Regards,
    Lee

  2. Great tutorial, you have covered all points neatly.I was relaxing as Hostgator Guys did my host change.
    This tutorial is useful those who are in waiting to move to HG,like Arun.

  3. Great Ajith. I can imagine how much it took for you to put down all these steps in a proper format.

    Thanks a lot Ajith. I just bookmarked it for my future ref.

  4. It will help a lot of blogger out there, its good you are writing what you have experienced.

  5. Just my 2 cents Ajith

    1st hostgator is amazing as they provide free blog migration. But if anyone is doing of its own he should be technically sound else chances are high that he will Get into trouble…

    Meanwhile The procedure is very simple But need few careful steps …Like exporting and importing mysql database….

    more over I’m little unclear about the database thing which you have explained here…

    I will try to make it more simple..

    Export the database to you system

    Install Wp on new host…

    Drop all the existing tables on new host and upload the database…

    Configure the wp-config file for new database..and that is only 3 things needed to be chanved here…

    Upload the wp-content file which you have mentioned…

    Though there are few problem faced by new migrated blog like internal permalink might not work, home page will work fine but Internal pages will go blank….

    For such problems.. Make sure cache is cleared, check .htaccess file and 3rd solution is very silly and i.e = create a new page publish it and delete it…

    One problem which I have seen with hostgator is..when people use hotlinking protection from the panel.. The images will stop showing in feeds and many posts… I get in touch with them but that does n’t help all the time..
    SO for hotlinking protection..go for the safer way and i.e .htaccess method….

    • Sri

      Hey Guys

      This articles seems to be very simple but I guess as mentioned by one of the member that you should be technical.. I guess there I am failing. I tried everything to move my well working site (still on my localhost) from one machine to another but getting 404 error on all the linked pages/posts except for the home page. Most likely permalinks issue as I have name-month based permalinks. I have installed latest wordpress and running it on winXP with wampserver. I verified cache, .htaccess etc. My htaccess looks like

      # BEGIN WordPress

      RewriteEngine On
      RewriteBase /heysri/
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule . /heysri/index.php [L]

      # END WordPress

      Appreciate if you can point me to right direction to solve this problem. It’s already 5days :-(

      • Sri,
        The problem sounds like the permalink issue though I am not an expert in that area. Did you check out the hack that Harsh mentioned above (i.e. creating a dummy post, publish it and delete)

    • Brilliant !

      “3rd solution is very silly and i.e = create a new page publish it and delete it…”

      Saved me a lot of hassle :)

  6. but backing up wp-content file take much time to save, is there any way to reduce this time?

  7. Well luckily for me I have someone to do that for me.. :)

  8. @Lee, hope your brother can use the tutorial effectively.

    @George, definitely HostGator is a great hosting service when it comes to support. But not all other hosts are that good and we might need to do it ourselves or hire somebody. This is for those who do it on their own :)

    @Lax, thanks for bookmarking…

    @Shanker, thanks for the compliments buddy.

    @Harsh, experienced people may take the route you mentioned. The approach I explained here does not include any drop of databases tables, no configuration to be done etc.

    @teratips, there is no short cut buddy. wp-content contains your themes, current plugins and uploaded images etc. You have to make sure that whole of it is backed up.

    @Custom Essays, exactly!

    @Melvin, great… but not everyone else is as lucky as you :)

  9. Great detail – has all that is needed for the move. If you had put this up a bit earlier I would have moved hosts instead of struggling and renewing !
    Will come back in 6 months time :-) .

  10. Great tutorial dude! You’ve also got a lot of nice WP content and info here…will definitely be back.
    Cheers!

  11. @Sushil,
    Give it a shot with courage next time :) It’s a lot simpler than we think. And if you do the transfer a week or ten days before the existing hosting account expires, you have enough time to sort out thinks.

    @Max, Welcome to DollarShower. Please do come back with more comments and opinions :)

  12. thanks for this information…will surely use it for our new updated wp website that is going live today or tomorrow to promote our dhow sailing, dolphin spotting, and snorkeling services here on kenya’s indian ocean coast by shimoni & wasini island. having problems connecting to our ftp server to install wp though…bummer.

  13. Great post ajith,

    THis will help me for sure in near future as i am thinking of moving to some other host. May be hostgator :)

  14. Thanks for the tutorial, i already move my blog.

    Dini

  15. Sri

    Thanks Ajith for your prompt response.. I tried all the three options suggested by Harsh. None is working. But, Yes, if I change the permalinks to ID based i.e. http://hostname/?p=10 it worked. All the pages work with ID based permalinks.

    I am using wampserver since I am still on localhost.I have to launch this on October 20. So I am worried if it will work when Iwill move it tohosting server. Appreciate if someone can help me!!

  16. dan

    woops, not sure what happened but some text went missing, must be too much coffee and an empty stomach. Please post this instead:

    I know this is sort of out of the remit of this tutorial but I am trying to move my wp site from the net to my local web server on my computer but I’m having some problems. I’d really appreciate help!

    I followed your guide to the letter but as soon as I switch to the current wordpress database – Step 7 – I get a completely blank screen (no source even). If I attempt to navigate my browser anywhere, like index.php for example, the browser attempts to download the page as a file instead of loading it.

    Something is obviously wrong, but what? My .htaccess file looks like this:

    # Use PHP5 as default
    AddHandler application/x-httpd-php5 .php

    # BEGIN WordPress

    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    # END WordPress

    Thanks for the great guide Ajith.

    • @Dan, did the issue get solved?

      The .htaccess looks fine. However, are you using your hosting service’ temporary URL to access your WP blog or your domain name directly? The AddHandler for PHP5 sometimes doesn’t work on temporary URL and hence it might try to download PHP files. I suggest that you contact your hosting provider to debug it faster…

  17. -dan-

    Hey Ajith,

    thankyou for your response. I actually solved the problem, phew!

    Basically, I had to modify all the entries in my exported database to point to the new url (ie http://localhost:8888/... ) before I imported them into my local database. My website txt editor dealt with this easily using its search and replace feature. After having done that, and after making sure that my new database was utilising the same encoding as the last, things are working ok.

    Sorry for emailing in such a panic ;-)
    All the best,
    Daniel

  18. hey howto shift from wordpress.com blog to hostgar

    • @Himanshu,
      If you are taking a new hostgator hosting, they will help you with the move. Even otherwise it’s pretty straightforward. Once you setup a new WordPress installation, all that you need to do is to ‘import’ (from Tools menu) your WordPress.com data (You have to first export the current wordpress.com data to a disk file and use that to import into new WordPress selfhosted db)

  19. Hello,

    I have a question. You have said:
    (e.g. something like http://YourHostServerIPAddress/YourAccount/YourDomain.com/)

    So can I access my hosting account – without specifying it as http://domain.com – using the IP Address and Account Name. Note the IP Address here is a Shared IP.

    Thanks,
    Ashwin

  20. Man… ‘~’ before the username really helped. You definitely saved a lot of work for me – working with a client. I am developing on my platform – because his DNS is pointing to this existing site which he does not want to lose but we are porting his site to a new host.

    Great help. Appreciate it…

    Regards,
    Ashwin

  21. [...] You may download and install wp-minify plugin via this link. The plugin is so easy to setup and all that you need to do is to keep its cache directory as read-write-execute (chmod 777). Unlike the super-cache plugin, you may not face issues while upgrading WordPress or even while moving WordPress to new host. [...]

  22. Douglas

    Hi there,

    My host changed servers and all websites now have a new IP address. Same domain name and nameservers, though my host and domain name provider are different.

    Please also note I never entered into my blog, a Name or description under General/Settings.That is when i could log into it.

    I can get into Cpanel but simply putting the newly advised IP infront of ‘/Cpanel’ however I can not reach the admin panel of my WordPress blog.

    I had been loggin into it via
    http://xx.xx.xxx.xx/~abcefg/abcefgblog/wp-login.php, my host suggested to simply insert the new ip in place of the old one. I still get the error message

    “404 Not Found

    The server can not find the requested page:
    Apache/2.0.63 (Unix) mod_ssl/2.0.63 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 PHP/5.2.12 Server at 74.50.108.14 Port 80″

    I have logged into myPHPadmin and found the wp-options table and searched for “SELECT * FROM `wp_options` WHERE `option_name` IN (‘siteurl’, ‘home’)”

    Only option ID 39 came up and the results are
    ‘Home’ has optionvalue
    http://abcefg.org

    ‘siteurl’ has optionvalue http://abcefg.org/abcefgblog

    Both of which appear correct. Is there any part of the mysql tables where I can change an actual IP address?

  23. Hi Douglas,
    If your host changes their servers and if the DNS remain the same, it is their duty to make sure that the new server IPs are included in the DNS lookup. You don’t need to do anything here.

    Now, in order to access the admin panel in the form http://xx.xx.xxx.xx/~abcefg/abcefgblog/wp-login.php (i.e. when DNS is not available) the site URL option has to be something like http://xx.xx.xxx.xx/~abcefg/abcefgblog because the other option that you have right now (i.e. http://abcefg.org/abcefgblog) would need DNS.

    I hope your host has sorted out the DNS problem already

    (PS: I am on vacation and have very limited access to the Internet. Please expect significant delays in replies)

  24. I’m no technical here, but you’d think that following the directions that are so clear would mean I couldn’t go wrong. Apparently I have a knack for it. I think I did everything according to the directions. I am getting a 500 Internal Server Error. I am not sure WHAT to look for, but this happens as soon as I upload the wp_contents folder, before I import my DB into the new one, so is there something that could be referring to the old DB in the content files? I’ve tried this more than 5 times and still get the 500 error and I’m at my wits end.

    Any help?

  25. Tricia

    appreciate this. this is the first time I have EVER successfully relocated a wp blog and held onto the content. Have tried many times….

  26. Thank you so much! I tried following instructions on other sites but they didn’t seem as concise. Your instructions worked out perfectly.

    I was under float hosting and quite frankly its a horrible hosting service. I’m back with bluehost now. thank you once again.

  27. @Tricia, @Samantha, you are welcome! I am glad that the post helped you to get through your upgrades smoothly.

  28. Thank you incredibly much. I had to reinstall WP no less than 3 times before I found this tutorial which worked it beautifully & easily!

  29. Hey, how about a tutorial for moving from 2.9.2 to WP 3.0 RC1?? :-)
    I can see a lot of people pulling their hair out over this one.

  30. Anil

    Hi, First of all a very wonderful post. Thanks. I am also thinking about moving my blog from my current host hostjava.net to a more reliable one. My blog remains down at least once in every ten days and it is seriously affecting the traffic. Could you explain a bit why u chose Hostgater ? So that I can also make the move.

    • @Anil, Among shared web hosting services, hostgator is among the best or the best itself. As a new customer, when you signup you get a very good discount as well. However, you have to sign up two or three years to get the cost benefit.

  31. All I can say is the Hostagor rocks!!! I’ve NEVER had problems with them…no down time…fast responsive customer service…low server load (when I peek the CPanel)…great apps via Fantastico Deluxe and Quick Install and on and on.
    I’ve been using them for about 3 years now and I don’t feel the need to look at other competitors because, well, I’m VERY HAPPY. :-)
    And I just got a $50 commission for referring my colleague here in Nairobi to their web hosting packages. Yeah!!!

  32. Hi Ajith, what a great post. Thank you so much for this.
    I am not at all a pro or in anyway technical. But I own a WP blog hosted by Fatcow and I am trying to transfer my blog to another account (with fatcow too, but they won´t help me without expensive cost). I have a simple question. In all of this, when or in which step do you actually transfer the domain (to reduce or avoid the down time)? thanks a lot.

    • Sai, the last step (10) is about changing the DNS IP addresses to the new host. It usually shouldn’t have any downtime though the DNS propagation takes upto 48 hrs. While it’s being propagated, the site will be pointing to the old host.

Leave a Reply

Please read our updated Comment Policy