Here is one way to do it that worked like a breeze for me. I upgraded from version 2.7 to 2.8.4. Here’s what I did:
There were three things I wanted to do with this upgrade. One, make sure I didn’t lose anything; two, be sure I had a backout/restore plan; and three, minimize downtime.
I. Backup the existing site files:
Do a mysqldump of the database and tar backup of all the site files:
mysqldump -u root -p tburnsBlog > /path/to/backupLocation/tburnsBlog.sql tar cvzf /path/to/backupLocation/tburns.com.tar.gz /path/to/DocumentRoot/tburns.com
II. Install the new site files prior to making them “live”:
1. Download the latest wordpress distribution. http://wordpress.org/download/. This gave me a zip file which I pushed to my webserver via scp.
2. Unzip the archive where your wordpress webserver files currently live. Be careful not to overwrite your exisiting files. In my case, because I have several sites living on this server, the wordpress installation lives in a folder called tburns.com/. After unzipping the new download, I now have a folder called tburns.com/ and one called wordpress/
3. Copy the plugins you need from the existing site files location to the new wordpress folder. For me, these files live in tburns.com/wp-content/plugins. I copied them to wordpress/wp-content/plugins. Only copy the directories and files that you need. I did it one directory (and in the case of the code-markup plugin, one file) at a time to ensure I didn’t bring any junk over that I don’t need. I left the wordpress/wp-content/plugins/akismet/ folder alone. That plugin (v.2.2.6) comes bundled with wordpress and the new one is an upgrade to my earlier version, 2.2.3.
4. Copy the themes you need from the existing site files location to the new wordpress folder. For me these files live in tburns.com/wp-content/themes. I copied them to wordpress/wp-content/themes. My existing theme is where my google-analytics settings live, so by copying the entire theme directory structure over, you include that information as well.
5. Copy your database connection information to the new site files location. This is a file called wp-config.php. This file lives at the root of tburns.com/. I copied it to the root of wordpress/. This doesn’t replace an existing file in the wordpress/ directory tree. You are expected to create this file from a file called wp-config-sample.php upon installation.
6. Copy your .htaccess file if you have one. Mine uses mod_rewrite to create friendly URLs. Without it, none of my post’s links will work. This file lives at the root of tburns.com/. I copied it to the root of wordpress/.
III. Don’t delete anything yet… modify the virtual host path to point to the new directory structure.
Edit httpd.conf and modify the virtual host settings:
<virtualHost *:80> #tburns.com ... DocumentRoot /path/to/site/files/wordpress # DocumentRoot /path/to/site/files/tburns.com ...
Then restart the httpd service.
IV. Launch the new site.
Launch the url; and log in to the wordpress administrator. You should get a prompt immediately to upgrade the database. Click on the Upgrade button. It should only take a few seconds… and you’re done.
V. Clean-up
Now rename your old files. In my case, I renamed the tburns.com/ folder to tburns.com.old/ and put it in with the backups. Then I re-edited the httpd.conf file so it looked like this again:
<virtualHost *:80> #tburns.com ... DocumentRoot /path/to/site/files/tburns.com ...
Then I renamed the wordpress/ folder to tburns.com, restarted the httpd service, and that was that.
