Search code examples
svnvisualsvn-serverfsfs

Missing format file in Subversion FSFS repo


I trying set up http server for very old Subversion repository in VisualSVN Server, Windows Server 2012.

When importing in VisualSVN Server (apache+svn 1.8), it says

Can't open file 'C:\Reps****\format': The system cannot find the file specified.

I found file, named "format" in \db and choose it for import, then it saying

Expected repository format '3' or '5'; found format '2'

I try to upgrade repo by svnadmin v1.5, it also says

Expected repository format '3' or '5'; found format '2'

How upgrade repo to new format?


Solution

  • The file at $REPO/db/format is not the same as the file that Subversion is giving you an error about which would be at $REPO/format. The file at $REPO/format is the repository format and the file at $REPO/db/format is the filesystem format.

    The repository format number has had the following values (copied from repos.h):

    /* Repository format number.
    
       Formats 0, 1 and 2 were pre-1.0.
    
       Format 3 was current for 1.0 through to 1.3.
    
       Format 4 was an abortive experiment during the development of the
       locking feature in the lead up to 1.2.
    
       Format 5 was new in 1.4, and is the first format which may contain
       BDB or FSFS filesystems with a FS format other than 1, since prior
       formats are accepted by some versions of Subversion which do not
       pay attention to the FS format number.
    */
    

    As the error message is telling you the only supported formats are 3 and 5 (since the compatibility guarantees only started at 1.0).

    If the $REPO/format file is the only file missing, this will be fairly easy to fix. We can actually determine fairly easy from the information given above which of the two options it should be.

    Since you state that the repository is a fsfs format then it should only be a format 3 repository if the filesystem is format 1. So look in $REPO/db/format if the first line of that file is 1 then you need to set the repository format file to "3\n", otherwise set it to "5\n". However, in this case since you copied the $REPO/db/format file to $REPO/format the error message tells me that it is a format 2 filesystem. So you should have "5\n" in $REPO/format.

    Note that the $REPO/format file should contain only two characters, the ASCII character for the format number and a newline character.

    One last tip. You don't need to upgrade a repository in order to use it with a Subversion server. Servers are backwards compatible with old repositories. Some features may not be available if you don't upgrade the repository format. See the Subversion release notes for details.