How to Completely Remove/Delete a Subversion (SVN) Repository from Filesystem


4 views

When you create an SVN repository using svnadmin create, it generates a directory structure containing versioned data, configuration files, and database files. Unlike some version control systems, SVN doesn't provide a dedicated svnadmin delete command - the removal process is handled at the filesystem level.

To completely remove a repository, simply delete its directory and all contents:

rm -rf /path/to/repository

For Windows systems using Command Prompt:

rmdir /s /q C:\path\to\repository
  • Ensure no active SVN operations are running against the repository
  • Verify the repository isn't being served by svnserve or Apache
  • Consider backing up important data first (use svnadmin dump if needed)

For safety, you might want to move rather than immediately delete:

mv /path/to/repository /path/to/backup_location

If the repository was being served, remember to:

  1. Remove the repository entry from svnserve.conf
  2. Update Apache's httpd.conf if using mod_dav_svn
  3. Restart the relevant services

Unlike svnadmin create, there's no dedicated svnadmin delete command because Subversion treats repositories as regular filesystem directories. Here's the technical reality:

# Dangerous but effective
rm -rf /path/to/repository

Before nuking your repo:

  1. Ensure no active svnserve or Apache processes are accessing it
  2. Back up any critical data with svnadmin dump
  3. Verify the path twice - recursive deletes are irreversible

On Windows systems:

# Using Command Prompt
rd /s /q C:\path\to\repository

# Using PowerShell
Remove-Item -Recurse -Force C:\path\to\repository

For systems with multiple users:

# More controlled deletion
mv /path/to/repository /path/to/repository_old
chmod -R 000 /path/to/repository_old
# Wait for verification before final rm -rf

If you just need to clean rather than delete:

# Remove transaction locks
svnadmin cleanup /path/to/repository

# Verify repository integrity
svnadmin verify /path/to/repository