1. Summary
  2. Files
  3. Support
  4. Report Spam
  5. Create account
  6. Log in
Version 21 (modified by jwigglesworth, 5 years ago)

--

Managing your Subversion Repository with adminrepo

While most changes to a SCM repository are made through client software on your workstation, most repositories have a certain set of operations which must be performed through direct filesystem manipulation on the server. To meet these needs for direct repository modification, SourceForge.net provides the adminrepo tool as part of our shell service. adminrepo may be used to perform common tasks, such as permanently removing files or modules that were incorrectly checked in. Many tasks, such as locking files or setting properties, can be accomplished from your subversion client, and do not require the use of adminrepo.

Before you start

NOTE: Before performing ANY action with adminrepo:

  1. Consult with your Project Team; ensure all developers are aware of the changes you are making to the repository. Direct repository changes can result in lost data and lost time for your developers if done improperly.
  2. Make a backup of your repository. The backups maintained by SourceForge.net are used only when there is a catastrophic server failure. If you break your repository using adminrepo, we won't restore the data. You need to be prepared to restore data using a backup you are making now.

rsync may be used to make a backup of your repository. For example (replace PROJECTNAME with the UNIX group name of your project):

rsync -av PROJECTNAME.svn.sourceforge.net::svn/PROJECTNAME/* .

Executing adminrepo

  1. Connect to our Shell service and run the sf-help command. This will provide you with information you may need later.
  2. Execute the following command to clone a copy of your repository to /svnroot/PROJECT: adminrepo --checkout svn
  3. Change to the /svnroot/PROJECT directory and manipulate the repository as needed.
  4. The repository will be locked and read-only until you either:
    1. Finalize your changes by executing: adminrepo --save
    2. Cancel your changes by executing: adminrepo --discard

Resetting a repo (starting from scratch)

  1. Discuss your proposed changes with your Project Team.
  2. Backup your your current Subversion repository.
  3. Connect to our Shell service
  4. adminrepo --checkout svn will create a clone copy of your repository in /svnroot/PROJECT.
    • Use adminrepo --help for further information.
  5. Create a new repository:
    • Remove the clone copy of your repo with rm -rf /svnroot/PROJECT/*. Be very careful with this.
    • Create a new repository with svnadmin create
  6. Use svnadmin load /svnroot/PROJECT < svndump to load your changes into the repository.
  7. Save your changes using adminrepo --save.

Removing (obliterating) a file or module

  1. Discuss your proposed changes with your Project Team.
  2. Backup your your current Subversion repository.
  3. Connect to our Shell service
  4. adminrepo --checkout svn will create a clone copy of your repository in /svnroot/PROJECT.
    • Use adminrepo --help for further information.
  5. Create a dump file of your repository with svnadmin dump /svnroot/PROJECT/ > svndump
  6. Use svndumpfilter to make your desired changes, eg. removing a file.
  7. Create a new repository to load the changes from your dump file into:
    • Remove the clone copy of your repo with rm -rf /svnroot/PROJECT/*. Be very careful with this.
    • Create a new repository with svnadmin create
  8. Use svnadmin load /svnroot/PROJECT < svndump to load your changes into the repository.
  9. Save your changes using adminrepo --save.

Importing from other repos (including other SCMs)

Creating a dump file

Subversion allows you to create backups and imports via dump files. You can create a dump file in a variety of ways, such as dumping an existing Subversion repository, or using a repository conversion tool, such as cvs2svn.

Creating a dump file from another SVN repo

  1. Discuss your proposed changes with your Project Team.
  2. Use svnadmin dump /PATH/TO/REPO > svndump to create a dump file named "svndump".
  3. It is a good idea to compress the resulting dump file, to save space. We support zip, bzip2, and gzip compression (do not tar it).

Using cvs2svn to create a SVN dump file from CVS content

If you have an existing CVS repository that you would like to convert to Subversion, follow these instructions:

  1. Discuss your proposed changes with your Project Team.
  2. Download and install a copy of cvs2svn.
  3. Get a copy of the RCS files for the CVS repository. For SourceForge.net-hosted CVS repositories, this can be done via rsync. For projects hosted elsewhere, you may need to contact the repository administrator for a copy of the files.
  4. Convert the repository to a Subversion dump file using cvs2svn:
    • Go to the directory at the root of the CVS repository
    • Run the command: cvs2svn --dumpfile=svndump .
  5. If the conversion generates an error message, follow the prompts that indicate what the problem is, and attempt to resolve them using one of the various options for cvs2svn (--trunk-only will drop all branches and tags, which will usually make the process painless if all you need is the trunk).
  6. It is a good idea to compress the resulting dump file, to save space. We support zip, bzip2, and gzip compression (do not tar it).
  7. Follow the instructions for importing a Subversion dump file to finish the import.

Filtering the dump file (optional)

You can remove files, modules, or revisions from the dump file using svndumpfilter. It is important to make sure you do this before the import; data cannot be readily removed from a Subversion repository after being imported, unless you do another, filtered import in the future.

Importing the dump file

  1. Discuss your proposed changes with your Project Team.
  2. Backup your your current Subversion repository.
  3. Make sure that the name of the dump file only contains alphanumeric characters and a period (Example: svndump.gz is good, but projectname-svndump.gz is bad, due to the dash).
  4. Connect to our Shell service and run the sf-help command. This will provide you with the information necessary to upload your dump file.
  5. Upload the dump file to the interactive shell.
  6. adminrepo --checkout svn will copy your repository to /svnroot/PROJECT so you can work with it from there.
    • Use adminrepo --help for further information.
  7. Decompress your dump file (e.g. gzip -d svndump.gz)
  8. To completely replace your current repo, follow the sub-steps listed here. Otherwise, skip this step.
    • First remove your the clone copy of your current repo with rm -rf /svnroot/PROJECT/*
    • Create a new repo with svnadmin create /svnroot/PROJECT/
    • Proceed to the next step.
  9. Use svnadmin load /svnroot/PROJECT < svndump to insert your dump file into your current repository.
  10. Save your changes using adminrepo --save.

Getting Help