1

I have a subversion repository with content in it and I want svnsync it to a remote server. The issue is I am getting an error message saying svnsync: Cannot initialize a repository with content in it when try to initialize svnsync.

svnsync init file:///var/www/svn/project_z/ http://svn.mysvn.com/svn/project_z/

How do I svnsync a repository with content in them?

Chamara Keragala
  • 5,627
  • 10
  • 40
  • 58

3 Answers3

0

consider using --allow-non-empty if the repository's revisions are known to mirror their respective revisions in the source repository

devman
  • 1
0

svnsync doesn't push a repository to a server, it pulls it from a remote server. In other words, you need to start the svnsync process from your destination server

In other words, from the destination server:

svnadmin create /path/to/empty/destination/directory/
svnsync init --username some_username --password some_password file:///path/to/empty/destination/directory http://svn.mysvn.com/svn/project_z/
svnsync sync --username some_username --password some_password file:///path/to/empty/destination/directory

Of course, if there is no authentication on the source repository, then you may not need the username and password parameters.

codewario
  • 19,553
  • 20
  • 90
  • 159
-1

If file:///var/www/svn/project is your source and http://svn.mysvn.com/svn/project_z/ is your destination then you're giving the repositories backwards to how the svnsync init command expects them.

From svnsync help init:

initialize (init): usage: svnsync initialize DEST_URL SOURCE_URL

Most people are used to the ordering of commands being source then destination so it's a common mistake, I make it sometimes myself.

Ben Reser
  • 5,695
  • 1
  • 21
  • 29