How to change subversion working copy UUID?

New answer since Subversion 1.7 working copy format. You need sqlite3 command line utility.

In the root directory of your working copy, there is now a single .svn/ folder with a SQLite database. You can query current repository UUID known for your working copy with:

$ sqlite3 .svn/wc.db 'select uuid from REPOSITORY where id=1'
b6dc3e6c-5320-4549-b231-c153d86d7525

As a result, changing UUID can be done with:

$ sqlite3 .svn/wc.db 'update REPOSITORY set uuid="1c0d1ec1-2326-0410-bef5-eb29cddfc032" where id=1'

Of course, keep a backup of the .svn/wc.db file before invoking update query. There is almost no chance that your repository entity has different id or there are multiple lines in that table but you may check if you get unexpected results.


Here is a command that does the trick for SVN 1.6 and below:

find . -type f -name entries -exec sed -i 's/old-uuid/new-uuid/g' {} \;

Replace old-uuid and new-uuid with the actual ids.


You need to edit all the 'entries' files in your pulled repo. If the repo has a lot of directories, find + a sed script will make short work of the task.

Tags:

Svn