svnadmin
Administer Subversion repositories
SYNOPSIS
svnadmin subcommand [options] [args]
Common subcommands:
svnadmin create REPOS_PATH [options]
svnadmin verify REPOS_PATH
svnadmin dump REPOS_PATH [-r REV[:REV]] [options]
svnadmin load REPOS_PATH [options]
svnadmin hotcopy SOURCE_REPOS_PATH DEST_REPOS_PATH [options]
svnadmin recover REPOS_PATH
PARAMETERS
--help (-h)
Displays a help message for svnadmin or a specific subcommand.
--version
Prints svnadmin's version information.
--bypass-hooks
Bypasses the execution of repository hooks during certain operations (e.g., during load, commit).
--config-dir DIR
Specifies a custom configuration directory for SVN settings.
--fs-type TYPE
Specifies the filesystem type for a new repository. Common types are 'fsfs' (default) and 'bdb'. (Used with create).
--compatible-version MAJOR[.MINOR[.PATCH]]
For 'fsfs' repositories, creates a repository compatible with older Subversion clients. (Used with create).
--revision (-r) REV[:REV2]
Operates on a specific revision or range of revisions. (Used with dump, load, verify, setlog, setrevprop).
--incremental
When dumping, outputs an incremental dump stream, suitable for appending to an existing repository dump. (Used with dump).
--deltas
When dumping, stores file contents as deltas against preceding revisions, making the dump smaller but potentially slower to load. (Used with dump).
--normalize-props
Normalizes textual property values during dump and load operations. (Used with dump, load).
--pre-2.1-compat
When loading, provides compatibility with pre-2.1 Subversion clients for older dump streams. (Used with load).
--parent-dir DIR
When loading, loads into a subdirectory of the target repository. (Used with load).
--strip-props ARG
Removes specific properties during loading. ARG can be 'all', 'rev', or 'dir-props'. (Used with load).
--clean-logs
Removes unused Berkeley DB log files from the repository. (Used with recover).
--ignore-uuid
When loading, ignores any UUID found in the dump stream, allowing the target repository's UUID to be preserved. (Used with load).
--force-uuid
Forces a new UUID to be assigned to the repository. (Used with setuuid).
--old-dumpfile PATH
Specifies an older dump file to compare against for delta generation. (Used with dump when creating an incremental dump).
DESCRIPTION
The svnadmin command is the primary tool for administrators to manage and maintain Subversion repositories directly. It operates on the repository's filesystem, making it essential for tasks that require direct manipulation rather than network access through clients or servers. Key functions include creating new repositories, verifying repository integrity, dumping repository contents to a portable stream, loading data from such streams, performing 'hot copies' for backups, and recovering from certain forms of corruption. Unlike the svn client commands that interact with the repository through a server, svnadmin works locally, demanding direct file system access and appropriate permissions. This direct access makes it a powerful but potentially dangerous tool if misused, as it can directly alter the repository's internal structure. Administrators often use svnadmin for initial setup, routine maintenance, migrations between servers, and disaster recovery planning.
CAVEATS
svnadmin requires direct filesystem access to the Subversion repository, meaning it must be run on the same machine where the repository data resides. It should generally not be run concurrently with other svnadmin commands, svnserve, or Apache (via mod_dav_svn) accessing the same repository, as this can lead to repository corruption. Always ensure proper backups before performing any major administrative tasks. When migrating repositories, be mindful of filesystem types (FSFS vs BDB) and Subversion client compatibility versions to avoid issues. Misuse of commands like setrevprop can permanently alter revision properties without history.
REPOSITORY BACKENDS
Subversion repositories can use one of two primary backend types: Berkeley DB (BDB) or FSFS. BDB was the original default but is now largely deprecated in favor of FSFS. FSFS repositories are simpler to manage, less prone to corruption from crashes, and easier to backup because they don't rely on a separate database engine. When creating a new repository, svnadmin defaults to FSFS, but the --fs-type option can be used to explicitly choose a backend. For new installations, FSFS is strongly recommended.
HOTCOPY VS. DUMP/LOAD
There are two main methods for backing up or migrating Subversion repositories: hotcopy and dump/load. svnadmin hotcopy creates an exact, byte-for-byte copy of a live repository, which is fast and preserves all repository metadata including UUIDs and hooks. It's ideal for regular backups. The svnadmin dump command generates a portable stream of repository data, which can then be read by svnadmin load into a new or existing repository. Dump/load is slower but allows for greater flexibility, such as filtering revisions or properties, changing repository filesystem types, or migrating to different server environments where a direct copy might not be feasible.
REPOSITORY HOOKS
Subversion repositories support 'hook' scripts that are executed automatically at specific points in the repository's lifecycle (e.g., pre-commit, post-commit, pre-revprop-change). While svnadmin operations generally trigger hooks, some subcommands (like load) can be instructed to bypass them using the --bypass-hooks option. This is often useful during migration or recovery to prevent unexpected behavior from custom scripts.
HISTORY
Subversion (SVN) was created in 2000 as a successor to CVS, aiming to provide a more robust and feature-rich version control system. svnadmin has been a fundamental part of the Subversion toolkit since its inception, providing the essential command-line interface for direct repository management. Over the years, its development has closely tracked that of Subversion itself, with enhancements supporting new features, improved performance, and better handling of repository backends, most notably the transition from Berkeley DB (BDB) to FSFS as the default and recommended filesystem type due to its simpler administration and better recovery characteristics. It continues to evolve with new Subversion releases, offering administrators the tools needed to maintain healthy repositories.
SEE ALSO
svn(1), svnserve(8), mod_dav_svn(8)


