«

»

Nov
16

Subversion: Migrating Subfolders

Original (source) repository structure:

/
  /libraries
  /projects
    /windows
    ...
  ...

Target repository structure:

/
  /libraries
  /windows

Commands

Create new (target repository) and dump source repository:

svnadmin create target
svnadmin dump source > repo.svn

Select folders and move subfolder to root level:

svndumpfilter include libraries projects/windows < repo.svn > repo_filtered.svn
replace "Node-path: projects/" "Node-path: " < repo_filtered.svn > repo_filtered_replaced.svn

Load into new (target) repository:

svnadmin load target < repo_filtered_replaced.svn