MakeTechEasier
  • Home
  •  
  • About
  •  
  • Archives
  •  
  • Jobs
  •  
  • Advertise
  •  
  • Contact Us
  • Windows
  • Linux
  • Mac
  • Internet
  • WordPress
  • iPhone
  • Android
  • All Categories
    • Android RSS
    • Firefox RSS
    • Gaming RSS
    • Google RSS
    • google chrome RSS
    • Internet RSS
    • iPhone/iPod Touch RSS
    • Linux RSS
    • Mac RSS
    • Mobile RSS
    • OpenOffice RSS
    • PC Hardware RSS
    • Review RSS
    • Roundup RSS
    • Windows RSS
    • Windows Mobile RSS
    • WordPress RSS
    • WordPress Plugins RSS
  • rss icon
  • email icon
  • facebook icon
  • twitter icon

[Hacking WordPress]: How To Clone And Migrate Your WordPress Blog To New Server

Posted by: Damien on January 30th, 2008
  • 39 Comments
  • Share

wordpress logoIn the event that you need to migrate your current WordPress blog to a new server, or a new URL, the last thing that you want to do is to reinstall WordPress on your new server and reconfigure the setting all over again.

While you can use the export/import function under the ‘Manage‘ menu to migrate your database over, it is definitely not the best and ideal solution, especially if you have a huge database. In addition, if any of your plugins created their own databases, they aren’t going to be migrated by the export/import function.

To migrate your WordPress blog, the best and the easiest way is to clone it and plug it into the new server. Since WordPress is a database driven platform where all its configuration settings are kept in the database, we can achieve a cloning effect simply by backing up all its database tables (including those created by the plugins) and dump it into the new server database. There is no need for reinstallation or reconfiguration.

