Aug 072008
 

If you visited Deep Sand earlier this week, you might have gotten a message saying we were temporarily unavailable. I was performing an upgrade to a new version of the software. Normally, that’s not a huge task, but this time I wanted to get as clean a database and code base as possible. Over the years, a lot of additional tables for plugins and files and folders and options settings have been left behind. I wanted to get that cleaned out.

I pulled a current back up of the site (site files and database). Then I uploaded the new version and ran the upgrade routine. This meant that database would be updated to the current format (whatever changes that might mean).

I made sure that all the plugins we currently use here were up-to-date (the WordPress team has made that a lot easier). I then took a clean set of the latest WordPress files (2.6, but this technique could be used for any version I believe), and downloaded all the current plugin files and theme files we use here on Deep. I made sure I got rid of plugin files no longer in use. I also downloaded an additional backup of the database file from the upgraded version. 

Then I deleted all the files in the Deep directory, and even completely deleted the database we use for the site. I set it up again, and uploaded the clean version of I’d created of 2.6. I did an install, which creates the base set of tables that WordPress Requires. Then I used the SQL Administrative interface available in CPANEL from my host to run the SQL queries to add just the data for the tables created with the base install. If you don’t know anything about MySQL and SQL queries, that might sound intimidating, but the backup file created by WordPress’ backup plugin actually places an SQL query before each tables data to either dump the existing contents, or create the table from scratch…so you just locate the section of your backup file for that table (find works well for this), and select that part of the backup file pertaining to that particular table. (By the way, you can open the SQL backup file in Wordpad.)

That’s all a little tedious, but it restored my comments and articles. I did not reload the “Options” table data, as I considered that “dirty” with all the leftover options from other plugins and older versions of the software. So I did have to go through the Settings menus and reset all those options.

Once that was done, I started turning on plugins one at a time. I would then configure the plugin and check via the SQL Administration interface to see if the plugin created its own table. If it did, then I found that table data in the backup file, and as with the base tables, I imported that data into the SQL table for the plugin. I had gone through and done a printout of each “settings” page prior to wiping out the original files.

All of this took about three hours, but now I know I am on the latest version, and hopefully have finally left behind a lot of stragglers in the form of directories, tables and options that are no longer needed by our Deep installation. I hope this results in performance improvements, but we’re not a big site anyway, and WordPress is a pretty solid piece of programming, so there wasn’t much improvement required.

Sorry, the comment form is closed at this time.