Switching a Cerb5 installation from Subversion to Git

Introduction

Prior to the release of Cerb5, the official recommendation was to use Subversion for installing and upgrading the app. This made sense years ago when support wasn't prevalent for the next generation of distributed version control tools like Git. Today, Git is available for all major platforms. Our official repositories are managed with Git and collaboration is provided through GitHub.

If you're still using Subversion to manage your Cerb5 installation, we highly recommend that you migrate to Git.

As of January 2012 we have discontinued hosting our own Subversion repositories. If for some reason you are unable to use Git, you can switch to our new Subversion repository at GitHub.

Make the change

Move your existing Cerb5 installation to a directory named cerb5-svn.

Make a backup

Make a recent backup using the instructions here:
http://wiki.cerb5.com/wiki/Backups

Keep local modifications

Change directory to your existing files:

cd cerb5-svn

Make a patch of your local modifications:

svn diff > my_changes.patch

Find your existing version

grep "APP_VERSION" -m 1 api/Application.class.php

Download the same version of Cerb5 with Git

Return to the parent directory where cerb5-svn is located:

cd ..

Perform a fresh checkout of the Cerb5 project files from Git using the same version. Replace <version> in the command below with the version number from the previous section above with the following convention:

  • 5.5.0 -> 5.5
  • 5.5.2 -> 5.5.2

In other words, if the version ends in .0 then just include the first two numbers.

Checkout the latest version of Cerb6 from GitHub using Git:

git clone -b <version> git://github.com/wgm/cerb6.git cerb6-git

Merge the copies

Remove the .svn subdirectories from storage and then move it to cerb5-git:

find cerb5-svn/storage -type d -name '.svn' -exec rm -Rf {} \;

mv -n cerb5-svn/storage/* cerb6-git/storage

You can then apply your patch to the new files:

cp cerb5-svn/my_changes.patch cerb6-git

cd cerb6-git

patch -p0 < my_changes.patch

rm my_changes.patch

Finish up

If you placed any custom plugins in the /features directory, move them from cerb5-svn/features to cerb6-git/storage/plugins. This is where all custom plugins should go in the future. Be careful to not copy any official plugins.

Move or rename the cerb6-git directory back to your desired location.

Make sure all the files are owned and readable by the webserver user, and the /storage directory and its contents are owned and writeable+readable by the webserver user.

This might be a good time to upgrade to the latest version using Git.

Open Cerb6 in your web browser.


Properties ID: 000071   Views: 3716   Updated: 6 months ago
Filed under:
knowledgebase comments powered by Disqus