Migrating version control from Subversion to Git

Recently at work we have moved over from using Subversion as our Version Control System to Git. We made this change for several reasons:

  • Branching and merging between branches is much easier in Git.
  • Git is a distributed version control system. Every working copy is a repository its own right and therefore hold a full development history of the project. The remote server can go down without the problem of having to restore from a backup.
  • Git is very fast compared to Subversion.
  • Git is cool.

The procedure from migrating over from Subversion to Git is fairly straightforward.

Firstly we ...

Published on: 9 December 2009

Moving a Subversion repository to a new server

There are many ways available to migrate a Subversion repository between servers using such tools as svnsync or svnadmin hotcopy.

However if you are migrating from a server with an old version of Subversion, you may not have these tools available.

The easiest method I have found to move a repository is simply dumping the repository to a file on one server, copying this file to the other server and then loading the file into the new repository. The commands show below are those I have used successfully before. First we will dump our existing repository into a dump file ...

Published on: 18 November 2009

Setting up a Maven controlled web application for Spring and Hibernate

This guide is a quick introduction into how to set up a web application project for Spring and Hibernate using Maven.

The first step is to create a project using Maven's built-in archetype commands. An archetype is a project templating toolkit, which allows us to create projects to a specified and standardised pattern.

To generate a project we can use Maven's archetype:generate goal together with an archetype ArtifactId, which specifies the type of project that we wish to create. Our project will be a web application, so we will use the maven-archetype-webapp archetype ArtifactId. From a terminal ...

Published on: 27 September 2009

Setting up a web service with Django and SOAP

With the increase of business to business (B2B) communication, the need for machine to machine software interaction over a network has become a must. Such a system is know as a Web Service and can take a variety of forms and specifications. One such protocol is called SOAP.

SOAP uses the Internet application layer transport protocols and commonly HTTP to transfer XML Request and Response messages to and from a Web Service provider. In additional the Provider uses the WSDL (Web Services Description Language) to publish an XML format document with a list of service and operations available.

Creating Web ...

Published on: 13 September 2009

How to store Rails sessions in a database

By default Rails will store session data in text files within the /tmp/sessions directory. If you are fed up with all the files that are generated and sick of the housekeeping that they incur, then you may prefer to store this data in your database. Rails comes with ActiveRecord Store which uses ActiveRecord for this purpose.

To set this up we first need to uncomment the following line from environment.rb to tell Rails to store sessions in the database:

 config.action_controller.session_store = :active_record_store

The next thing we need to do is generate the schema migration file add_sessions.rb ...

Published on: 13 August 2009

Django, Mod Wsgi and Python Eggs

Python Eggs are a method of aggregating a project together with any additional required information, allowing it to become a self contained module for other projects. There use in Python is similar to that of the Jar format in the Java programming language.

If you receive the follow errors in your Apache logs when you are using Python Eggs in you project:

 [error] [client] [Errno 13] Permission denied: '/var/www/.python-eggs'
 [error] [client] 
 [error] [client] The Python egg cache directory is currently set to:
 [error] [client ...

Published on: 13 July 2009

Setting up a Django production environment using Virtualenv and Fabric

Why would you want to use Virtualenv and Fabric to set up your Django production environment?

Some of the major problems with setting up any environment are dependencies and their versions as well as ease of deployment. For Python, these problems can be address by a combination of the tools Virtualenv and Fabric. Virtualenv is a tool for creating isolated Python environments. It will allow you to bundle you application together with it dependencies and its own instance of a Python interpreter. You can run several applications in their own virtual environments with perhaps different versions of Python. Also as ...

Published on: 13 June 2009

Debugging too many open files exceptions

When I first started working at Titan, I was given a job to write a small admin app to allow our web load team to upload and reorder multiple product images for our website. The app was written in Java and Tapestry and used ImageMagick together with the JMagick bridge to resize and correct the uploaded imagery.

When I was happy with my code, the app was deployed to a Debian Server running Tomcat 5.5 and handed over to the web load team.

The app was left to run continuously but unfortunately within about a month it had crashed ...

Published on: 13 April 2009