简体   繁体   English

如何从备份中还原SVN存储库?

[英]How do I restore an SVN repository from a backup?

We've got a Windows 2003 server, with Subversion (specifically SlikSVN) installed. 我们有一个Windows 2003服务器,安装了Subversion(特别是SlikSVN)。 The svnserve.exe process is setup to run as a Windows Service. svnserve.exe进程被设置为作为Windows服务运行。

The server has got 2 hard drives, one for the OS (C: drive), and one for data (D: drive). 该服务器有2个硬盘驱动器,一个用于OS(C:驱动器),另一个用于数据(D:驱动器)。 Our SVN repository was located at D:\\SVN, but the D: drive crashed recently, and no longer starts up. 我们的SVN存储库位于D:\\ SVN,但是D:驱动器最近崩溃了,并且不再启动。 The SVN Windows Service also refuses to start up (presumably because it can't locate the repository). SVN Windows服务也拒绝启动(大概是因为它无法找到存储库)。

Fortunately though we have backups of the repository (backed up to to an external drive via XCOPY every night), and we now need to restore the latest backup to the C: drive at C:\\SVN. 幸运的是,尽管我们有存储库的备份(每天晚上通过XCOPY备份到外部驱动器),现在我们需要将最新的备份还原到C:\\ SVN的C:驱动器。

How do I go about doing this? 我该怎么做呢? Can someone please provide me with a detailed explanation. 有人可以给我提供详细的解释。 All I need to do is restore the latest repository backup to a different location (in this case C:\\SVN) on the same server. 我需要做的就是将最新的存储库备份还原到同一服务器上的其他位置(在本例中为C:\\ SVN)。

What are the command line commands that I need to run. 我需要运行哪些命令行命令。 Do I need to unmap the D:\\SVN location? 我是否需要取消映射D:\\ SVN位置?

The proper way to backup a Subversion repository is the svnadmin hotcopy command. 备份Subversion存储库的正确方法是svnadmin hotcopy命令。 In such case: 在这种情况下:

The resultant backup is a fully functional Subversion repository, able to be dropped in as a replacement for your live repository should something go horribly wrong. 最终的备份是一个功能齐全的Subversion存储库,如果出现严重错误,可以将其替换为实时存储库的替代品。

http://svnbook.red-bean.com/nightly/en/svn.reposadmin.maint.html#svn.reposadmin.maint.backup http://svnbook.red-bean.com/nightly/en/svn.reposadmin.maint.html#svn.reposadmin.maint.backup

You say that you just copied the files somewhere else. 您说您只是将文件复制到其他地方。 I suggest you just try and copy them back. 我建议您尝试将其复制回去。 I recommend you run svnadmin verify afterwards. 我建议您随后运行svnadmin verify

I'm not familiar with svnserve.exe but, given it's a Windows service, you can always change its parameters pointing regedit at: 我对svnserve.exe并不熟悉,但是,由于它是Windows服务,因此您始终可以将其参数指向regedit进行更改:

HKLM\SYSTEM\CurrentControlSet\Services\snvserve\Parameters

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM