SVN server crashed, how to recover data from a client

31 views
Skip to first unread message

Rafael Rodriguez

unread,
Aug 7, 2018, 10:27:31 AM8/7/18
to TortoiseSVN
Hello,

Yesterday the server where I have my svn repository died.

So I loose all my information, I have around 30 clients connected to that server, so looking around, I found that one of them have the logs at cached data. I see this by clicking right click on the folder --> SVN tortoise --> show log.

Is there any way to recover my information from that client either the logs or the previous version of my files?

Stefan

unread,
Aug 7, 2018, 10:31:01 AM8/7/18
to TortoiseSVN
Sorry, no.
The clients do not have the history data stored. Only the log messages for the working copies but not the branches and tags.
And of course no history of the file changes.

I really hope you have a backup of your server. If not, then you've just learned a valuable lesson...

Stefan

rafa...@gmail.com

unread,
Aug 7, 2018, 11:12:56 AM8/7/18
to TortoiseSVN
Hello Stefan,

Thanks for your answer. Really sad notice.

Last question, if there a way to at least export the data of the logs to a any type of text file?

Regards
Rafael Rodriguez

Stefan

unread,
Aug 7, 2018, 11:34:05 AM8/7/18
to TortoiseSVN
You can save all the logs by showing them in the log dialog, then hit Ctrl+A to select all and then hit Ctrl+C to copy it to the clipboard.
There's also a context menu where you can specify which data is copied to the clipboard.

rafa...@gmail.com

unread,
Aug 7, 2018, 12:23:00 PM8/7/18
to TortoiseSVN
El martes, 7 de agosto de 2018, 10:34:05 (UTC-5), Stefan escribió:
> You can save all the logs by showing them in the log dialog, then hit Ctrl+A to select all and then hit Ctrl+C to copy it to the clipboard.
> There's also a context menu where you can specify which data is copied to the clipboard.

Thank you very much, it worked. At least not everything were lost.

Stefan

unread,
Aug 7, 2018, 12:38:51 PM8/7/18
to TortoiseSVN
Good. And now when you set up the server again, connect an external USB drive or a NAS and set up a backup task!

Stefan

rafa...@gmail.com

unread,
Aug 7, 2018, 12:53:17 PM8/7/18
to TortoiseSVN
Sure I will! this a really painfull lesson.

Could I create a new repository in a different server, which starts with a revision different than 0? I wanted to have a new repository with the revision number same as the one I lost.

Stefan

unread,
Aug 7, 2018, 1:02:57 PM8/7/18
to TortoiseSVN

Could I create a new repository in a different server, which starts with a revision different than 0? I wanted to have a new repository with the revision number same as the one I lost.

I'd say "don't do that" because that will lead to a whole lot of problems: most svn clients are not prepared for that, and the automatic tests of the svn library don't test for that, so if commands work with such a repository it's pure luck.

Another thing:
You can also create a backups on client machines if you like. First create an empty repository, then enable the pre-revprop-change hook.

$ svnadmin create backuprepo
$ echo exit 0; > backuprepo/hooks/pre-revprop-change.bat

now you can use svnsync to synchronize your repo on the server with the local one:

$ svnsync init https://server/repo file:///d:/backuprepo

now, all you have to do is run
$ svnsync sync file:///d:/backuprepo

every day and you'll have a mirror of the repository on the server.

I do that with all my opensource repos as well - sourceforge lost once my repo and their backup was corrupt as well, so now I keep a mirror of my repos just to be save.

Stefan

Stefan

unread,
Aug 7, 2018, 1:20:33 PM8/7/18
to TortoiseSVN
just in case you use SubWCRev to include the revision number in some resources:
you can pass an offset to SubWCRev so when your new repo starts with rev 1 again, you can pass the offset so that your revisions in the resources still match:
use $WCREV+offset$ instead of just  $WCREV$

Stefan
Reply all
Reply to author
Forward
0 new messages