How do I migrate an SVN repository to another SVN

2019-01-16 05:19发布

Is there a simple way to copy a directory from one repository into another repository with copying all of the history?

9条回答
萌系小妹纸
2楼-- · 2019-01-16 05:47

You can create a dump file using svnadmin dump, then import to a new repository with svnadmin load.

查看更多
劫难
3楼-- · 2019-01-16 05:49

The simplest way is using:

svnadmin dump path/to/repos > repos.out

This will create a portable format for your repository (with history) in the file repos.out. You can then use

svnadmin load path/to/newrepos < repos.out

to load your 'dumped' repository to the new or existing one.

Chapter 5. Repository Maintenance -> Migrating Repository Data Elsewhere has this note about using svnadmin dump as of version 1.7:

The Subversion repository dump format describes versioned repository changes only. It will not carry any information about uncommitted transactions, user locks on filesystem paths, repository or server configuration customizations (including hook scripts), and so on.

查看更多
爷、活的狠高调
4楼-- · 2019-01-16 05:50

I think it should be stated that the dump file created by utilizing

    svnadmin dump path/to/repos > dumpfile

can be created (from svn 1.7 and forth) using the command

   svnrdump dump url_to_repos > dumpfile

This is useful when done from a remote computer and not the server.

查看更多
放荡不羁爱自由
5楼-- · 2019-01-16 05:53

If you don't want history, you can use svn export to get a clean folder without the .svn folders and then svn import into your other repository.

With history, you would need to use the svnadmin dump. You would then use svndumpfilter to filter for only the parts or paths you want to use before using svnadmin load.

Topics to read:

查看更多
时光不老,我们不散
6楼-- · 2019-01-16 05:54

In case this helps others, there is svn2svn to replay changesets from one Subversion repository to another:

https://github.com/tonyduckles/svn2svn

查看更多
我想做一个坏孩纸
7楼-- · 2019-01-16 05:58

In Subversion version 1.7 there is a new command, svnrdump which can be used to access a remote repository and generate the same dump format output as is generated by the svnadmin dump command. This allows you to use svnrdump with svnadmin load to transfer a Subversion repository.

See svnrdump—Remote Subversion Repository Data Migration which has an explanation of the new command.

In Chapter 5 of the red book, the section Migrating Repository Data Elsewhere has a sub-section Repository data migration using svnrdump that mentions:

The primary difference [between svnrdump and svnadmin dump] is that instead of requiring direct access to the repository, svnrdump operates remotely, using the very same Repository Access (RA) protocols that the Subversion client does. As such, you might need to provide authentication credentials. Also, your remote interations [sic] are subject to any authorization limitations configured on the Subversion server.

I would also assume that the limitations of svnadmin dump concerning server configuration customizations such as hooks may not be transferred would also apply to svnrdump.

查看更多
登录 后发表回答