Website Subversion Backup

As a PHP coder and web developer, I have recently discovered and fallen in love with a tool which helps to keep my source code safely backed up. This tool is called Subversion and “it is used to maintain current and historical versions of files such as source code, web pages, and documentation.” (1) In simple terms, it allows you to back up your files and keeps a history of all the versions of files that you send to it.

This is VERY useful when doing PHP development because as you develop your application you can commit versions of the files to the Subversion (SVN) repository and it will keep track of all the changes you have made. If necessary, you can even revert back to older versions.

One of the difficulties that I have run into while doing website development is how to keep the live remote website synchronized with my local working copy. This is especially true of WordPress installations where editors may be uploading new pictures or documents to the site on a daily basis. If you are not constantly downloading the latest copy of the website, your local copy will be out-of-date and may cause problems in your development.

Subversion to the Rescue:

However, I have come up with a relatively simple solution to this problem, which utilizes the controls within Subversion, to both back up the data on the LIVE website, as well as providing version control for all the site data as a whole. For the sake of simplicity, I will be using a WordPress website as my example, but the concepts here could be applied to essentially any website.

One of the useful features of Subversion is the ability to run what they refer to as “hook scripts” at different points in the versioning process. For example, an SVN repository can be configured to run a set of scripts directly after any data is “committed” to it. (sending data to the repository is called “committing” the data) For this example, this is exactly the functionality we are going to be using.

Before I go any further though, let’s go over some of the requirements for setting up a website and subversion repository in this way.

Read the rest of this entry »

Related Reading:

Network Backup with Bacula [How-to]Network Backup with Bacula [How-to]

Create an autonomous backup solution for your computer network using practical, hands-on recipes

Overview

Set up Bacula infrastructure.... Read More >
Moving Your WordPress Website ChecklistMoving Your WordPress Website ChecklistIf you ever plan on moving your WordPress website from one hosting company to another, here’s how I do it. Here’s my personal checklist for moving whole WordPress websites.
Beginning Programming All-In-One Desk Reference For DummiesBeginning Programming All-In-One Desk Reference For DummiesSo you want to be a programmer? Or maybe you just want to be able to make your computer do what YOU want for a change? Maybe you enjoy the challenge o... Read More >

FormBuilder WordPress Plugin

I am very excited to announce the public (beta) release of the FormBuilder WordPress plugin on WordPress.org. FormBuilder is a project which was inspired, in part, by my work on FormContact 1.0 and came about as a result of our need for a good yet simple form building utility for WordPress.

The plugin was developed by me while working for TruthMedia. At the time of writing, it is at v. 0.57 and is compatible with WordPress 1.5 – 2.5. If you have a WordPress blog already, why not check it out!

Related Reading:

PhP: Learn PHP Programming Quick & EasyPhP: Learn PHP Programming Quick & EasyWant to learn the in-demand skill of PHP programming… AND do it fast?

Are you new to computer programming or just want to brush up on some skills... Read More >

Learning PHP, MySQL & JavaScript: With jQuery, CSS & HTML5 (Learning Php, Mysql, Javascript, Css & Html5)Learning PHP, MySQL & JavaScript: With jQuery, CSS & HTML5 (Learning Php, Mysql, Javascript, Css & Html5)The fully revised, updated and extended 4th edition of the hugely popular web development book - includes CSS, HTML5, jQuery and the mysqli extension.... Read More >
Head First PHP & MySQL: A Brain-Friendly GuideHead First PHP & MySQL: A Brain-Friendly Guide

If you're ready to create web pages more complex than those you can build with HTML and CSS, Head First PHP & MySQL is the ultimate learning guide ... Read More >