Try Tuts+ Premium, Get Cash Back!
Migrating WordPress Across Hosts, Servers and URLs
videos

Migrating WordPress Across Hosts, Servers and URLs

Tutorial Details
  • Estimated Completion Time: 15-20 minutes
  • Difficulty: Beginner - Intermediate
  • Requirements: WebHost with PHP (5.2+), MySQL Database, & FTP Access
  • Required Programs: FTP Program, Text Editor, PHPMyAdmin

Last week we took a look at how to migrate a WordPress installation from a local server to production. Today we are going to take a beginner’s approach to moving your WordPress Blog either to a new host/server or even changing it’s address (url). So if you are changing your provider or just need a change in address (or even both) here is an in depth video on how to do it. If you’re a developer, this video is going to be very basic, but it’s a great reference for anyone who is trying out their first migration.

Getting Started: What You Need to Know

WordPress is a complex piece of software and to everyday users without a lot of dev experience, it can seem much more complex. So first off, I’m going to break WordPress down and define some terminology so you don’t get lost. Then I’m going to slowly take you into the actual nuts and bolts of moving a WordPress installation.

There are a lot of ways to define WordPress, but for the purposes of what we’ll be covering in this tutorial, your WordPress installation is comprised of 2 parts:

  1. Files on your website (php, css, html, javascript, etc.)
  2. A Database (holds all of the information)

The Files

In order for WordPress to work, it needs the Files to do the work of creating your website while the Database holds the content. These files are mostly made of up the PHP programming language. In order to see the files of WordPress, you have to login to your host or server via FTP (File Transfer Protocal). You can access the FTP of your site by using a program like WinSCP, Firebug or FileZilla for free. The information to connect to it should be provided by your webhost. To move these files, all you need to do is digitally move them like you would a file on a thumb drive. The only difference is that you are using the FTP program to get it to your webhost.

Database (MySQL)

While the WordPress files are pretty easy to get your head around, the database part of a WP installation can often seem a lot more intimidating. For starters, you can’t really just move it around like a folder of files; It has a protocol from which to connect to it. WordPress stores its data inside a MySQL database, which should be provided by your webhost/server. You’ll need a way to connect to it using a username, password, and hostname (where the database is hosted). Rather than learning the entire database language, you can use a program called PHPMyAdmin which runs on your website (or often in many Hosting Panels). PHPMyAdmin builds an interface for you to perform actions. We are going to use a few of the most basic tools while ignoring the majority of the application as you can seriously mess your blog up with this panel. I’d recommend you get in and out as quick as possible.

To simulate a move I will be creating a new blog sandbox for my own blog by moving it to the sub-domain “sandbox.devnot.es”.


A Caution to First-Timers:

It’s worth mentioning that messing with your MySQL database can be super dangerous if you’re not careful… lots of people are intimidated by even touching it and for good reason – one wrong move inside the database and you can ruin your entire installation! This tutorial is intended to help people out who are just getting their feet wet with this stuff, so I’d highly recommend that you don’t use a client project (or anything really important) as the test case for your first migration attempt. With that said, there’s really only one way to start learning, and that’s by trying it out for yourself!


The Video Tutorial

The video will walk you through the rest (we have some additional written documentation as well afterwards). Be sure to turn on HD and fullscreen for the video if you want to follow each and every letter! I’ve zoomed in on the important stuff, the text can still get blurry on the 600px wide video ;)

Note: We’ve updated the written portion below, but it’s worth noting up here (near the video) that we’re now recommending a small change: In the step where you change the URLs in the database, use a serialized-data sensitive search/replace tool rather than a basic text editor to avoid any problems. Grab one for free from InterconnectIT.


Step 1 File System

Before we can start moving our WordPress site we need to go over a few things about the File System WordPress uses, for those that don’t know. WordPress uses a naming convention which uses two characters “wp” to define that WordPress uses or needs that file. However there are only a few exceptions to that rule:

  • .htaccess
  • index.php
  • xmlrpc.php

In addition to those files there are a few optional files that are included with WordPress that aren’t required to perform, but are there for information reasons. It is recommended you keep these files as well:

  • readme.html
  • license
  • favicon.ico (if you have one)

From here everything else has a “wp” naming convention and should be easy to see what needs to be moved. You will need all 3 folders and their contents (“wp-admin”, “wp-content”, and “wp-includes”) as well as every other file. This makes a total List of :

