• Blog

    Latest from our Blog

  • Tools

    Our Favourite WP Tools

  • Hosting

    Recommended Web Hosts

  • Coupons

    Get great money off deals

  • Themes

    WordPress Theme Directory

  • Plugins

    WordPress Plugins Directory

  • Promote

    Your WordPress Product

While moving a WordPress site from one host to another, testing through a development domain, I quickly realized there are a lot of places where the URL was still from the old site. There are plenty of tools to backup your site, your database, and your posts. I wanted one to change the paths. Something super easy and quick. WordPress offers overrides for testing, but doesn’t apply throughout. I found WP Migrate DB. This works both for a live host and if you are developing using XAMPP or some other local situation. Essentially WP Migrate DB does a find/replace on your database and then exports as a SQL file.

So…let’s start at the very beginning (a very good place to start).

Install The Plugin

First you will need to download and install the plugin WP Migrate DB. It’s easy to find a backup tool but not for migration. You can do the plugin search directly from your backend to quickly install the plugin or use the plugin’s manual install instructions.


Install the plugin from the screen.

You can also install manually by following the steps below:

  1. Download wp-migrate-db.zip
  2. Unzip the archive
  3. Upload the wp-migrate-db folder to your wp-content/plugins directory
  4. Activate the plugin through the WordPress admin interface
  5. Access the WP Migrate DB menu option in Settings

Activate The Plugin

Activate the plugin :

Export Your Database

Go down to Tools > WP Migrate DB

From here you will see 4 fields. The current and new address and current and new file path. The first one is self explanatory. The second is the path from your server. If you aren’t sure what it is, then you can make a PHP info file. You create a PHP file with <?php phpinfo(); ?> in the source, save, and then load it up on your hosting directory and access it (site.com/phpinfo.php). Scroll down to SCRIPT_FILENAME and it will show you the path of your server.

Once you’ve put in the information for the new site, click “export database”. It will save a SQL file for you.

Import The Database

On the NEW site, go to your phpMyAdmin, access the database you have WordPress in (or will have it in since you will be importing), go to “Import” and then choose the SQL file you downloaded.


All done!
Remember this is for just the database. Make sure your permalinks rewrites through .htaccess are reset (you might need to wipe the .htaccess file, turn permalinks to default, and then back to your preferred setting) if your root is changing and f you have any CSS that calls to a full path on your old host – that will need to be manually updated.

Download WP Migrate DB »


Disclosure: This page may contain affiliate links for which we will receive compensation if a purchase is made via the link.

Author:

I've been working professionally as a graphic and web designer since 2003 for firms, in-house and as a freelancer. I'm currently a designer and web developer for Edge Webware in Miamisburg, Ohio. When I'm not designing, I'm also writing novels and audio dramas, doing voice-over work, and audio production.

Leave Yours +

7 Comments

  1. This also works when a plugin makes the export option in WordPress fail. Nice backup :)

  2. Thanks April, I’ve been on a journey to find the easiest way to migrate when changing hosts, and this seems the most straight forward method I’ve found so far.. very thorough :) 

  3. If you are going to import using PHP MyAdmin why not export using the same?

    • aibrean

      Exporting does not rewrite URLs (file paths). This is the best method if you are changing server location or root directory.

  4. Sachin Upasani

    Hi,

    I have successfully download “migrate.sql” file from
    wp-migrate-db plugin.

    Than I create new database for it

    Is I need to create new user and new host before the import
    migrate.sql file?

    And what is my next step

    Upload all files and folder 
    on mywebsite.com/wwwroot/wordpress?

    Than is I need to change config.php?

    Please help me.

    Thanks!

     

    From

    Sachin Upasani

  5. Hi,

    I just wrote a plugin that does the same job on the database, for free. But mine only handles URLs, not file paths.

    It’s available on the WordPress Plugin Directory : http://wordpress.org/plugins/umanit-update-urls/

  • Comments are Closed

Search

Our Sponsors