Here’s how you can clone and migrate your WordPress blog to a new server in 10 steps:

  1. Download the wp-db-backup plugin.
  2. Upload to your existing server and activate it via the ‘Plugins‘ menu.
  3. Go to the ‘Manage‘ -> ‘Backup‘ menu. Select all the tables (including those tables created by the plugins) and click the Backup button to download the gzip file to your computer.
  4. In your computer, extract the gzip backup file. You should now have a sql file.
  5. Open the sql file with a text editor. Search for the line

    INSERT INTO `wp_options` VALUES (1, 0, 'siteurl'

    You should see something of this format:

    INSERT INTO `wp_options` VALUES (1, 0, 'siteurl', 'http://www.your-old-url.com', 'yes')
    Replace the URL with your new server URL

    Next, search for the line

    INSERT INTO `wp_options` VALUES (39, 0, 'home',

    You should see
    INSERT INTO `wp_options` VALUES (39, 0, 'home', 'http://www.your-old-url.com', 'yes')
    Replace the url with your new URL. Save and exit.

  6. Using a FTP program, download the whole WordPress folder from your current server to your computer. Keep the folder structure intact, especially the wp-content folder.
  7. Log in to the PhpMyAdmin in the new server (here is the instruction to access your PhpMyAdmin)
  8. Create a new database for your wordpress and import the sql file to the database
  9. Change the database configuration in the wp-config file in the WordPress folder that you have downloaded
  10. Upload the whole WordPress folder to the new server.

Done. You can now proceed to your wp-login page at the new server and login with the same username and password. All the configuration and settings will be the same as before.

If your WordPress database (the sql file you have created) is more than 2MB, the above method might not work since PhpMyAdmin only allows a maximum of 2MB file import.

To overcome this, you can use bigdump to dump the sql file to your new database.

  1. Download the bigdump file from here (This is a customised version that I have modified to work with wordpress blog)
  2. Unzip the file.
  3. In the ‘restore‘ folder, open up config.php and change the database configuration.
  4. Copy and paste the sql file into the folder.
  5. Upload the ‘restore‘ folder to your new web URL
  6. On your browser, navigate to the url http://your-new-web-url.com/restore/bigdump.php
  7. Click on the “Start import” to import the sql file to the database
  8. Once completed, upload the whole WordPress folder to your new web server.

Done.


Damien Oh is the owner and chief editor of Make Tech Easier

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Share and Enjoy!

  • Rss feed
  • StumbleUpon It!
  • Del.icio.us
  • reddit

Related Posts

  • The Safe Way to Change your WordPress Database Table Prefix
  • 8 Useful Tricks To Clean Up & Streamline Your Wordpress Database
  • How to Install and Test Wordpress on Your Mac
  • 4 Hidden WordPress Features That Are unknown to Many
  • WordPress: How to Separate Pingbacks From Comments

Popular Posts

  • Turn Your Ubuntu Hardy to Mac OSX Leopard 498 comment(s)
  • Turn Your Ubuntu Intrepid Into Mac OSX Leopard 311 comment(s)
  • Download EASEUS Partition Master For Free – 24 Hours Only 174 comment(s)
  • 28 Coolest Firefox About:Config Tricks 122 comment(s)
  • How To Boot And Install Windows 7 From USB Flash Drive 122 comment(s)

Enjoyed the article? Subscribe to Make Tech Easier today to get your daily updates of technology tutorials, tips and tricks.

Enter your email:

5 pingbacks/trackbacks (Click to open)

  • Interesting Posts Around the Web - Feb 11 | Interesting Observations
  • Mudanza del blog | Thuer.com.ar
  • Metal Martian » this is a test
  • wordpress?copy | Google analytics, ??????
  • Moving Wordpress Blogs the Easy Way | Ley'ing it Out
[Click to close]

39 Responses

  • Mary Riley says:
    January 30, 2008 at 3:42 pm

    Thanks for the useful information. Too bad there isn’t a good way to transfer backlinks when you move to a server with a different domain name.

    Reply
  • Damien Oh says:
    January 31, 2008 at 2:14 am

    @Mary: A good way to bring the backlinks along with you is to place a Redirect 301 on your old server, pointing to your new site. Though the backlinks won’t show in your blog, but the traffic will still reach your new site.

    Reply
  • Pete White says:
    February 13, 2008 at 12:22 pm

    Alternatively you can use the export and import function already built into Wordpress without having to install any additional modules.

    Reply
  • oscarlopez says:
    August 9, 2008 at 4:49 pm

    hello i don´t seem to find
    INSERT INTO `wp_options` VALUES (1, 0, ’siteurl’ nor
    INSERT INTO `wp_options` VALUES (39, 0, ‘home’, in my sql can u tell me why? i´m useing wp 2,6 version

    Reply
    • Matteo says:
      September 30, 2009 at 4:44 am

      Are you using a prefix to the tables? es: INSERT INTO `prefix_wp_options` VALUES

      Hope this would help you.

      Reply
  • Damien says:
    August 10, 2008 at 7:48 am

    @oscarlopez: Did you use the wp-db-backup plugin? The above technique should work in WP2.6 as well.

    Reply
  • oscarlopez says:
    August 11, 2008 at 9:44 am

    hi yes i did…but i can´t find this in the sql..

    Reply
  • Damien says:
    August 11, 2008 at 10:11 am

    @oscarlopez: Which version of wordpress are you importing from?

    Reply
  • oscarlopez says:
    August 11, 2008 at 10:40 am

    2,6

    Reply
  • Mario says:
    September 1, 2008 at 5:46 am

    Hello Damien, I think this is a good tutorial for this kind of issue, but I wonder if the special characters get lost in spanish blogs, for example the ñ and accented characters ?

    Reply
  • jeremym says:
    October 7, 2008 at 5:12 pm

    What about the URLs contained in the INSERT INTO wp_posts fields?

    Reply
  • Damien says:
    October 9, 2008 at 3:31 pm

    @jeremym:The URL displayed on the address bar is based on the premalink structure that you configured within your WP admin page. The URL contained in the wp_posts field will not affect the actual URL displayed.

    Reply
  • AFUNA says:
    November 12, 2008 at 1:06 am

    Thanks a lot for this tutorial I think it was very helpful ..

    Reply
  • Nick says:
    November 24, 2008 at 2:00 am

    Hi Damien

    Great tutorial. I’m testing it now, but I did notice that there is a line:

    INSERT INTO `wp_options` VALUES (60, 0, ‘upload_path’,

    and that line contains the server path to my uploads folder.

    Assuming I’m cloning the installation to another domain, won’t I need to change that to match the new server path?

    Also I can see my URL in multiple additional places:

    INSERT INTO `wp_options` VALUES (85, 0, ‘dashboard_widget_options’,

    In 2 or 3 places regarding Google Blogsearch.

    INSERT INTO `wp_options` VALUES (90,

    that looks like it’s something to do with recent RSS feeds on the Dashboard?

    INSERT INTO `wp_options` VALUES (100,

    which look like my FTP settings

    and

    INSERT INTO `wp_options` VALUES (132, 0, ’sociable_conditionals’

    (Something to do with the Sociable plugin?)

    Wouldn’t these all have to be changed accordingly?

    Cheers

    Nick

    P.S. If you email me at the address I’ve used to post this comment, I can email you a copy of the SQL dump file so you can see for yourself.

    Reply
  • Russ Lipton says:
    December 2, 2008 at 12:47 pm

    Won’t the guid values of the posts in the remote database need to be changed, or is this covered by your reply above that the URL on the address bar of the remote weblog is determined by the permalink?

    Reply
  • Jay Medina says:
    January 25, 2009 at 10:29 am

    Damien, thanks so much for this tutorial. It allowed me to migrate my Wordpress site in less than 10 minutes! Thanks for saving me all the hard work of trying to figure this out myself!

    Best Regards,

    -Jay

    Reply
  • Eman Udik says:
    January 27, 2009 at 2:27 pm

    HORE!!! This tutorial is done!!
    now i have a good blog, you can see http://www.areaofgames.wordpress.com
    i cloned it from my suck friends http://www.radioactivemonkey.wordpress.com

    Reply
  • JJ Love says:
    March 25, 2009 at 8:40 am

    Good tutorial, but lacking some key points, and thence somewhat sloppy. Why even post an article like this if you aren’t going to follow up and answer questions? I don’t get it.

    Key points left out by the hasty author:

    1. You won’t see “INSERT INTO `wp_options` VALUES (1, 0, ’siteurl’” Instead you will see something like “INSERT INTO `wp_y6hww3_options` VALUES (1, 0, ‘http://www.yoursitename.com’”

    2. There will be multiple references to your old domain in the SQL file. Just do a global search and replace.

    3. In your wp-config file, the author generalizes and says “Change the database configuration in the wp-config file in the WordPress folder that you have downloaded” Change what? You need to change the user name and password to whatever your NEW database user name and password are AND the name of the database you created.

    I will post a much better version of this tutorial on my site soon and report back.

    Nice try here, but again, in the end it is incomplete

    Reply
  • dave says:
    March 26, 2009 at 11:52 am

    Many thanks for this.

    Some comments above indicate that a few points are missing or not very clearly explained, but I had no idea how to clone my site & with the article above I managed to clone & migrate my site to a new URL, so many thanks for a very informative post.

    Reply
  • Tom Harrison says:
    May 12, 2009 at 5:00 pm

    I’m with Dave on this one; if we add comments where there are issues, the “incomplete” post turns into “a good start” with some good notes! So here’s mine.

    Instead of updating the database manually to change the URL, you can change options in the wp-config.php file; there’s one for wp_siteurl and one for wp_home, documented here on the WordPress site. These don’t actually change the database values, but once the site is moved over, you can change them through the usual settings page (then take them out of wp_config.php).

    Reply
  • J loan says:
    July 1, 2009 at 6:30 pm

    For those of us with less time and technical experience, is there a fast and reliable 3rd party or company that can do migrations of entire site + wordpress?

    Reply
    • Damien says:
      July 5, 2009 at 2:17 am

      If you are changing web host, perhaps you can ask them for help. Some web hosts help their client to migrate to the new server for free.

      Reply
  • Rick van Vliet says:
    September 7, 2009 at 10:44 am

    Thanks for a good tutorial.

    Reply
  • Antonella says:
    September 13, 2009 at 3:12 pm

    Hi,

    Thanks for the tutorial. After I uploaded the site and database as described, I was able to get into the wp-admin and see the homepage of the site. However, I wasn’t able to see any other page, getting an error 404.

    I did a global search and replace for the URL but that didn’t help either. Any idea if I’m missing a step?

    Thanks,
    Antonella

    Reply
    • Jun says:
      September 15, 2009 at 3:40 pm

      Hi,

      i got the same problem as you had. After that, i try to update the database as referenced on line:

      http://www.mydigitallife.info/2007/10/01/how-to-move-wordpress-blog-to-new-domain-or-location/

      however, it still doesnt make any change.

      Did you solved the problem? anything new?

      Good luck
      Jun

      Reply
  • Jun says:
    September 15, 2009 at 3:34 pm

    I was trying to migrate my blog to a subfolder of a new domain(www.olddomain.com to http://www.newdomain.com/abc) and got the same problem as Antonella had. The main page was all right, however, lost all those links.

    Can someone give some hink what i did wrong?

    Thanks
    Jun

    Reply
    • Damien says:
      September 20, 2009 at 9:07 am

      1) Log into your phpMyAdmin.
      2) Locate the database for the current site
      3) Click on the table wp_options
      4) Locate the fields: siteurl and home
      5) Change their value to the URL of the new site.
      6) Save and exit.

      Reply
  • Jonathan Gray says:
    September 23, 2009 at 6:47 pm

    Many thanks for this! Very useful indeed!

    Reply
  • Keir says:
    October 1, 2009 at 2:31 pm

    Hi, great guide. It worded for us easy! However, we’re facing a issue I cant figure out.
    After the export/import, the install seems to have partially lost control over the existing directory structure (wp-content). The permissions are set correctly; media assets which were present before the exp/imp can be removed/ new ones added; plugins and themes can be added and removed. However, themes, plugins or directories present prior to the cloning process, seem to be beyond the control of the server.
    Specs:
    iis7 (I’m pretty sure)
    mysql (latest)
    wp 2.8

    Thanks for any help
    Keir

    Reply
  • Stephanie Benatar says:
    November 9, 2009 at 12:10 pm

    Be careful to configure the sql file correctly…
    They don’t mention this, but you also have to configure your uploads path, I couldn’t upload files because I hadn’t changed it.
    Look for INSERT INTO `wp_options` VALUES (59, 0, ‘upload_path’,’ yourpath ‘,’yes’)
    and modify it to your new uploading path

    Reply
    • Keir says:
      November 10, 2009 at 6:34 am

      Thnx, thats a good point. Will keep in mind.
      My problem boiled down to something much stupider:
      was giving ‘iis_user’ WRX permission rather than ‘i_user’… on the MS server…
      Daft.
      Solved.

      Reply
  • Bill Underwood says:
    December 16, 2009 at 12:59 am

    I have run into a “Internal Server Error” when I attempt to change pages. I have checked all paths in the database and in the site folder to ensure that this is not the error. Would expect a 400 there.
    I have also checked the details in wp-config.

    I am running 2.8.6 (current).

    Any Ideas folks?

    Bill

    Reply
    • Damien says:
      December 17, 2009 at 12:32 am

      Did you check your permalink setup or your .htaccess file?

      Reply
  • Bill Underwood says:
    December 19, 2009 at 1:01 am

    Yes. Both correct.
    I have the old site up and running and redeveloped under a new domain name on my development server. I am xferring between hosts and back to timelycopy.com.

    I create a new wp instance & install plugins & theme – all is well.

    If I copy the database via export, mod and import I immediately get the error.
    So I start again with a clean slate and copy and paste the home page from the old wp to the new. The error immediately appears.

    If i create pages in the new wp instance there is no error. U can email me on bill at the above domain name id u wish access.

    Thanks
    Bill

    Reply
Cancel reply

Leave a Comment




Comment

Please Note: Comments maybe under moderation after you submit your comments so there is no need to resubmit your comment again

write for MTE

Latest Posts

  • OfficeMedium – A Social Collaboration Platform For The Small Business + Free Promotions
  • MakeTechEasier Is Now Hosted On KnownHost
  • KTorrent: KDE’s BitTorrent client
  • How to Create a Customized Toolbar for Your Browser
  • 13 Ways To Customize Ubuntu Netbook Remix For Better Usability

Our Writers

  • Damien Oh - Chief Editor
  • Sharninder - Geeky Ninja
  • Joshua Price
  • Tavis J. Hampton - Lantern Torch
  • Shevonne Polastre - FreeAgentWriter
  • Trevor Dobrygoski
  • Soumen Halder - Ampercent
  • Tanmay Ahmed - Tech-Tips-Geek
Make Tech Easier on Facebook
Jobs by SimplyHired
Job Widgets

Copyright

All the articles (including the text, images and tutorials) are properties of MakeTechEasier.

You cannot copy whole tutorials, either in English or translate to another language without our permission.

Write for us

Writing a tutorial or article for MakeTechEasier is a great way to get exposure and give back to the community.

Read More Details

Suggestions

We need your help to help us serve you better! This is YOUR site, so if you have suggestions/feedbacks on how we can improve it for you, please let us know! We do our best to make this place better!

Make a Suggestion

Navigation

  • Home
  • About Us
  • Advertise
  • Archives
  • Contact Us

Copyright © 2007-2010 Make Tech Easier | All Right Reserved.