If you are moving files on the same host or server you don’t need to make a local backup as you can move it on the host/server in a few seconds.

  1. wp-admin/
  2. wp-content/
  3. wp-includes/
  4. .htaccess
  5. favicon.ico
  6. readme.html
  7. index.php
  8. license.txt
  9. wp-load.php
  10. wp-login.php
  11. wp-links-opml.php
  12. wp-config.php
  13. wp-feed.php
  14. wp-pass.php
  15. wp-blog-header.php
  16. wp-rss.php
  17. wp-atom.php
  18. wp-mail.php
  19. wp-config-sample.php
  20. wp-settings.php
  21. wp-activate.php
  22. wp-cron.php
  23. wp-comments-post.php
  24. wp-rss2.php
  25. wp-commentsrss2.php
  26. wp-register.php
  27. wp-app.php
  28. wp-signup.php
  29. wp-trackback.php
  30. wp-rdf.php
  31. xmlrpc.php

Now that we know what we need we want to download all of the files to our local machine. This will make a hard backup so if we mess something up we will be able to start back where we were before. Once you have the files locally you can then upload then to the new location. Don’t worry you won’t get a php error, but a message that says it cannot connect to the database until you have finished the move.


Step 2 MySQL Database

If you are having a difficult time finding the username and password you can open up your “wp-config.php” file. This holds your username and password.

If you are moving the blog on the same host or server you can skip this step.

Assuming your changing to a new host/server OR changing the URL of your WordPress site: next we have to move over the Database end of WordPress. The database is what stores all of the interactions, data, and posts you and your users have created in WordPress. Rather than using WordPress’s Export Tool we are going to take matters into our own hands and take care of the database with a program called PHPMyAdmin which is a visual admin panel for MySQL databases such as the one WordPress runs on. Every major webhost will provide one with their hosting panel (cpanel, plesk, ect).

Once we are in the panel we need to select the WordPress database. Again we can reference our “wp-config.php” file and see that our database name (“DB_NAME”) is “devnotes_wp”. Click on that link and it will open up the interface on the right hand side. At the right hand top click on a link that says “Export”. From there you will ensure “Save as file” is selected, Compression is set to none, and then click “Go”. This will start a download of [DB_NAME].sql from which you will re-upload a the new host/server.

Don’t compress the sql file so we can edit it with ease in the next step.


Step 3 Change URL Address

Skip this step unless you are changing the address of your site or blog. This includes domains, subdomains, and directory changes.

So we are changing the URL of our site, be it the domain (.com), a directory, or a sub-domain. We need to update each reference to the old URL with the new one so our images on our posts and pages, settings, and other options work and won’t break once we restore the database to the new location.

You need a Editor program that has a “search and replace” feature. For Windows and Linux you can use NotePad++ for free, another good program is Sublime 2 (which is what I’m using). Search for your old url and replace it with the new one. Make sure you replace all and don’t have any unnecessary slashes trailing urls.

UPDATE! While a simple search/replace will work most of the time, it’s more and more common nowadays to run into “serialized data” inside the database that can present some serious problems. Using a “serialize-data sensitive” search and replace tool, such as the one provided by InterconnectIT is a solution that everyone running anything more than the most basic migration should consider. In fact, it’s probably best to just use that for this step to begin with as it’s free and easy to use. Thanks to reader Rarst for the vital correction and the suggestion of the InterconnectIT’s plugin!

I’d recommend from here you save as a new file so that in case you made a mistake you can start over again without having to repeat steps.


Step 4 Restoring the Database

Often you need to create a new database when moving to a new host. Additionally you will probably need to add a database user and password to it.

If you have moved the URL or not next you need to restore the database at the new location (or same if all you did was change the URL). To do so you need to login to the new location’s PHPMyAdmin.

Once in the new PHPMyAdmin you will select the new database by clicking on its name on the left and then clicking import on the right. Make sure you do it in that order or you might get an error on the next step. Upload the .sql file you downloaded (and/or edited). You should see a confirmation that your database has been uploaded.


Step 5 Getting WordPress Back Online

The last step we need to do is go to your WordPress site’s new location and see if we are still having a Database Error. If we are you need to edit the “wp-config.php” file’s database settings to mirror the new settings to your MySQL database.

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'mysite_wp');

/** MySQL database username */
define('DB_USER', 'wordpressDB_user');

/** MySQL database password */
define('DB_PASSWORD', 'secretP@ssword');

/** MySQL hostname */
define('DB_HOST', 'localhost');
    Here is a reference as to what is needed:

  • DB_NAME is the name of the database you created for WordPress
  • DB_USER is the username that has permission to access the database
  • DB_PASSWORD is the password to the username
  • DB_HOST is the database hostname. Normally “localhost” unless you are on shared host that specify otherwise.

