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:

PHP: Basic Fundamental Guide for BeginnersPHP: Basic Fundamental Guide for BeginnersAre you new to PHP? Maybe you want to learn more about PHP programming, but you don’t know where to start? Regardless of your skill level, this book... Read More >
Web Hosting Guide for Beginners (J.D. Rockefeller's Book Club)Web Hosting Guide for Beginners (J.D. Rockefeller's Book Club)Whether you are a startup entrepreneur or a web development agency, picking the right web hosting service will be a key to your success in the busines... Read More >
How To Backup, Transfer and Clone Your WordPress WebsiteHow To Backup, Transfer and Clone Your WordPress Website$297 Free WordPress Backup, Transfer and Cloning Tool? Not exactly but it does the exact same thing as the one that does.

In this step by s... 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 (5th Edition)PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (5th Edition)

Learn PHP and MySQL programming— the quick and easy way!

Read More >
PHP and MySQL Web Development (5th Edition) (Developer's Library)PHP and MySQL Web Development (5th Edition) (Developer's Library)

PHP and MySQL Web Development, Fifth Edition

The definitive guide to building database-driven We... Read More >

Learning PHP, MySQL & JavaScript: With jQuery, CSS & HTML5Learning PHP, MySQL & JavaScript: With jQuery, CSS & HTML5

Build interactive, data-driven websites with the potent combination of open source technologies and web standards, even if you have only basic HTML... Read More >