Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Issues»SVN Repository Corruption – SVNREPO/db/current

    SVN Repository Corruption – SVNREPO/db/current

    By RahulOctober 23, 20152 Mins Read

    Recently one of repository on my SVN server is got corrupted. After checking we found that there was issue with svnrepo/db/current file was got corrupted due to bad sectors in my hardisk. I tried to checkout this repository but failed.

    Advertisement

    How to Recover Corrupted SVN Repository –

    Before start recovery we should know about this file. This file contains the latest revision number of your repository. On each commit svn server increase this value by +1 and keep this on last revision.

    Now If you remember the version of your repository, Just recreate new file and put that number in this file. But If you don’t remembers it, then the problem start, but don’t worry. Follow below steps to find revision number.

    • Enter Any Number –

      Enter a number and try to keep it higher than expected last revision. In my case i have put 99999 in db/current file.

      [email protected]:~$ cat db/current
      
      99999
      
    • Backup Repository –

      Now use the following command to backup this repository. When you run the following command, it may end with error like below.

      [email protected]:~$ svnadmin dump /path/to/repo > /backup/myrepo.dump
      
      
      * Dumped revision 0.
      * Dumped revision 1.
      ...
      ...
      * Dumped revision 576.
      * Dumped revision 577.
      * Dumped revision 578.
      svnadmin: E160006: No such revision 579 
      

      As per your output, we got that our repository have 578 revisions. You can just put this value in your db/current file. But if there are any more files corrupted, then continue to following steps.

    • Backup Repository Again –

      Now we have the last revision number, So specify revisions from 0 to last revision to backup.

      [email protected]:~$ svnadmin dump -r 0:578 /path/to/repo > /backup/myrepo.dump
      
    • Re-Create New Repository –

      Now remove old corrupted repository and create new one with same name or other name.

      [email protected]:~$ mv /path/to/repo /backup/
      [email protected]:~$ svnadmin create /path/to/repo
      
    • Load Repository from Backup –

      Now load repository data from backup file using following command.

      [email protected]:~$ svnadmin load /path/to/repo < /backup/myrepo.dump
      

    Repository svn svnadmin
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    (Solved) apt-add-repository command not found – Ubuntu & Debian

    View installed repositories on Ubuntu and Debian

    How to List Installed Repositories In Ubuntu & Debian

    How To Install SVN Server on Debian 11/10

    Add A Comment

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • How to List Manually Installed Packages in Ubuntu & Debian
    • 10 Bash Tricks Every Developer Should Know
    • How to Validate Email Address in JavaScript
    • Firewalld: Common Firewall Rules and Commands
    • 12 Apk Commands in Alpine Linux Package Management
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.