How to change subversion working copy UUID?
I've recently updated Subversion repositories from an old 1.2.3 version to 1.6.0 via svnadmin dump/load. The old repositories all used the same UUID (repositories were created using by copying a template repository). I've changed the UUID on a couple of the new repositories via svnadmin setuuid to be unique. I can't just relocate my existing working copies of those repositories because the UUIDs are different. I know about exporting the working copy and checking out from the new repository, but I was wondering whether there was a way to just change the UUID of the working copy in-place, like what svnadmin setuuid does for repositories.
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.
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.