[Advanced users] Upgrading WordPress to a new version can be a pain in the behind. If you’re like me, you might fear affecting the live site before ensuring that the latest WP will work with all your active WP plugins, not to mention your selected theme. If you are not an administrator but have some advanced WP skills, here’s a “safe” approach to upgrading WordPress. (Warning: I have not yet used this approach, but it’s technically sound. Only recommende for advanced advanced WP users.)
- Create a subdomain on your domain. E.g,. if your site is at www.mydomain.com, then you might create wp232.mydomain.com (if you’re installing WP 2.32). If you don’t know how to create subdomains, ask a friend or call your hosting support.
- Install the latest WordPress on the subdomain.
- Export your current (main) WordPress content. Use the backup/ export from your WordPress admin panel. If it’s a really old version of WP, this might be a problem, as there might not be an export/ backup feature. Look around for “backup” plugin that’s compatible with your existing version of WP.
- Backup any files from your server, such as image uploads, theme files that have been tweaked, etc. Typically you would use FTP software for this, either on the desktop or through the browser, from your hosting admin panel.
- Turn privacy on, in the test (subdomain) installation, so that search engines don’t index your test site.
- Take the export/ backup content from step #3 and import it into the subdomain installation. (Make sure that you have the same Permalink settings on the test installation as on the live site.)
- Install the same plugins and theme onto the test test as on your live site. Test all the content, plugins, etc.
- When you’re satisfied that your content is working in the test site, re-export the content from there. Doing this ensures that the backup content structure matches the schema of the latest version of WP. This is a crucial step.
- Create an index.html for the live site and write “This site is down for maintenance; will return shortly.” FTP this file to your server root directory.
- Wipe out the live site’s WP files and database, except for the temporary index.html. (Just be 100% sure first that you have backup copies of everything, including the old WP version installation files – which you can get from wordpress.org, if necessary.)
- Re-install WP (latest version) to your live site (main domain).
- Install the backed up files from step #4 above.
- Import the content backup from step #8 above.
- Reinstall the theme you want, and the necessary plugins.
- Activate the theme and plugins.
- Use the same Permalinks options as you originally had.
- Verify that everything on the new main installation is working properly.
- Wait a couple of days – or however long you’re comfortable with – and delete the test installation and subdomain.
Why Do It This Way?
The steps above might seem sort of circuitous, but you’re trying to avoid two specific situations:
- Upgrading to a new WP version on the live site then running into problems. If your site is monetized, you obviously want to minimize run time.
- Site being down for too long, in case there is a problem.
The subdomain test installation lets you first ensure that everything is working fine in the latest WP. (Note that some budget Internet hosts allow a subdomain to access the exact same databases as the main domain. But you should not use this feature because you don’t want to accidentally make changes to the live database.)
This method is, of course, only if you need a “safe” way to upgrade. Very experienced WP users or people with admin experience can probably disregard this. I’m a more cautious sort, despite my admin experience.
A final caution: beware that WP 2.2x (or thereabouts) had some important database changes. So if you’re upgrading from a very old version of WP, you might have technical problems. Using a subdomain to play around lets you ensure that the latest WP version will work for you, without harming your live site.