Importing ImpressCMS SVN repository on SourceForge
Since a little bit more then a year, we were using the services of CVSDude (which has now become Codesion) for the SVN repositories and Trac instances of ImpressCMS. When we first created ImpressCMS, we were using SourceForge: for these things but at that time, SourceForge features were not meeting our needs. Plus, they did not have Trac. This explained our choice of using CVSDude.
A year and a half later, many things have change. SourceForge did a hell of a good job implementing new features and improving their site usability. And they added Trac! In the meantime, CVSDude also added many new features, and then changed their plans, and their name. We have now reach a point where we are no more satisfied with CVSDude and we had to decide to go back to our first love
.
But importing SVN repositories from one provider to another comes with its challenge. At least for me! I had never done this before and had to learn the hard way. But SourceForge support was outstanding, much better then what I remembered! So Kudos guys!
Along the way, I’ve learned quite a few things, which I think are worth sharing, or, at the very least, worth documenting for me, in case I ever need to do this again, hopefully, not with ImpressCMS repositories. We are there to stay with with SourceForge!
Backup first!
So, how did you import an SVN repository on SourceForge ? Well, the very first thing I recommend before importing a dump is to first take a backup of your repository. So if something goes wrong, you can restore it easily. Open a Putty session or a Terminal, and run this command, where projectname is the UNIX name of your project.
rsync -av projectname.svn.sourceforge.net::svn/projectname/*
This will copy your entire repository to your local computer. Then, issue this command to create a dump of your repository:
svnadmin dump projectname >filename.dump
Interactive Shell Session
Ok, so we have a backup, now on to next step, for which you need Shell Access permission on your SourceForge account. If you don’t have it, ask your administrator. Then open an interactive shell session, using Putty or a Terminal:
ssh -t username,projectname@shell.sourceforge.net create
Where, of course username is your SourceFogre username. Keep in mind that your session will remain open for 4 hours. All sessions are terminated after this time.
Once you have created your session, you can access it after (but within 4 hours) by using this:
ssh username,projectname@shell.sourceforge.net
Uploading the dumps
Ok, now, we need to upload the SVN dumps on SourecForge to be able to import them. Of course, I had previously contacted CVSDude to ask them to create SVN dump of our 2 repositories. I downloaded them and now they sit on my Desktop on a folder named dumps.
But first, let’s create a folder on SourceForge to receive the dumps. So from the interactive shell:
mkdir dumps
Using SCP, we can easily upload those on SourecForge. Opening a new Terminal, I used this:
scp -r -p /home/myusername/Desktop/dumps/* ssh -t malanciault,impresscms@shell.sourceforge.net:~/dumps/
It is a good idea to compress the dumps before you upload them. Will take less time. In my case, the 2 dumps were totalizing nearly 1 Gb. So it took a while… But when everything was there, I extracted the dumps. So from the interactive shell:
cd dumps
gzip -d core.gz
gzip -d addons.gz
Cleaning up the repository
Then, we need to use svnadmin to lock the repository and create a working copy where we will be able to do what we want:
adminrepo –checkout svn
Ok now, I want to erase what we currently have and then load the CVSDude dumps. To clean up the repository and start from scratch, you can do this (BUT PLEASE, make sure you did a backup first !):
rm -rf /svnroot/projectname/*
So the repository is gone, let’s create a new one:
svnadmin create /svnroot/projectname
Then you need to save your change:
adminrepo –save
Importing !!
So our repository was now emptied. Great! Using my SVN client (I’m using Subclipse within EasyEclipse), I connected to the repository and created 2 remote folders, addons and core. In the first one, I’ll load the core.dump and on the second one, the addons.core.
Back in the interactive shell, I need to checkout the repository again:
adminrepo –checkout svn
Then, load the core.dump into the core folder:
svnadmin load /svnroot/impresscms –parent-dir core < dumps/core.dump
And the addons.dump into the addons folder:
svnadmin load /svnroot/impresscms –parent-dir addons < dumps/addons.dump
And we save everything:
adminrepo –save
And you are done. Two repositories, imported into a single one!
More info
Should you want to read a little bit more on all this, here are a few documentation links which allowed me to complete this process:
- Using rsync for backups
- SourceForge Interactive Shell Service
- Subversion Import Instructions
- Reseting a repository from scratch
Marc – thanks for taking charge of figuring this out and getting it done! Nice to have the ‘how-to’ documented, too.
Open source projects rely a LOT on shared information and the tools they need to succeed have to work consistently, or the enthusiasm dies and the projects stall. I’m glad SourceForge realized they needed to step up their support and tools they offered for OSS.