Steps:
If changing database or moving hosting or domain:
- 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. )
- Find the siteurl options – fix the url if necessary (eg if moving domains) – this will help avoid the “white screen” problem.
- 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?
- 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
- Move the WordPress Code
- Move your entire word press directory to where you want to keep it – eg: down a level: eg to …/wp
- Optionally move the wp-content sideways or somewhere else
- Create a copy of the index.php file and put it into the original directory
- Edit index.php and insert the new subdirectory into the file path.
Ie: change
require(‘./wp-blog-header.php’); - Save and Exit.
- Test – Browse to the blog url. You should see your website but lacking style!
to
require(‘./wp/wp-blog-header.php’); - Edit index.php and insert the new subdirectory into the file path.
- Define where Content should live,
- leave it there or move it sideways.. whatever…
- 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’);
- Check you also have at the end of the file
- define(‘ABSPATH’, dirname(__FILE__).’/’);
- require_once(ABSPATH.’wp-settings.php’);
- Save and Exit. Test – refresh the browser window and now there should be style!
Move the Uploads folder
- 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.