Monday, March 17, 2008

Migrating subversion repository - forking new project

This far in our company we were using single repository project to maintain all our projects. That is, we create a new subdirectory in the root project directory when we need to start another project. It requires less server side maintenance at the cost of less security. It was just fine for a small developer team, until recently.

Now I need to create projects out from each directory under root (i.e. each project), with revision number starting from 1 for each project.

The steps I followed -
1. Created svk mirror of each projects root directory.
2. Dump svk's local mirror. This creates a plain svn dump maintaining projects revision number
3. Manually removing projects root directory
4. Load svn dump to a new svn repository

That's it :)

1. Create svk mirror for each project
a. initialize local mirror
svk mirror <svn url>/<project_directory> //<project_name>

b. sync, copy project directory to local svk mirror
svk sync //<project_name>
2. Dump local svk mirror
svnadmin dump ~/.svk/local > <dumpfile>
3. Manually removing project's root directory

4. Create a new project and load the dump

sudo svnadmin create <project_name>

sudo svnadmin load <project_name> < <dumpfile>

1 comment:

hasan said...

i was looking for this solution for a long while, thanks for mentioning the whole procedure.