Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We have about 5 different SVN repositories running on SVN 1.6.11 on top of CentOS Linux 6.3. I was asked to migrate our SVN server to a new server last week. We have a cron job that does a Full backup of each repo once a week, and every other night we do an incremental backup via: svnadmin dump -r 100-200 --incremental repo |gzip -9 > incremental_100_200.svn.gz (where repo is the name of the repo and 100 is the oldest revision since the last backup and 200 is the youngest revision at the time of this backup)

I did a full restore of the last full backup to the new server, creating an almost up to date copy of the repos. Throughout the week, I planned to restore the incremental backups from the old server to the new to keep them in sync and then switch to the new server on Friday.

Unfortunately, I must have missed an incremental restore on a few repos, and somehow not notice, and then we switched to the new server, and people continued to add files and make modifications, adding new revisions to the repo. The problem is, since there were some revisions missing on a few repos, now the new revisions have taken those revision numbers, so I cannot just get the incremental from the old repo and load it into the new repo since there is other data now occupying those revisions. What do I do?

share|improve this question
    
Did you delete a question? I think the solution may be in git-svn. –  Zoredache May 2 '13 at 5:22
    
Yes, I wanted to rephrase it better. If you give me an example of how it would be done, I would be very appreciative. –  user160910 May 3 '13 at 20:38

1 Answer 1

A revision from a dump does not require that it be loaded into the same revision number in the new repository as it was at in the old.

A simple test case is a repository with a file a that was created in r1, and b was created in r2:

# svn log
------------------------------------------------------------------------
r2 | root | 2013-05-02 00:26:16 -0600 (Thu, 02 May 2013) | 1 line

add file b
------------------------------------------------------------------------
r1 | root | 2013-05-02 00:25:49 -0600 (Thu, 02 May 2013) | 1 line

add file a
------------------------------------------------------------------------

Dumping those and loading in reverse order:

# cat r2.dump | svnadmin load new
<<< Started new transaction, based on original revision 2
     * adding path : b ... done.

------- Committed new rev 1 (loaded from original rev 2) >>>

# cat r1.dump | svnadmin load new
<<< Started new transaction, based on original revision 1
     * adding path : a ... done.

------- Committed new rev 2 (loaded from original rev 1) >>>

Works just fine, backwards timestamps and all.

# svn log
------------------------------------------------------------------------
r2 | root | 2013-05-02 00:25:49 -0600 (Thu, 02 May 2013) | 1 line

add file a
------------------------------------------------------------------------
r1 | root | 2013-05-02 00:26:16 -0600 (Thu, 02 May 2013) | 1 line

add file b
------------------------------------------------------------------------

Note that if you load a revision that modified a file that has since been modified in your new repository, all of the new changes since the loaded revision will be wiped out; you'll need to merge those changes back in.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.