SVN problem - Repo will not load

Any thoughts on the following:  


We have several  svn repository's located in /svn/repos/ such as
/svn/repos/project1
/svn/repos/project2

We have a backup script which essentially runs, as the www-data user, the following command on every repo:
svnadmin dump /svn/repos/project1 | bzip2 -9 >
/backup/project1-backup.svndump.bz2

This worked fine for a long time until something changed and /backup was recreated blank and the ownership of the older was wrong. www-data no longer had access to write to /backup so the backup would have failed.

For whatever reason though, in all the repo's key system files are missing now, files that make svn recognize the folder as "svn enabled".

The /svn/repos/project1/format file was missing, when I put the "format"
file back from a newly created repo, svnadmin verify then complained the /svn/repos/project1/locks/db.lock file was missing. When I put that file back in place from a newly created svn repo, then svnadmin verify complained about /svn/repos/project1/db/DB_CONFIG file missing.  So at least 3 key files are missing, presumably much more.  The only explanation is that the svnadmin dump command removed these core files but not sure why or how to repair the svn structure. The folders themselves are large, so the data is there/in-tact but I have no idea how to get svn to rebuild the missing files.


www-data@svnserv:/svn$ svnadmin verify /svn/repos/project1/
svnadmin: Can't open file '/svn/repos/project1/format': No such file or directory

www-data@svnserv:/svn$ svnadmin recover /svn/repos/project1/
svnadmin: Can't open file '/svn/repos/project1/format': No such file or directory

www-data@svnserv:/svn$ cp /svn/repos/newtestrepo/format /svn/repos/project1/ www-data@svnserv:/svn$ svnadmin verify /svn/repos/project1/
svnadmin: Error opening db lockfile
svnadmin: Can't open file '/svn/repos/project1/locks/db.lock': No such file or directory

www-data@svnserv:/svn$ svnadmin recover /svn/repos/project1/
svnadmin: Error opening db lockfile
svnadmin: Can't open file '/svn/repos/project1/locks/db.lock': No such file or directory

www-data@svnserv:/svn$ cp repos/newtestrepo/locks/db.lock repos/project1/locks/ www-data@svnserv:/svn$ svnadmin verify /svn/repos/project1/
svnadmin: Berkeley DB error for filesystem '/svn/repos/project1/db'
while opening environment:
svnadmin: Can't open file '/svn/repos/project1/db/DB_CONFIG': No such file or directory

www-data@svnserv:/svn$ svnadmin recover /svn/repos/project1/ Repository lock acquired.
Please wait; recovering the repository may take some time...
svnadmin: Can't open file '/svn/repos/project1/db/DB_CONFIG': No such file or directory



LVL 33
MikeKaneAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Joseph GanSystem AdminCommented:
If you have good backup dumpfiles, what you could to do are:

1. Shut down svn, Apache and anything else that might be accessing the repository.
2. Remove /path/to/repository
3. Re-create /path/to/repository
4. svnadmin create /path/to/repository
5. svnadmin load /path/to/repository < dumpfile
6. Restart svn, Apache etc.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Gerwin Jansen, EE MVETopic Advisor Commented:
Assuming your backup is not broken, can you try and restore your backup to a new folder, like this:
mkdir /svn/newrepos/project1
svnadmin load /svn/newrepos/project1 < bunzip2 /backup/project1-backup.svndump.bz2
chown -R svn:svnusers /svn/newrepos/project1 ; chmod -R g+w /svn/newrepos/project1/db/

Open in new window

Reference for steps above are here.
0
MikeKaneAuthor Commented:
We solved this by taking our weekly backup and dumping back into a new 1.6 server build.   We manually checked in the missing items to get us back up and running.   Very manual but the restore was the only way.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.