How to extract an SVN dump?
Asked Answered
T

3

8

I received an SVN dump file with a lot of pages (all HTML pages, and all server-side code as well) in the file. I'd to separate them out, but have no clue how to do this.

I'm on windows and I don't get SVN at all.

Talbott answered 10/7, 2011 at 18:11 Comment(2)
Are you saying that you received an html output of every file in the SVN combined? Or you received a listing of all the files in the repo?Sandblind
The questions is waaaay to vague. You have a svn dump file? What do you want to do? Just extract some files? Or extract a repository containing some paths of the dump?Lantana
B
10

The answer by Adam Butler is nearly perfect, but I got a few problems with it, so here is my working solution :

In a DOS windows (Use ConEmu for a better one)

First cd to your svn folder tools
mkdir d:\dumpRepo
svnadmin create d:\dumpRepo
type [PATH TO DUMP].dump | svnadmin load d:\dumpRepo
svn export file:///d:/dumpRepo d:\Exportedfiles

It's really important that the file URI for svn export contains only regular /

Brookner answered 7/3, 2014 at 14:25 Comment(1)
Is it essential to do the mkdir yourself as the svnadmin create creates the folder anyway?Juvenescent
C
5

There is a simple guide here - it is for linux/unix but works from a dos prompt: http://www.mhermans.net/get-files-from-svn-dump.html

First - download the command line svn http://subversion.apache.org/packages.html#windows This can be a challenge but eventually you will have svn.exe and svnadmin.exe in a bin folder somewhere. Once you have that it is smooth sailing:

From a dos box:

mkdir c:\backup_repo
[PATH TO SVN]\svnadmin.exe init c:\backup_repo
type [PATH TO DUMP].dump | [PATH TO SVN]\svnadmin.exe load
[PATH TO SVN]\svn.exe export "file:///C:\repo" c:\exportdest

HTH

Capital answered 1/10, 2013 at 0:40 Comment(3)
I got a comment per mail on that old blog-post a few weeks ago: "svn init was not an option; had to: svnadmin create backup_repo". Have not tested it, but perhaps it will help.Engler
'init' didn't work for me either, 'create' did. On Windows 7.Speight
Of course, then the next line doesn't work: "c:\Code\Iris>type svn\svn.svn_dump | svnadmin load svnadmin: E205000: Repository argument required The process tried to write to a nonexistent pipe."Speight
W
3

Assuming you have a full dump and not an incremental one you can extract the files easily. They are stored with a small piece of header information (including the size of the file) followed by the file itself.

If you've got an incremental dump (where you have the intial version of the file and then only the deltas)(ie the changes to each file when they were committed) you have a more difficult problem. However, there's an easy solution:

Install VisualSVN Server or http://www.ubersvn.com/ and use it to import the dump. Then use a tool like TortoiseSVN to see the history and export each file individually (ie, you just created a copy of the dumped svn repository and are now accessing it like any subversion user).

Willams answered 11/7, 2011 at 8:56 Comment(3)
It's full, by the sounds of it. I have VisualSVN and SilkSVN, what can I do to extract the full data?Talbott
read svnbook.red-bean.com to understand SVN, especially the bit about importing a dump into a repository. then start using your new repo.Willams
This process worked on Windows 7, install the VisualSVN server then use TortoiseSVN. For the import you may want to refer to visualsvn.com/support/topic/00010/#import-localSusceptive

© 2022 - 2024 — McMap. All rights reserved.