Using Version Control to Manage Web Site Changes

A while back I decided that Version Control software was a better way for me to manage web site changes. This adds a little bit more documentation and incremental control over the daily backups. For small shops Version Control looks like overkill but it is simple to use. So I bit the bullet and setup a Subversion repository on my Windows-based computer. Initially I thought I would only keep my theme customizations and content in the repository but I eventually decided to keep the entire directory. Today I decided to document the process I use to update a website. In this case I am upgrading WordPress from 2.1 to 2.1.1 with a zipped file of changed files. I will be using several open source programs in addition to Subversion and TortoiseSVN. I will be using WinMerge to compare directories and FileZilla to upload the files. There are many suitable programs for these tasks. These are the ones I used.

Step 1 – Update your working copies

Use TortoiseSVN to retrieve a clean working copy from the repository.

Step 2 – Download the updated files and expand into directories

In my case the updated 2.1.1 files are in a zip file which follows the WordPress directory structure. I download the file and expand it into directories. I also print the updated file list. I am going to use the file list as my check list for the rest of the process. Stuff happens!

Step 3 – Compare the directories and update the files.

I use WinMerge as a quick check to compare the directories. I have projects set up to automate my comparison settings. It should show that the files I am updating are the ones on the file list. Surprisingly I find I am missing a couple of files shown on the changed file list. I opt to download the full source and add the missing updated files to my updates. I use WinMerge to copy the changed files over the repository files.

 Step 4 – Update the website

In this step I use FileZilla and the file list to upload the changed files. It is a real plus that my host provider allows me to use sFTP. Every extra bit of security helps keep the hackers away. Since this is a minor update I will leave all of my plugins active during the upgrade. WordPress recommends that you deactivate your plugins before updating in case you run into problems. I sort the local directory based on Last Modified date so that the changed files are on the top and easier to find. I move from directory to directory updating the changed files. FileZilla continually reminds me that I am overwriting existing files. That is good. There are only four directories and twenty file so the process goes quickly. When I have finished uploading the files I go to my browser and click on the Site Admin link in WordPress. It prompts me with links to complete the upgrade. This is normal. I follow the links and finish updating the site within a minute. I do a quick check of the website to make sure everything is still working. I have finished updating the web site.

Step 5 – Commit the changes to the repository

I use TortoiseSVN to commit the changes and with a description. When I am finished I use TortoiseSVN to check the log and make sure that the  description I just added makes sense. This is probably the last time I will look at the description until I need to understand it sometime in the future. I am happy with what I wrote so I move on to my other projects.

Technorati tags: , ,