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:

Hosting the Presence Curriculum: Unveiling Heaven's AgendaHosting the Presence Curriculum: Unveiling Heaven's Agenda

Prepare for the ultimate assignment…

Have you ever wondered:

•If God’s Presence is inside of me, how does that impact my life? •I... Read More >
Software Engineering at Google: Lessons Learned from Programming Over TimeSoftware Engineering at Google: Lessons Learned from Programming Over Time

The approach to and understanding of software engineering at Google is unlike any other company. With this book, you’ll get a candid and insightf... Read More >

Programming PHP: Creating Dynamic Web PagesProgramming PHP: Creating Dynamic Web Pages

Why is PHP the most widely used programming language on the web? This updated edition teaches everything you need to know to create effective web a... 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:

Programming PHP: Creating Dynamic Web PagesProgramming PHP: Creating Dynamic Web Pages

Why is PHP the most widely used programming language on the web? This updated edition teaches everything you need to know to create effective web a... Read More >

PHP and MySQL for Dynamic Web Sites: Visual QuickPro GuidePHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide

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

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 >