Moving a WordPress site from one URL to another


If you want to move a WordPress site to a completely new URL, refer to http://codex.wordpress.org/Moving_WordPress (there are also instructions here: http://codex.wordpress.org/Changing_The_Site_URL but the former site appears to be better) and perform the following:

  1. First, in the OLD site, do the following:
    1. Login to your site as wp-admin
    2. Go to the Administration > Settings > General panel.
    3. In the box for WordPress address (URI): change the address to the new location of your main WordPress core files (ie enter the NEW address in here)
    4. In the box for Blog address (URI): change the address to the new location, which should match the WordPress address (URI) (ie enter the NEW address in here)
    5. Click Save Settings.
  2. Now, copy the old site to the new site, using something like:
    1. cp -a <old-site> <new-site>
      1. PS, obviously have to have a shell into the server directory where the sites are located, or do it via FTP as appropriate
  3. Now, you should be able to use <new-site>
    1. Can optionally delete <old-site> or keep it as a backup

The other method outlined at the top of http://codex.wordpress.org/Changing_The_Site_URL does work as well, but it sets the Admin screen in WordPress such that one can not change the URLs internally (one must edit the wp-config.php file).
Edit the wp-config.php file which is in the root directory of the WordPress installation, by adding the following two lines (anywhere, but suggest towards the top of the file):

define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');
Website Pin Facebook Twitter Myspace Friendfeed Technorati del.icio.us Digg Google StumbleUpon Premium Responsive

Comments are closed.

%d bloggers like this: