Moving wordpress


If changing database or moving hosting or domain:

  1. Make a DB backup, using a backup tool or phpmyadmin – we need the sql file in a format we can edit.  (Note you might want to take the opportunity to clean up the options table first, and get rid of any orphaned options – there are plugins to help with this. )
    1. Find the siteurl options – fix the url if necessary (eg if moving domains) – this will help avoid the “white screen” problem.
    2. If you want to change the table prefix, now is the time.  Do a search and replace on `wp_ and “wp_ and ‘wp_. Yes you could do wp_, but hey this is safer what if there was a wp_ in the middleof a word?
    3. You may to just check if anywhere there are any domain or location specific urls specified with absolute urls. Eg: search and replace “http://yourolddomain/youroldwplocation/” with “./”

Moving hosts

Check whether the localhost specification needs to change in wp-config.php file.  Eg: going to icdsoft, you may need localhost:/tmp/mysql5.sock.

Moving wordpress code location

  1. Move the WordPress Code
    1. Move your entire word press directory to where you want to keep it – eg: down a level: eg to …/wp
    2. Optionally move the wp-content sideways or somewhere else
    3. Create a copy of the index.php file and put it into the original directory
      1. Edit index.php and insert the new subdirectory into the file path.
        Ie: change
      2. to

      3. Save and Exit.
      4. Test –  Browse to the blog url.  You should see your website but lacking style!
    4. Define where Content should live,
      1. leave it there or move it sideways.. whatever…
      2. Now go to the new subdirectory wp and edit the wp-config.php.  Add or change the following lines at the end of the file
        • define( ‘WP_CONTENT_URL’, ‘http://yourdomain/yoursubdirifany/wp/wp-content’);
        • define( ‘WP_CONTENT_DIR’, $_SERVER[‘DOCUMENT_ROOT’] . ‘/yoursubdirifany/wp/wp-content’ );
        • define(‘WP_SITEURL’, ‘http://yourdomain/yoursubdirifany/wp’);
      1. Check you also have at the end of the file
        • define(‘ABSPATH’, dirname(__FILE__).’/’);
        • require_once(ABSPATH.’wp-settings.php’);
      2. Save and Exit.  Test – refresh the browser window and now there should be style!

Move the Uploads folder

  1. You must check out what the upload path spec is doing. In 2.7 the default will put uploads under your main wordpress folder in a wp-content folder.   This does not make sense.   If you have problems – use the full url path. It may be a good idea to update this using multiple websites from one instances. Logon as admin, got to settings > miscellaneous and change before uploading

Test, Test

  • Primarily you will be testing your plugins that they are using these wordpress constants
  • Browse your website, check all the areas where plugins should be doing something
  • Test all the areas that do some kind of upload (shops, members)
  • do all the actions, comments, subscribe etc
  • Login as admin, browse around, check all is as it should be!
  • If you find a plugin that does not work, first check you have the latest version, then tell the author by commenting at wordpress or on the plugin page .  It would be nice if you would log it here too.