If you are having problems finding the correct information a quick call to your tech support of your host will typically have someone help you find the information or they will set it up for you (depending on your host).

Once you have made your changes you need to save or re-upload the changed file.


You’re Done!

That’s it, your done! By now, you should be able to successfully move your WordPress installation from one spot on net to another. This is perfect if you’re trying to move WordPress from one webhost to another, from one domain to another, or even just to change the location of the installation on your existing server.

If you enjoyed the video version (it’s one of the first on Wptuts+!), let us know in the comments!

Jonathan Yarbor is blazedd on Codecanyon
Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
  • http://www.Rarst.net Rarst

    Never run plain text search/replace on dump of WP database. Never. Never. Never. Never. Don’t ever do it.

    WordPress holds a lot of data in db serialized. By randomly replacing stuff you are ruining that serialized data when it contains URL (or whatever) being replaced.

    This is single most common cause of botched migrations.

    • http://jonyarbor.name Jonathan Yarbor
      Author

      I’ve never ran into a problem doing this to change a URL in the years I’ve worked on WordPress sites. As long as you ensure your URL doesn’t have a trailing slash on the replace you should be fine.

      • http://www.Rarst.net Rarst

        Feel free to play that roulette with your own work, but I sincerely beg you to not recommend this to others. Especially beginners who flock to tutorials.

        • http://jonyarbor.name Jonathan Yarbor
          Author

          Feel free to prove me wrong, but please do demonstrate how it might go wrong with my given instructions.

          • http://www.Rarst.net Rarst

            $data = array( ‘complex data’, ‘with http://oldurl.com in’,’ it somewhere’ );
            $serialized = maybe_serialize( $data ); // this is what we have in database
            $replace = str_replace(‘http://oldurl.com’, ‘http://somenewurl.com’, $serialized); // this is dump after your replace
            unserialize($replace);
            $unserialized = maybe_unserialize($replace); // guess what we have on new site? supressed “Error at offset 64 of 96 bytes” and boolean false instead of our data

          • Miriel

            You can lose settings, nggallery for example.

          • http://jonyarbor.name Jonathan Yarbor
            Author

            @miriel You actually won’t lose settings by using search and replace. This will update all settings in the URL. If anything you need to search and replace your path as well to ensure the files are linked as well.

            @rarst I’m not sure where or when this would be valid? A url with a path, subdomain, or hostname won’t interfere with any serialized data as it isn’t compressed when stored. If the URLs were compressed it would replace them and wouldn’t “break” the migration, but not completely change all of the URLs.

            Please see my example of a set of serialized URLs: http://pastebin.com/97awGmGw

          • http://www.Rarst.net Rarst

            Serialization relies on length of data being recorded (that is what that additional markup is). When you replace URL inside of serialized string by one of (most likely) different length you are changing the actual length of data and it no longer matche recorded length of data. Under those conditions serialized string is effectively broken and cannot be unserialized.

          • http://www.websocially.com David Carroll

            @Jonathan Yarbor

            Great job on the well delivered and clearly explained tutorial. However, I have to agree with Rarst on the issues he described with serialized strings.

            Extending your code example further, the issue would be realized if you modified the serialized string with a new domain name with one or more characters. When you attempt to unserialize that string, you’ll get an error indicating the number of characters do not match the serialized data.

            For Example, take the original serialized string from you code sample:

            a:8:{i:0;s:15:”http://site.com”;i:1;s:20:”http://site.com/blog”;i:2;s:20:”http://blog.site.com”;i:3;s:20:”http://site.com:8888″;i:4;s:25:”http://blog.site.com/home”;i:5;s:16:”http://127.0.0.1″;i:6;s:21:”http://127.0.0.1/blog”;i:7;s:21:”http://127.0.0.1:8888″;}

            Change all instances of site.com to newsite.com

            a:8:{i:0;s:15:”http://newsite.com”;i:1;s:20:”http://newsite.com/blog”;i:2;s:20:”http://blog.newsite.com”;i:3;s:20:”http://newsite.com:8888″;i:4;s:25:”http://blog.newsite.com/home”;i:5;s:16:”http://127.0.0.1″;i:6;s:21:”http://127.0.0.1/blog”;i:7;s:21:”http://127.0.0.1:8888″;}

            When attempting to unserialize the new string, you’ll get the error message:

            -> Error at offset 30 of 275 bytes

            The working version of this would be:

            a:8:{i:0;s:18:”http://newsite.com”;i:1;s:23:”http://newsite.com/blog”;i:2;s:23:”http://blog.newsite.com”;i:3;s:23:”http://newsite.com:8888″;i:4;s:28:”http://blog.newsite.com/home”;i:5;s:16:”http://127.0.0.1″;i:6;s:21:”http://127.0.0.1/blog”;i:7;s:21:”http://127.0.0.1:8888″;}

            Notice the character count increased by 3 where site.com was replaced by newsite.com.

            You can test this using the online unserialize utility:

            -> http://www.functions-online.com/unserialize.html

            If serialized strings are not updated with the correct character count, the saved settings cannot be loaded on the migrated site. In this case, you would need to reapply theme settings, plugin settings, widgets, menus, etc.

            You mentioned not having any problems in the past. Can you recall having to reapply such settings?

    • http://envexlabs.com Matt Vickers

      I’ve moved close to a hundred sites with this method over the years and I’ve NEVER run into a problem with messing up serialized data, or any data for the matter.

      It’s kind of asinine to say to never never never do it.

      Even in the chance you do mess something up, you have a perfectly good database to revert back to.

      • Sam

        I’ll second the “This way won’t cause problems” conversation. I’ve migrated at least a dozen WP sites in the past year, and direct changes to the database have caused only very small problems.

        Once I’ve imported the backed up database to it’s new home, I tend to run UPDATE queries on the settings table as well as the posts table to switch out the old URL for the new one. The only problem I’ve ever encountered was of course, human error where I replace the old URL with an incorrect one. That, though is just another easy UPDATE query to fix.

        I do find that the WP-DB plugin helps with obtaining a backup of the WP database, directly from the Dashboard. It’s especially helpful when a client doesn’t have PHPMyAdmin – and frankly the install procedure for that piece of software is a pain anyway.

    • cdr

      can you offer an alternative? that would be much more helpful than just saying the tutorial is wrong.

      • Brandon Jones

        I’m actually curious to see an alternative as well Rarst. I’ve also never run into a problem, although I admittedly don’t do a ton of migrations (I usually let a server admin help out with especially big moves). I understand why you might want to say, “don’t do it”, but what’s the proper way to do this if a search/replace will botch serialized data?

        • http://www.Rarst.net Rarst

          Alternatives would be:

          – serialize-aware search/replace tool (InterconnectIT offers one)
          – migration plugin (BackupBuddy and such)

          If talking development-production migration it can be very convenient to set up test site with real domain via hosts file and not have to change URL at all.

          • Brandon Jones

            Thanks for the followup Rarst – I’ll have to say that after checking out BackupBuddy, it looks fantastic. I still personally like knowing how to do it myself though, so it’s great to see that there’s such a thing as serialize-aware search/replace. I’ll check it out and add it to the tutorial if works inside this workflow. Thanks again for the tips!

          • TXDeveloper

            The only downside to Backup Buddy is the price. If you are an individual user then it’s quite affordable ($50). But if you have more than two WP installations you manage, or are a developer, it’s twice or three times more expensive. These are YEARLY prices also, not just a one time shot.

          • Vadims

            Thank you Jonathan for your article.
            Thumbs up for you Rarst. I just tried BackupBuddy and I can confirm that it is a very professional plugin. Migration of two wordpress installations, 3.1 & 3.2, was a real fun for the first time!

            Keep up the good work guys

        • Creatan

          I’ve successfully done migrations with dumping the database to the new server and then updating wordpress options in the database.

          What you need to change are ‘siteurl’ and ‘home’ values. Where for some reason siteurl is the location of your wordpress install (http://www.example.com/blog, if you have wp in subfolder called blog) and home is the domain.

          With the following commands you can change the required options.

          UPDATE options SET option_value = newlocation WHERE option_name = “siteurl”;
          UPDATE options SET option_value = newdomain WHERE option_name = “home”:

        • http://hakre.wordpress.com/ hakre

          As far as changing searialized data is to be parsed, there’s a PHP library available that does it statically: https://github.com/ktomk/Serialized – I normally use it for such tasks. Works like a charm. You can even convert object instances in case you feel in a need for it.

          The other trick is to have the new domain-name the same length than the old one. But that’s something you a) need to know in advance and b) is not always applicable.

        • http://www.websocially.com David Carroll

          @Rarst – Having done many migrations between development to production and other domain name changes on WordPress Multisites the past year, I’ve experienced issues where replacing OldDomain.com with MyNewDomain.com will cause issues with serialized strings.

          The problems I’ve encountered involve theme settings and plugins settings loosing previously saved values. WIdget content and settings are also not loaded as previously expected. I believe even the menu / navigation settings are affected by this.

          Although serialized data cannot with this approach, the migration itself should work. However, it’s been my experience that the above mentioned items would need to be setup once again.

          For those who have not experience any issues after dozens of migrations, I wonder if they had similar experiences with having to reapply those settings and widgets I mentioned.

    • Ben R.

      I’ve had this problem before.

  • she-codes

    This is the way I do it every time and it works like a charm.

    Also worth mentioning is that sometimes WordPress or some plugins store the path in two different ways:

    1) The first one is the absolute URL of the site – http://www.yoursite.com/wp-content
    This one is easy to find and replace, as you will know the URL of the new site.

    2) The second one is starting with the relative URL of your ftp root folder:
    - /www/yoursite.com/www/root/wp-content…
    or something like
    - /www/home/wp-content…

    The second one may be more tricky and requires more attention (plus what you will replace it with depends on your new hosting…)

    • http://jonyarbor.name Jonathan Yarbor
      Author

      Very true with a lot of gallery plugins you may need to do a path replacement. Often saving the data in the admin panel in a few places will take care of it. The more complex the WordPress site the more work involved.

  • http://wpconsult.net Paul

    or just use a plugin like backupbuddy or duplicator if your time is worth money

    • http://wp-garage-com Scott J

      WPTwin is another easy php script for backing up and reinstalling or cloning a WordPress installation.

  • http://arvag.net Gavrisimo

    http://www.arvag.net/how-to-move-wordpress-site-from-localhost-to-web-server/

    So its 3 sql queries + change values in wp-config.php and you are done…

    • Gavin

      Might want to check that link, doesnt do much right now?

    • Brandon Jones

      Ditto – link appears to be broken, but I’m curious to see what it said ;)

  • John

    First, thank you for starting WP Tuts+. I am a beginner and will be launching my first site (for business) soon. I’m glad I found this site when you first launched it and the beginner topics are great.

    My Question: I will be building my site locally on my computer then moving it to a production location. Will I still have to do the find and replace step on the exported database file in my case? This is my only concern, I think I have a solid grasp on everything else. Any other tips you suggest for moving a site from a local install to a production location?

    Also, I appreciate the text tutorial in addition to the video. I’ve ran into many posts where the tutorial is video only (youtube) and that can be blocked for me many times depending where I am online (I was able to view this video btw). As for the video itself, you moved quiet fast between windows which made it a bit tough to follow you. The maximized windows didn’t help this much either. I’m not sure if you were using keyboard shortcuts. Might I humbly suggest slower switching of windows using your mouse for future tutorials so us viewers/noobs can follow better. Perhaps deliberately minimizing then maximizing the next window. Just my 2 cents.

    • http://envexlabs.com Matt Vickers

      Yes, you’ll still have to change the urls.

      If you’re developing local, there is a good chance the url for your site will be http://localhost:8888 (or something along those lines).

    • http://jonyarbor.name Jonathan Yarbor
      Author

      Glad to help, I’m sorry if I went too fast. Make sure you have the HD version running so you can see details when I don’t zoom far enough in. I’ll keep that i mind for the next tutorial I do.

  • http://prop-14.com Randy

    I have never had a problem migrating using find/replace in notepad++. That includes sites that usually have Calendar, Contact Form 7 and a few other plugins every time.

    @John – Yes you will need to change all the url references. Since all WP url’s need to be complete, your local install will be localhost/demosite, etc. rather than the real domain name.

  • Scylla

    Hi, I have followed this tutorial to the T. I have moved my site to a new server, and I keep getting this error:
    “Error establishing a database connection” while browsing the site, when I refresh everything is fine. Any ideas??

    • http://jonyarbor.name Jonathan Yarbor
      Author

      This means the database information in your wp-config.php file doesn’t match that of your actual Database settings. The Database settings I provided in this tutorial was for example only. Under no circumstances should you use any usernames or passwords in a tutorial for a real website your working on. If you can’t figure it out contact me from my codecanyon account and I’ll help you out (codecanyon link at the bottom of the tutorial.).

  • Chris Gomez

    Great Job on the tutorial! I will be using this method next week.

  • https://www.odesk.com/users/~~760e816765325461 Bruno

    I’ve completed dozens of both simple and advanced transfers (advanced meaning hundreds od MBs and lots of data), so I’d also suggest this:

    Put this into wp-config:

    define(‘WP_SITEURL’, ‘http://www.example.com’);
    define(‘WP_HOME’, ‘http://www.example.com’);

    Furthermore, add Search And Replace plugin and update links that don’t work / point to old site (e.g. image links within the posts).

    Finally, if page/post links are not working on a new host, you might want to update permalink settings within Dashboard, which is something that should fix that problem.

  • Alistair

    This tutorial was a poor example. Why not just move the index.php and re-configure in wp-admin here.

    Poor poor example

    • https://www.odesk.com/users/~~760e816765325461 Bruno

      Alistar, how many WP transfers have you completed? I’d be happy to see your tutorial. Please post a link.

      • Alistair

        i’ve done too many to remember. Wether it’s using an export file, a dump of an entire .sql file doesn’t make the tutorial poor.

        It’s the example that was given, in that environment you could add to new constant to wp-config, site_url and home_url then WordPress would do the rest for you.

        Is this WP Tuts or PHPMyAdmin / MySQL tuts.

        Just came accross very non-pro, and very non Net Tuts.

        • https://www.odesk.com/users/PSD-WordPress-CSS-HTML-Writing-Blogging_~~760e816765325461 Bruno

          In my personal opinion, a quality of an example is measured by the fact whether the steps described within can be used on all types of installations.

          It is not an example what is important here, though, but the procedure instead. Although I agree that there are some things which are missing, such as the one I’ve mentioned previously.

        • http://envexlabs.com Matt Vickers

          I’m always amazed that 95% of the people who talk shit about a tutorial, never include a link in their name to a portfolio site, or anything they’ve done.

          Coincidence?

          • Alistair

            What you just said Matt is exactly why I wont do that any more, if you really want to you can find it on other places in the web.

            But I don’t want a perfectly good business to be open to opinionated bias. You’ll appreciate I have bills to pay and food needing to be bought.

            Thanks for your genius insight though, very confrontational of you. After all I am the one here being constructive after all like a real douchebag.

  • http://www.wizkidmedia.com Eric “WizKid” Odom

    1st off, this is the first quality tutorial I have seen that is geared to beginners in WP development. I know my way around the WP dashboard and themeing, but WP development has me stumped. Thanks for the great tutorial! Going to use it right now and see how it turns out.

    The site I’m migrating is a pretty big site, at least in my opinion, so I’m hoping it goes smoothly.

  • http://ph34r.net Jo

    Great job on this tut. I just used it tonight and finished moving a large website of over 120 pages in less than an hour. Thanks!!

  • Marlon

    Thanks for the great tutorial!

  • Ajmal

    Hi Jonathan,

    First off, thanks for this great tutorial!

    I wonder if there is a tool in WordPress that helps making this task easier and faster?

    Like in Joomla world, there is this tool called “Akeeba Backup” and what it does basically it backup the whole things (files + database) and turn it into one-click installer.

    So with this installer, you can install it anywhere across servers and hosts etc. Never heard of anything like this in WordPress so far, and i believe this would definitely benefit a lot of people.

    Hopefully WordPress already has anything like it.

    • Brandon Jones

      There’s BackupBuddy, which has been mentioned a few times here already – but there’s really nothing that will substitute doing a lot of this manually as the article suggests. I just did a massive 30 site Multisite migration across domains last night and despite all of the automation in the world, I still ended up needing to do a lot of search/replace, custom .htaccess writing, and a host of other tricks to get it right.

  • http://www.mrdocrock.com Docgration

    Please someone answer me this question before i majorly screw up my migration.

    I’m moving from a cpanel setup to a custom made admin panel server

    The path of the cpanel one is /home/docrock/public_html/

    the path of the new server will be /home/username/www/html/mydomain.com/wp/

    Do i need to adjust the databases at all for this

    Big Mahalo (thanks)

    doc

  • Kim Smith

    Great tutorial. I have a question regarding WordPress migration that I’m hoping someone may be able to answer. I’ve moved more than a dozen WordPress sites and almost every time, I lose all widget information. It’s not that big a deal since I can set those back up and repopulate them, but it’s time consuming and I figure I must be doing something wrong. I migrate sites much the same way as in the video tutorial, I export the db from PhpMyAdmin, change the site url and import it into the new db. I figured I am not checking (or unchecking) something in PhpMyAdmin but am not sure. Anyone else have this issue and know how to resolve it?

  • http://aoberoi.me Ankur Oberoi

    There is a GSoC project that is just wrapping up called WordPress Move. I haven’t tried it out yet but its supposed to be a pretty automated solution. Check it out: http://gsoc2011.wordpress.com/wordpress-move/

  • Pingback: WordPress Serialized PHP Search Replace Tool | Interconnect IT - WordPress Consultants, Web Development and Web Design

  • http://www.devtuts.com.br/wp Rafael Angeline

    Thanks dude!

    This really works fine ;D

  • http://multikonline.ru Stoodakaf

    Это мне напомнило одну фразу из известного фильма:

  • Pingback: Перенос WordPress-сайта с сохранением настроек и URL’ов на новый сервер | Wordpresso

  • mike

    > If you are moving files on the same host or server you don’t need to make a local backup as you can move it on the host/server in a few seconds.

    You can do this even if servers are different. SSH:

    scp -r /folder/from/* username@serverwhere.com:/folder/where/

  • http://www.codehunterbd.wordpress.com Khairul Alam

    Thanks for this great tutorial.It’s helpful not only beginner but also all web developers.

  • casey

    This tutorial was straight forward and I liked the writen and videocast operation explanation. Where would you recommend I go for support on an error in my migration. The index.php is loading just right, but the links are dead to other pages. Thoughts where to go?

    Casey

  • ET

    A minor yet significant note for MAC USERS: As you copy the files from the OLD server, make sure to rename the .htaccess file before transferring to your desktop otherwise it doesn’t show up. Here’s the simple steps to take:

    1. right click on the .htaccess in your ftp on the OLD server
    2. rename it from .htaccess to X.htaccess
    3. then drag all files to your desktop
    4. upload all files to new server including X.htaccess
    5. once on the NEW server, right click and rename X.htaccess to .htaccess (deleting X)

    Thanks Jonathan for the great tutorials.

  • Rurr

    Excellent, clear, simple, cool !

  • http://my.zigzaghosting.co.uk/aff.php?aff=003 James

    Thanks bookmarked for future moves :)

  • http://www.belleham.com RedFox

    I’m in the process of a multisite URL change and it looks like all of the above steps/steps in the video are the same EXCEPT – what changes need to be made to the htaccess file? When setting up a MS, WP kicks out a customized code to add to this file. Does anyone know how to regenerate that so that the entire MS migrates? This is my first migration in general, let alone a MS, so I’m just trying to be clear on the steps.

    Thanks for such an amazing video/tutorial!

  • Pingback: Tutorial Roundup: 25 Very Useful Tutorials and Articles for Web Developers | PHP Developer Resource

  • Pingback: 25 Awesome Tutorials and Articles for Web Developers | thePIXLr

  • http://www.group3solutions.com Brad Kelley

    I had never run into the serialized data search/replace issue until today. Been migrated sites from development to production for years and the basic search/replace of the SQL output has been part of our documented protocol all along. So I was stumped today when I had issues moving from one environment to another, and found this thread and the discussion of serialized data. Then it occurred to me what was happening. For WordPress sites our development domains have always been named dev.domain.com and the production domains named http://www.domain.com. The same number of characters in the domain name. So the search/replace methodology worked fine since the serialized byte count remained the same. Well today involved a dev subdomain other than dev. When the search/replace occurred the serialized data’s byte count changed and voila, problems.

    I learn something new every day. =)

  • Pingback: favourites Everything « Donals "How to"

  • http://nathangiesbrecht.info Nathan Giesbrecht

    Thanks, this was quite helpful. I’ll be moving a whole bunch of WordPress installs next week, so this guide will come in quite handy!

  • http://www.helpspa.com David

    What about the fact that the codex wants you to change the urls in wp-posts as well?

    Assuming you want to migrate to a new domain name or path, the codex wants to you change in the database items in the wp-options table, but also in the wp-posts table.

    Many of the tutorials I’ve seen talk about wp-options, but very few about wp-posts. What table are other people changing in a new URL migration? wp-options AND wp-posts, or just wp-options?

    Thanks

    • http://wp.envato.com/ Japh Thomson
      Staff

      Hey David, that’s actually covered by using the tool from InterconnectIT that we mention in the post above. It handles replacing through the wp-posts table.

    • http://www.group3solutions.com Brad Kelley

      David,

      Step 2 of the tutorial above outlines exporting the entire database, not just one table. In Step 3 the author searches/replaces all occurrences of the old domain with the new. This shotgun approach obviates the need to know which table to modify, as he is simply modifying any occurrences of the old domain wherever they appear.

      Brad =)

  • Shaun

    Think a massive hole in this otherwise excellent tutorial is during the import process of the database back into phpmyadmin. You may receive errors if the database you are transferring does not start with the username of the cpanel account you may be transferring it to.

    Open the .sql file and check the create database line to see what it is trying to do.

    A simple solution is to comment the database creation line out in the .sql file, then go back into the destination cpanel, create a database – the username prefix will be automatically inserted – and then import your modified .sql file into this database in phpmyadmin. Note that simply changing the create database line in the .sql file to the appropriate cpanel username prefix will not work as cpanel must create the table itself.

  • http://stevetadlock.com Steve Tadlock

    I want to move several sites from my old host, that uses php4, to a new one that has the latest php5 installed… Will the old database work on the new platform?

  • Pingback: WP Migration | Catherine's Blog

  • Pingback: When I sign in, can Wifi “host” servers monitor my computer and sites I surf? | computer laptop reviews, desktop computers, notebook reviews

  • http://www.alchmist.com Firoz

    hi, I also came across the same situation to migrate my blog http://www.alchmist.com from a sub domain to the new root domain, where I used a much simpler method which is explained in blog, http://www.alchmist.com/2012/09/27/migrate-wordpress-blog-new-site-domain-name/

  • Dan J

    Have you ever tried or seen this? halty.net/website_mover_0.2.zip
    claims to be compatible with wordpress but I am reluctant to try this on my live blog (my goal is to switch from godaddy to dreamhost and I have a new domain at dreamhost)

    Dan

  • Pingback: WordPress (and others) Search and Replace Tool – Công cụ hữu ích

  • HabsFan

    I tried to move a wordpress site from one computer to another using this methoed. Site dashboard comes up fine but when I click on visit site, it defaults back to the old site. The site is in development right now so we moved from one computer to another. The site is using Webmatrix. So new site is localhost:newport# but the visit site takes me to localhost:oldport#.

    Any suggestions? I did find and replace and ran the InterconnectIT tool. I think Webmatrix may be the issue but we don’t want to lose the work we have done on the site.

    • http://wp.tutsplus.com/ Japh

      Hi @disqus_iOUVHnO65s:disqus, while the fundamentals of this process should work with any system, this article is really talking about the process with WordPress. Not having used Web Matrix myself, I can’t really explain why it would or wouldn’t work with that system, sorry.

  • Chris

    Just migrated a site using your process (thank you for making a detailed video), the main home page seems to be migrated fine but all other pages cause a 404 Error, “The requested URL /abou/ was not found on this server.” I have no idea what I did wrong, any help would be greatly appreciated!

  • Pingback: Making the Move to Dreamhost: Migrating a Wordpress-MU install across hosts and domains | Jennifer A. Scroggins

  • Pingback: Making the Move to Dreamhost: Migrating a Wordpress-MU install across hosts and domains | Dev Install

  • Daniel Dalal

    Im having an issue that happens to me always.
    On every project i start i work locally and once im done i export my database and search replace all localhost url’s to the new url.
    then in cpanel i create a new database user name and password and modify wp-config.

    the website works fine all pages working just one thing wont work and i cant find a solution:
    all my Theme Options wont show
    my theme options settings and s widgets wont show up and i have to redo this process from the beginning so each time i will have to redo all the settings.

    i have read a lot about it:
    http://codex.wordpress.org/Moving_WordPress

    and even used this tool you posted:
    http://interconnectit.com/products/search-and-replace-for-wordpress-databases/

    but still don’t know what am i doing wrong.
    same thing happens when i try to install a site on local host from a backup.
    is there a tutorial on how to do this the right way or can someone please please help.
    Thanks in advance

  • mike

    Im having an problem that happens to me always.

    On every project i start i work locally and once im done i export my database and search replace all localhost url’s to the new url.

    then in cpanel i create a new database user name and password and modify wp-config.

    the website works fine all pages working just one thing wont work and i cant find a solution:

    all my Theme Options wont show

    my theme options settings and s widgets wont show up and i have to redo this process from the beginning so each time i will have to redo all the settings.

    i have read a lot about it:

    http://codex.wordpress.org/Moving_WordPress

    and even used this tool you posted:

    http://interconnectit.com/products/search-and-replace-for-wordpress-databases/

    but still don’t know what am i doing wrong.

    same thing happens when i try to install a site on local host from a backup.

    is there a tutorial on how to do this the right way or can someone please please help.

    Thanks in advance

  • Pingback: Best Wordpress Tutorials Which Will Make Your Life Easy - Webkia