Monday, November 29, 2010

How to migrate an SVN repository

I had a chance to migrate an SVN repository of more than 10,000 revisions to another machine. Here are the process and the problems I solved.

1. Install a new Subversion server
CollabNet Subversion Edge 1.3 for Windows 64-bit is chosen because it has great web user interface to manage repositories and users.

2. Dump old repository
This should be very easy by using
svnadmin dump path/to/repository > repository.dump

But I got errors like
svnadmin: Filesystem path .../trunk/... is neither a file nor a directory

This is because either the file system or the repository is corrupt. I had to spit the dumping at the failing revision. Any dumpings after the failing point should use --incremental option.
svnadmin dump -r 0:N-1 path/to/repository > 0_N-1.dump
svnadmin dump --incremental -r N+1:M path/to/repository > N+1_M.dump

3. Create new repository
This can be done in 2 ways.
svnadmin create path/to/repository
or
New Repository in Repositories category in Subversion Edge's web UI (http://host:3343/csvn/repo/create).

Note, however, that you have to uncheck "Create standard trunk/branches/tags structure" in Use template option. Otherwise you will get following error when loading the dumped repository.
adding path : branches ...svnadmin: File already exists: filesystem '..\data\repositories\repository\db', transaction '123-4l', path 'branches'

4. Load dumped repository (for me, repositories)
Remember to use --force-uuid when you load the repository, or you may suffer either the above error or difficulties in relocate you old repository to new one.
svnadmin load --force-uuid path/to/repository < repository.dump

If you have failures in dumping like me. You have to replicate what the failing revision is supposed to be doing, and check in the changes to revision N in my example.

Hope it's helpful to Subversion users, but maybe migrate to Git is the way to go.

Thursday, November 11, 2010

A bug in GWT Designer

Two projects in my team encountered the same problem this week. If you have more than one classes (public A and non-public B) in a Java file (A.java, of course) in GWT client side, there will be compilation errors in GWT problems marker category saying
B can not be found in source packages. Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly.
However these errors affect nothing. You can still run as / debug as web application in development mode, or GWT compile the whole project successfully.

I'm using Eclipse Helios 3.6.1 (Service Release 1) in Ubuntu with
  • Google Plugin for Eclipse
  • GWT Designer

After investigation, I found it should be a bug of GWT Designer and reported it to GWT team.

If you really mind the "errors" and need to use GWT Designer, I think you know how to deal with it. In case you want to get rid of GWT Designer, go to Help - About Eclipse - Installation Details - Installed Software, and uninstall all the items with Id starting with com.instantiations.


18/11/2010 Update: It's a bug of Enhanced Compilation and got fixed in GWT Designer BETA.