tags:

views:

522

answers:

5

I have a networked repository that i used to checkout files to my local working directory. That works fine. What i would like to do now is to take either the repository or local version and push that to a new repository. How can i do that? I'm basically trying to get my repository copied out of my network and into an online svn (project locker). It's confusing to explain. I just want to temporarily point my local files to this online svn so i can push code out to there. Any suggestions

+1  A: 

If you're trying to push changes into a different location, then you may be trying to "relocate" the repository to a new URL. That is done by right clicking on the folder, choosing TortoiseSVN->Relocate.

Alternatively, if you're trying to create a NEW repository, you can just copy the folder, delete all of the .svn folders, and check in the entire directory to the new repository.

Reed Copsey
+2  A: 

You need to create a dump of your local repository, using svnadmin dump, and then upload the dump to the hosting facility in way so that you (or they) do svnadmin load. I don't think you can use Tortoise to produce the dump; you need the full svn installation.

Martin v. Löwis
+1  A: 

You might want to check out the SVN switch --relocate command.

Marcin Gil
relocate is used if repository has moved. he/she wants to move the contents of the repository
Stefan Egli
+1  A: 

I would go for the svnadmin dump solution unless you do not care about your history (then you just make check an export of your working copy). relocate etc does not do what you want (unless I understand you wrong)

Stefan Egli
+4  A: 

while you might be able to dump and load the repo into your hosted site, they may not give you access to a shell to load the dump into the new repository. You may be able to copy the repo directory but do not do this if you're changing platforms - eg going from a Windows to Linux host.

However, all this is not a problem - the easiest way is to use svnsync. Create a new repository (if it isn't already), then run:

svnsync init http://url/to/new/repo http://url/to/old/repo

You'll then need to set a pre-revprop-change hook to allow all changes (just 'exit 0' from the hook script)

Once that's done, just type:

svnsync --non-interactive sync http://url/to/new/repo

and it will replay each version from your current repository to the new one, so you end up with a perfect copy. You can interrupt the sync as you like, run it again and it will carry on from where it left off. (caveat: if you kill it with ctrl+c, you may need to remove the lock it uses. Type this to clear it)

svn propdel svn:sync-lock --revprop -r 0 http://url/to/new/repo

One big benefit is that you can use your existing repository as a backup afterwards, re-initialise the new repo to be the source and sync to your existing one, it'll replay all the latest commits as needed.

gbjbaanb
I think it's likely that a hosting facility will offer imports, as they can get new customers this way. Still, I like your approach better.
Martin v. Löwis
You never know with these host. Besides, I just like svnsync too much not to use it, it is brilliant.
gbjbaanb