Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Issues»SVN Repository Corruption – SVNREPO/db/current

    SVN Repository Corruption – SVNREPO/db/current

    RahulBy 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.

    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
    Previous ArticleHow to chmod Files and Directories Recursively
    Next Article How to Redirect a URL in NGINX

    Related Posts

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

    Updated:November 10, 20201 Min Read

    How to List Installed Repositories In Ubuntu & Debian

    2 Mins Read

    How To Install SVN Server on Debian 11/10

    Updated:February 15, 20223 Mins Read

    How to Delete Commit History in Github

    Updated:July 15, 20212 Mins Read

    How to Install SVN Server on Ubuntu 18.04 & 16.04 LTS

    Updated:September 16, 20193 Mins Read

    How to Install Subversion 1.9 on Ubuntu & Debian

    2 Mins Read

    Leave A Reply Cancel Reply

    Recent Posts
    • How to Enable / disable Firewall in Windows
    • How to Install JAVA on Ubuntu 22.04
    • Switching Display Manager in Ubuntu – GDM, LightDM & SDDM
    • Changing the Login Screen Background in Ubuntu 22.04 & 20.04
    • How To Install PHP (8.1, 7.4 or 5.6) on Ubuntu 22.04
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

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