Revision of Drupal SVN Repo from Tue, 01/13/2009 - 18:55

Revisions allow you to track differences between multiple versions of your content, and revert back to older versions.

Build a Subversion repository to hold multiple versions of Drupal core, modules and themes for building your Drupal-powered websites.

cd /tmp
mkdir drupal
cd drupal
mkdir core modules themes core/current

Create the Subversion project:

svnadmin create /var/svn/drupal
svn import /tmp/drupal file:///var/svn/drupal -m "Initial import of Drupal repo."
find /var/svn/drupal -type f -exec chmod 660 {} \;
find /var/svn/drupal -type d -exec chmod 2770 {} \;
chown -R nobody.nobody /var/svn/drupal

Create the Trac project:

cd /var/trac
trac-admin drupal initenv

Adjust the file permissions:

chown -R nobody:nobody drupal

Add a Drupal core release to the repo
At this point, we will intentionally populate the Drupal core section of our repo with an outdated version so that we can demonstrate how to update it afterwards.
Download a tarball of Drupal 5.9:

cd /tmp
wget http://ftp.drupal.org/files/projects/drupal-5.9.tar.gz
tar zxvf drupal-5.9.tar.gz
rm drupal-5.9.tar.gz

Load the release into the repo as current:

svn_load_dirs.pl file:///var/svn/drupal/core current /tmp/drupal-5.9 -t drupal-5.9

Create a site using your Drupal repo

mkdir /tmp/projectname
cd /tmp/projectname
mkdir branches trunk tags

Create the SVN project for your site:

svnadmin create /var/svn/projectname
svn import /tmp/projectname file:///var/svn/projectname -m "initial creation of site structure"

Adjust the repo file permissions:

find /var/svn/projectname -type f -exec chmod 660 {} \;
find /var/svn/projectname -type d -exec chmod 2770 {} \;
chown -R nobody.nobody /var/svn/projectname

Create the Trac project:

cd /var/trac
trac-admin projectname initenv

Adjust the project's file permissions:

chown -R nobody:nobody projectname

Give the Administrator access to the project but remove Anonymous access:

cd /var/trac
trac-admin projectname permission add administrator TRAC_ADMIN
trac-admin projectname permission remove anonymous '*'

Check out a working copy
We'll store our website copy in /var/websites to keep it separate from the Apache programs in /usr/local/bin/apache2. This will also make a directory for the Apache logs:

mkdir -p /var/websites/projectname/logs
mkdir /var/websites/projectname/htdocs

We'll then checkout a copy from svn into /var/websites/projectname/drupal-5.10:

cd /var/websites/projectname/htdocs
svn checkout http://<your_svn_server>/svn/projectname/trunk .

Hmmmm...there's nothing in the resulting htdocs folder. We need to copy the Drupal core files from our Drupal repo. On the SVN server:

cd htdocs
#piston import http://<your_drupal_repo>/svn/drupal/
svn export http://<your_svn_server>/svn/drupal/core/current drupal-5.14

Make a copy of settings.php and give write permissions to the original:

cp drupal-5.14/sites/default/settings.php drupal-5.14/sites/default/settings-orig.php
chmod ugo+w drupal-5.14/sites/default/settings.php

After the initial Drupal config with a web browser, create the files directory:

cd /var/websites/projectname/htdocs/drupal-5.14
mkdir files
chmod ugo+w files

With a basic site up and running, commit the changes into the site's SVN repo:

cd /var/websites/projectname/htdocs
svn add drupal-5.14
svn commit -m "Initial site configuration."

Update the Drupal core


Add the new version of Drupal to your repo
Download the new tarball:
cd /tmp
wget http://ftp.drupal.org/files/projects/drupal-5.10.tar.gz
tar zxvf drupal-5.10.tar.gz
rm drupal-5.10.tar.gz

Load the release into the repo as current:

svn_load_dirs.pl file:///var/svn/drupal/core current /tmp/drupal-5.10 -t drupal-5.10

Recent Updates

  • 8 months 3 weeks ago
    1.27.2 update
  • 9 months 4 days ago
    Drupal 10/11 config
  • 9 months 6 days ago
  • PHP
    9 months 6 days ago
    PHP 8.3.11 and AlmaLinux
  • 9 months 6 days ago
    New version of Pound