📜 ⬆️ ⬇️

Restore SVN repository

Once upon a time in one of the offices there was one repository for all projects.

svn svn://server/
some1
some2
some3


in principle, it was quite convenient, because everything is stored in the same database.

But faced with a problem. it is not clear why, the base began to crumble at the very moment when it was decided to divide the repository into several.

')

To begin with, it was necessary to find all break points, if any.

find the first gap:
svnadmin dump --incremental -r0:HEAD c:\path\to\repo > test.dmp
In my case, out of 8600 revisions, the first one was found quickly ... 2300th revision.

Next, find more points:
svnadmin dump --incremental -r2301:HEAD c:\path\to\repo > test.dmp

got one more. 3459.

and find more.
svnadmin dump --incremental -r3460:HEAD c:\path\to\repo > test.dmp

there were no more errors.

Now we make dumps of live revisions.
s vnadmin dump --incremental -r0:2299 c:\path\to\repo > dump(0-2299).dmp
svnadmin dump --incremental -r2301:3458 c:\path\to\repo > dump(2301-3458).dmp
svnadmin dump --incremental -r3460:HEAD c:\path\to\repo > dump(3460-HEAD).dmp
vnadmin dump --incremental -r0:2299 c:\path\to\repo > dump(0-2299).dmp
svnadmin dump --incremental -r2301:3458 c:\path\to\repo > dump(2301-3458).dmp
svnadmin dump --incremental -r3460:HEAD c:\path\to\repo > dump(3460-HEAD).dmp


Now we do the division of repositories for projects.

project 1:
svndumpfilter include /some < dump(0-2299).dmp > some-1.dmp
svndumpfilter include /some < dump(2301-3458).dmp > some-2.dmp
svndumpfilter include /some < dump(2301-3458).dmp > some-3.dmp


project 2:
svndumpfilter include /some2 < dump(0-2299).dmp > some2-1.dmp
svndumpfilter include /some2 < dump(2301-3458).dmp > some2-2.dmp
svndumpfilter include /some2 < dump(2301-3458).dmp > some2-3.dmp


by analogy and the third as well.

Next, create a repository for the first project:
svnadmin create c:\path\to\some

and dump the dumps:
svnadmin load c:\path\to\some < some-1.dmp
svnadmin load c:\path\to\some < some-2.dmp
svnadmin load c:\path\to\some < some-3.dmp


and here errors like can appear:
1. file already exists
2. as it is not paradoxical - there is no file.

in the first case, everything is simple - we go into the repository, for example, with a “turtle” and delete this interfering file.

in the second case, you will have to do screenings in dumps
svndumpfilter exclude /chto/ne/nawlos < some-1.dmp > some-11.dmp

and then upload it to the repository.

But in general, that's all.

Source: https://habr.com/ru/post/74044/


All Articles