Loaded svn repository is missing last few revisions - how do I fix this?
I dumped my repository
svnadmin dump repos > repos.dump
then I loaded it on the new machine
svnadmin load newrepos < repos.dump
and when finished the new repository is missing the last few hundred revisions.
Can I inspect repos.dump to see if it is missing the revisions? Can I dump the missing revisions and load them onto the new repository? Or, do I have to start over from scratch.
Starting from scratch would be a pain since the repository is 3GB and I have to grab it across the Internet at moderately low speeds!
EDIT: SOLVED - OPERATOR ERROR!
So, I forgot that I had already migrated the repository once (from account1 to account2) and and I never removed the account1 repository. I have a bash function to quickly开发者_C百科 ssh into my remote accounts and it logs me into account1 by default (which I wasn't thinking about) and since I saw the repository I figured everything was fine and hence sent the dump to account3 (again using an alias so that I didn't notice that I was in the wrong account).
Now, I'm going about putting the username for the account in bright red in the terminal, and I'm caching old repositories rather than letting them lie around. And, I'm taking out the default user aspect of my profile hack.
But, I was able to use --incremental
to transfer the missing revisions to the new location. So, all the advice still helped.
I would guess that your dump is larger than 4 GB (as dumps aren't saved with deltas by default, so they may be much bigger than the repo), and some step of the process of transferring the dump truncated to 4 GB, which is the maximum file size on some filesystems (and possibly in some protocols as well). It's also possible that some step of the process could be truncating it at 2 GB, depending on the file transfer method you're using.
You can check by inspecting the file; it should have revision numbers in it, and you can see how high they go.
Instead of starting the whole process over again, you can use the --incremental
option to svnadmin dump
to produce an incremental dump, starting with the last good revision you loaded into the new repo. Loading an incremental dump into an existing repository should work fine. You would do something like
svnadmin dump --incremental -r 1234:HEAD > repos.2.dump
# Transfer to new system
svnadmin load < repos.2.dump
Can I inspect repos.dump to see if it is missing the revisions?
Yes. There are lines like
Revision-number: XYZ
in the dump file.
Can I dump the missing revisions and load them onto the new repository?
Yes. You can use svnadmin load
to commit revisions either to a new or existing repository.
To verify that all revisions are in your dumpfile, grep for "Revision-number". You can also open the file in a text editor to inspect for any obvious damage, but do not save it.
The main reason that I've found for svnadmin load
to fail is if you're trying to load into a repository that already has content. The load command will check to verify that the repository is in the expected state prior to taking a dump file. I've worked around this in the past by using the --incremental
flag when dumping the repository.
It should write the revision numbers to the command line as it is doing the dump. That's what I get, even when redirecting to a file as you did.
You can examine the file itself and look for Revision-number:
to see what revisions are actually in it.
Personally, I'd dump it again. I sugest the most likley answer is your original dump did not complete successfully - did you see any errors in the command line after the dump ran? If you want to go inspecting the dump itself, have a look at this for some help: http://www.troyhunt.com/2009/12/black-art-of-splitting-subversion.html
The other thing you could consider is to just to transfer the original repo into the target location. You'll be copying a compressed version of your data so the process will be faster than copying a dump (not sure if you zipped it before transferring).
精彩评论