There may be a time when you need to re-install WordPress on your server due to some sort of compatibility error, or server change…you name it. It’s a good idea to practice this process if you’re running multiple blogs and/or managing blogs for other people. If you have one blog, and you don’t use the self-hosted version of WordPress, then you might just want to stick to using WordPress.com to host your blog. There are advantages and disadvantages to using the hosted vs. self-hosted versions. For this tutorial, you’ll need to be one of the self-hosted adventuresome bloggers.
When WordPress releases new versions, sometimes things go wrong with older plugins. Prior to upgrading, just to be safe, I backup everything. How you backup is up to you, but the basics of backing up WordPress involve saving a copy of your wp-config.php file in the root of your blog, and the wp-content folder (and all sub-folders) which contains your plug-ins, themes, uploads, and any other special files that are specific to your blog. In addition to backing up your WordPress files, you also need to backup the database that WordPress is reading and writing to and from.
If you don’t backup your data, you are at risk of screwing everything up. I’ve done this many times, unfortunately, but will never have this problem again.
Basic Steps to Reinstallation
Stage 1: Backup and Deactivate
- Backup your WordPress files, themes, plugins…basically everything in the wp-content folder AND the wp-config.php file in the blog root.
- Backup your Data. I use SQLyog to export my data in a long SQL statement to a text file on my desktop.
- If you don’t have the original version of your blog stored on your computer, download your entire blog root and sub-folders and keep them safe just in case you need to revert to the old version.
- Deactivate all of your plug-ins just to be safe.
Stage 2: Delete The old Crap
- Delete the entire blog root, except for wp-config.php (yes, you backed it up, but why add a step later?)
- Delete the entire wp-admin folder and the entire wp-includes folder.
- Rename wp-content to wp-content_old (for extra redundancy)
You now have a dead blog, but you’ve preserved your important configuration and data.
Stage 3: Upload WordPress
You’ve already “installed” wordpress (which involves creating a new database) so all you’re doing at this point is uploading the newest files in place of where your old blog was. Upload everything you unpack from either version 2.6RC1 or the latest version to your blog root. Overwrite everything.
Stage 4: Restore Your Theme and Plugins
- From the folder you renamed to wp-content_old, using your favorite FTP client if you’re remote, or windows exploder (explorer) if you’re on the server itself, drag all of the folders under wp-content_old to the new wp-content folder that you just uploaded to your blog’s root.
- Your wp-config.php file should have remained where it was in the blog root through this entire process.
Stage 5: Run the Upgrade Script
- This is easy and always will be. Point your browser to www.yourblog.com/wp-admin/upgrade.php and follow the instructions. This is why you backed up your data. If this process fails, you have a backup.
That’s it. You should now have a completely backed up prior version, a completely backed up data set as of the date of your upgrade, and a brand new installation, ensuring all new files are uploaded and no overwrite errors occurred. It’s always possible for there to be a problem when you upload a new version over an old version which is why I always do a fresh upload of the entire structure.