This plugin hasn’t been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

ezMigrate

Description

Tutorial on how to use the ezMigrate plugin: Moving wordpress using the ezmigrate plugin

This plugin makes it easy to use and migrate your blog across different locations by detecting the current location and
replacing all absolute paths on the fly.
While there are ways to move your blog around by replacing the locations within the database manually or through scripts,
they are very error prone and not very easy to do.
Once enabled, this plugin doesn’t require you to do anything other than move your code and database to a new location
when you want to. You can even access your blog through multiple urls at the same time when you need to.

This plugin is useful when:

  • You want to make your blog available through different urls
  • You want to move your blog around
  • You’re staging the development of a blog with development, test and production environments which all have their own urls.
  • You’re using a Version Control System on a development server and developers have their own checkouts and urls to access a blog using a single database.

The ezMigrate plugin does the following things:

  • It determines the root url of the blog.
  • It replaces the options “siteurl”, “home”, “upload_path” and “fileupload_url” to the correct values, independent of their values stored inside the database.
  • When not already set in wp-config.php it sets the constants WP_CONTENT_URL, COOKIEPATH and SITECOOKIEPATH to the correct values.
  • When a post is saved into the database it replaces all root urls in href and src attributes with a placeholder. (This is also done for all posts when the plugin is activated).
  • When a post is retrieved from the database it replaces all placeholders with the current calculated root url. (This is also done for all posts when the plugin is deactivated).

This way you don’t need to do anything when you migrate your blog and you can even make your blog accessible through multiple urls. It made life for me and the other developers at triptic a lot easier when we need to develop blogs using wordpress.

What this plugin doesn’t do (but might do in the future):

  • Put a in the header of your template. You can easily do this yourself by placing <base href=”<?php echo ezMigrate_getFullUrl();?>/” /> right after the <head> tag in the header.php file of your theme.
  • Replace urls outside of the four mentioned options or outside of href and src attributes in posts.
  • Make changes that might be necessary in the .htaccess file.

Known plugins that won’t work on multiple locations without modification:

  • cforms II, http://www.deliciousdays.com/cforms-plugin
    won’t work because of absolute paths in abspath.php and js/cforms.js

Installation

  1. Upload ezMigrate directory to the /wp-content/plugins/ directory
  2. Place the following code into your wp-config.php:

    require_once ABSPATH.'wp-content/plugins/ezmigrate/includes/config_include.php';
    

    at the end of the file, right before:

    require_once(ABSPATH . 'wp-settings.php');
    
  3. Activate the plugin through the ‘Plugins’ menu in WordPress
  4. Optionally, adjust your themes by putting the following line of code in the file header.php right after the <head> tag:

    <base href="<?php echo ezMigrate_getFullUrl();?>/" />
    

    When you do this you can use static relative urls for links, images, css and javascript files, without the need for phpcode:

    <a href="page1">page1</a>
    
    <img src="wp-content/themes/myTheme/images/img.jpg">
    

    This is particularly useful when you want to put these urls in javascript files

Tutorial on how to use the ezMigrate plugin: Moving wordpress using the ezmigrate plugin

Contributors & Developers

“ezMigrate” is open source software. The following people have contributed to this plugin.

Contributors

Translate “ezMigrate” into your language.

Interested in development?

Browse the code or subscribe to the development log by RSS.

Changelog

0.12

  • Prevented the ezmigrate tag from being prepended twice when the content_save_pre is called twice, which, apparently, can happen.

0.11

  • Removed an incorrect reference which could cause problems in WordPress 3.1.3 and maybe other versions as well. (Fix provided by Patrick Fenner)

0.10

  • fixed some errors when short_open_tag php.ini directive is set to off
  • fixed a warning for php version 5.2.14

0.9

  • fixed a bug where an extra character was stripped from the base url

0.8

  • Fixed another bug where a symbolic link in the path to the wordpress installation wasn’t handled correctly

0.7

  • Fixed a bug where a symbolic link in the path to the wordpress installation wasn’t handled correctly

0.6

  • Fixed a bug where a symbolic link in the path to the wordpress installation gave an error (Thanks to input by Colin K. MacLeod)

0.5

  • Fixed a bug where written html inside the text of a post was wrongfully converted upon plugin activation

0.4

  • Fixed a bug where written html inside the text of a post was wrongfully converted upon post save

0.3

  • Fixed a bug where plugin failed on the root of a webserver

0.2

  • Removed duplicate code

0.1

  • Initial version