How to reset the UUID of an SVN repository

If you want to reset (or set) the UUID of an SVN repository to match the one you have at hand, you have two routes depending on the version of Subversion you are running.

While running 1.5 or above, you can simply run:

$ svnadmin setuuid /path/to/your-repository d7d214ed-3d1f-46fa-9087-da11a3c61c15

However, if you are below 1.5, you don’t have this luxury because the setuuid command is not available. The trick would be to load a fake-repository with a UUID specification via svnadmin load command.

$ cat - <<EOF | svnadmin load --force-uuid /path/to/your-repository
> SVN-fs-dump-format-version: 2
>
> UUID: d7d214ed-3d1f-46fa-9087-da11a3c61c15
EOF

Tags: , , ,

  • http://sumeet.info/ Sumeet Mulani

    When would you want to do such a thing?

  • http://alexnj.com Alex N J

    Hey, Sumeet.

    This could be handy when you dump repository and reload at a different location. Since SVN clients verify the repository UUID (which is stored at both sides) on check-in/check-out, you can’t use the relocate command to re-point your working copy to the new repository, unless you have the right UUID. One of the above described techniques should save you on that day!

Copyright (c) 2000-2011 Alex N J. All rights reserved.
All and any opinion expressed here are solely mine and do not represent the views of my employer or any other person or organization related to me. Entries (RSS) and Comments (RSS).