#svn #archive

I use Subversion (SVN) as my version control software for all of my Android development. Although a powerful tool, it is not always obvious how to achieve the goal I want. Here are some Tasks I have needed complete using SVN, and how I went about doing so.

NOTE: For all of the following instructions, assume we are working in the user's home directory.

Moving repo A to a server

  1. Dump the repo A

     svnadmin dump A a.dmp
  2. Copy the dump to the server.

     scp a.dmp username@ssh.server:path:to:file

In my example, I use scp, however you can use FTP, or any other means of getting the a.dmp file to the server.

  1. Connect to the server

    ssh username@ssh.server

    You will likely be prompted for your password.

  2. Create the new repository on the server.

    svnadmin create NewRepo
  3. Load a.dmp into the new repo.

    svnadmin load NewRepo < a

What if you want to create a new repo, that acts as a parent for your already existing repos?

Moving repo A, and repo B into a new parent repo C

  1. Create the new repository
    svnadmin create C
  2. Create A and B directories within the newly created repository
    svn mkdir file:///path/to/home/dir/A -m "Adding A directory"
    svn mkdir file:///path/to/home/dir/B -m "Adding B directory"
  3. Create dumps of repo A, and repo B
    svnadmin dump A     a.dmp"
    svnadmin dump B     b.dmp
  4. Load these dumps into the subdirectories of repo C
    svnadmin load C/ -parent-dir A < a.dmp
    svnadmin load C/ -parent-dir B < b.dmp