0

We currently have CSVN installed on Windows Server, and I use TortoiseSVN client and AnkhSVN for Visual Studio on my Windows 10 machine.

The company is planning on decommissioning the Windows server.

I am now the only developer using SVN and I am permanently working from home. It therefore makes sense to move the repositories to my local machine (with suitable backup of course).

I believe TortoiseSVN can access repositories using file: instead of http:

Can I therefore simply copy the repository data folders from the file server onto my own machine, and reconfigure Tortoise to use these?

Will I also be able to do this with the AnkhSVN VS plugin?

Thanks

Phil.

Phil Preen
  • 589
  • 5
  • 20
  • Does this answer your question? [How to move an SVN repository to a new server](https://stackoverflow.com/questions/3789585/how-to-move-an-svn-repository-to-a-new-server) – Álvaro González May 22 '20 at 17:06
  • That's right. You need to ensure, though, that any software writing to repository files (typically the Subversion server) is shut down when files are copied so you don't get inconsistencies. I've linked a similar question, make sure you review all answers and not just the accepted one. – Álvaro González May 22 '20 at 17:06
  • Thanks I'll take a look. Am I right in assuming though that if I use the file:// protocol that I won't need to install a server on my machine? – Phil Preen May 22 '20 at 18:03
  • I can't speak for AnkhSVN but Subversion clients normally implement all three protocols (TortoiseSVN certainly does) and `file:` is more than enough for single-user local access. That's how I use it for most of my personal projects. In any case, repository files are exactly the same and you can switch and combine protocols to your liking. – Álvaro González May 23 '20 at 13:27

1 Answers1

1

Can I therefore simply copy the repository data folders from the file server onto my own machine, and reconfigure Tortoise to use these?

Yes, you can copy the repositories to your home workstation and use the local file:// protocol to access the repositories. Make sure that no one commits to the repositories when the copy is in progress.

Will I also be able to do this with the AnkhSVN VS plugin?

AnkhSVN supports the file:// protocol.

I assume that your current server is quite old. Subversion is a project of the Apache Software Foundation (ASF) since February 2010. But you call Subversion "CSVN" which stands for CollabNet Subversion, so I guess that your server (or even a client maybe) has some pre-2010 version. The latest versions are 1.10 (long-term support, LTS) and 1.13 (regular, short-term support).

As a Windows user, you may want to try VisualSVN Server at home. VisualSVN Server is built with the latest SVN 1.10 LTS and installs in a few clicks, see the Getting Started guide. The server has a modern admin interface (MMC console) and a repository web UI (see a demo at https://demo-server.visualsvn.com/!/#asf/view/head/subversion/trunk). The server has all the must-have repository admin features such as backups, scheduled verification, GUI-based permission management, etc. packed in a user-friendly GUI, and a PowerShell module for admin tasks scripting and automation.

After you move your repositories, besides planning backups, it makes sense to perform some additional maintenance:

bahrep
  • 29,961
  • 12
  • 103
  • 150
  • Thanks for the detailed response. I will check out all of your links, but as I am now going to be only person using it (and have been for several years now) I don't think I need a server solution, so the file:// solution should suffice. I was just wanting to check that I could simply copy the files, and that I wouldn't need to convert or migrate them. – Phil Preen May 22 '20 at 17:45
  • Just checked the server and it is running Subversion Edge release 5.10 which says (c)2015. We have been using it for a lot longer than that though, and has probably been upgraded numerous times in the past. – Phil Preen May 22 '20 at 17:53
  • I have copied the files onto my local machine, and used relocate with Tortoise SVN and this seemed to work, as I can view the revision history. However I am getting an error when I commit. This looks like the same issue we had a few years ago when we moved from one server to another. https://stackoverflow.com/questions/34157204/cannot-commit-to-svn-after-moving-subversion-edge-to-new-server However the same solution obviously won't work as I don't have CSVN on my local PC. Any suggestions? Should I start a new question? – Phil Preen Jun 02 '20 at 11:33
  • Commit blocked by pre-commit hook (exit code 255) with output: The system cannot find the path specified. If you want to break the lock, use the 'Check For Modifications' dialog or the repository browser. – Phil Preen Jun 02 '20 at 12:57
  • @PhilPreen there is a custom admin-configured pre-commit hook in your repository. E.g., in `C:\Repositories\MyRepo\hooks\pre-commit.bat`. Fix the code of your hook script or remove and commits will work. The problem is that the hook's code tries to access some file that does not exist on your computer now. – bahrep Jun 02 '20 at 12:59
  • Thanks yes. The pre-commit.cmd file contains the following command: "C:\program files\csvn\bin\svnlook" log %REPOS% -t %TXN% – Phil Preen Jun 02 '20 at 13:01
  • This is apparently checking for a commit with no log message. – Phil Preen Jun 02 '20 at 13:02
  • @PhilPreen then adjust the code to point to `svnlook.exe` that exists on your machine. – bahrep Jun 02 '20 at 13:03
  • I'm just doing a search for this. Will it be in the Tortoise SVN program files? – Phil Preen Jun 02 '20 at 13:05
  • @PhilPreen yes, but installing SVN's command-line tools is optional in TortoiseSVN, so they can be missing in its directory. See this https://stackoverflow.com/a/15686341/761095 – bahrep Jun 02 '20 at 13:09
  • Thanks. I tried the Modify option, but it couldn't find the original msi, so I'm going to download install the latest version of Tortoise. Thanks for your help. – Phil Preen Jun 02 '20 at 13:22
  • OK. I installed the latest version of Tortiose including command line tools, and amended the pre-commit.cmd file with the path to svnlook.exe. I now get a different error message: svnlook: E720053: Can't open file '\\c:\Users\phil.XXX\OneDrive - XXXXX\SVN\Phil\format': The network path was not found. The format file does exist in that location – Phil Preen Jun 02 '20 at 13:48
  • @PhilPreen that's still a problem with a custom hook script. it tries to access some path that does not exist on your system or is inaccessible. – bahrep Jun 02 '20 at 13:56
  • I am guessing that the svnlook program doesn't like the \\ at the start of the repo path. Perhaps the format of the url I used when I did the relocate is not correct? I have my normal Windows path name with all the \ changed to / and preceded by file://./ – Phil Preen Jun 02 '20 at 14:11
  • @PhilPreen svnlook accepts normal Windows paths such as C:\Repositories\MyRepository – bahrep Jun 02 '20 at 14:12
  • Yes I have verified by calling it from the command line, but how can I get Tortoise to send the correct path to the pre-commit .cmd file? – Phil Preen Jun 02 '20 at 14:29
  • @PhilPreen I suggest that you ask a new question. Show the code of your hook script, all the errors you receive and the commands you execute. – bahrep Jun 02 '20 at 14:30
  • OK. Huge thanks for your help. I have got it working by doing the relocate again, and this time using file:\\localhost\Users\ instead of file://./C:/Users/ I think that only works because I have the Users folder shared though which is not ideal. – Phil Preen Jun 02 '20 at 14:43