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:

The Subversion of ChristianityThe Subversion of ChristianityPointing to the many contradictions between the Bible and the practice of the church, Jacques Ellul asserts in this provocative and stimulating book t... Read More >
PHP Objects, Patterns, and PracticePHP Objects, Patterns, and PracticeAided by three key elements: object fundamentals, design principles, and best practices, you'll learn how to develop elegant and rock solid systems us... Read More >
Start Your Own Travel Hosting Business: Airbnb, VRBO, Homeaway, and More (StartUp Series)Start Your Own Travel Hosting Business: Airbnb, VRBO, Homeaway, and More (StartUp Series)GET PAID FOR YOUR PAD

An ever-growing number of travelers are searching for more convenient and low-cost accommodation alternatives, as oppose... 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 and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)It hasn't taken Web developers long to discover that when it comes to creating dynamic, database-driven Web sites, MySQL and PHP provide a winning ope... Read More >
Modern PHP: New Features and Good PracticesModern PHP: New Features and Good Practices

PHP is experiencing a renaissance, though it may be difficult to tell with all of the outdated PHP tutorials online. With this practical guide, you... Read More >

PHP Objects, Patterns, and PracticePHP Objects, Patterns, and PracticeAided by three key elements: object fundamentals, design principles, and best practices, you'll learn how to develop elegant and rock solid systems us... Read More >