WordPress

WordPress Hacks: Upgrading Versions

[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.)

  1. 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.
  2. Install the latest WordPress on the subdomain.
  3. 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.
  4. 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.
  5. Turn privacy on, in the test (subdomain) installation, so that search engines don’t index your test site.
  6. 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.)
  7. Install the same plugins and theme onto the test test as on your live site. Test all the content, plugins, etc.
  8. 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.
  9. 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.
  10. 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.)
  11. Re-install WP (latest version) to your live site (main domain).
  12. Install the backed up files from step #4 above.
  13. Import the content backup from step #8 above.
  14. Reinstall the theme you want, and the necessary plugins.
  15. Activate the theme and plugins.
  16. Use the same Permalinks options as you originally had.
  17. Verify that everything on the new main installation is working properly.
  18. 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:

  1. 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.
  2. 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.

Author: Raj Dash

7 thoughts on “WordPress Hacks: Upgrading Versions

  1. Jon: no, i didn’t think you were criticizing I know that, ideally, I’d love to own my own webserver and have full blown admin access, not to mention the time in the day to actually do admin work. Most hosts just really do not offer packages geared at anything more than hobby blogging. It’s a constant problem if you plan to be a blog publisher. So if you find some host you like, stick with them

  2. Raj: I definitely agree on the most bloggers don’t know what an apache config file is. I wasn’t trying to criticize your post at all. Just pointing out that a quality web host can make life a lot easier for the “advanced” users out there. In fact with webmin, you don’t even need to know what the apache config file is or where it’s at as webmin gives you a GUI to control that piece of the puzzle along with administration for the mysql dbs and pretty much everything else…

    You do have a solid post though for those out there that do not have full access to their sites and don’t have the advanced tools available to them to make the process a lot easier.

    thanks

  3. Olivier: The point is to avoid problems on the live site. The process will work regardless of number of visitors. In fact, the idea is for sites that have a lot of visitors and can’t take chances. Of course, if you are a web publisher with a part-time administrator, this process isn’t necessary. You’d do what Jon B suggested.

    Jon B: Most bloggers will not know what an “apache config file” is, let alone know what to do with it. In fact, most won’t have hosts that allow them to change the config file. This post was intended for a very specific skillset, or for those who want to venture into this approach, or for those whose hosts don’t allow such access.

    But you are right: your host defines the ease (or not) with which WP upgrading can be done. I’ve been with 2-3 hosts and one is harder than the other to upgrade WP on. Which is why I posted this process.

  4. The much easier solution to this would be:

    1.) Find a web host that allows you to backup and restore mysql databases preferably through your admin panel
    2.) Set up subdomain website as directed above using a backup of the db and direct copy of the files (mirror copy)
    3.) Run the update on the newly created subdomain
    4.) If all is well either restore the updated db and site files back to the live site or change the apache config file to make the subdomain the new root site and vice versa.

    Bottom line is an update to WordPress is either as hard or as easy as your webhost allows. If you are worried about downtime due to site monetization you should be running no less than a virtual private server with full control anyway (In my honest opinion). VPS systems are very affordable these days from many reputable hosts. Team that up with a decent admin panel such as webmin and you have just made site upgrades and migrations a whole lot easier.

  5. While this might be fine if you do not have a lot of visitors, things changes when you start to gt more than 1000page views a day. This might cost you money.
    Note that I only have 10 visits per day so this works fine for me 🙂

Comments are closed.