Visual SVN 多存储库备份

发布于 2024-09-16 01:52:39 字数 868 浏览 12 评论 0原文

几个月前,我们的 VisualSVN Server 存储库被创建,多个存储库存在于单个根下,结构如下所示:

存储库位于 C:\Repositories\root

root
-branches
-tags
-trunk
--repo1
---folder1
---folder2
--repo2
---folder1
---folder2

我能够迭代 repo1,使用 svn list 命令(svn list file:///c:/Repositories/root/trunk/repo1)创建 repo2 文件夹现在我想备份 repo1 和 repo2。

我可以在根级别进行备份,但备份文件大小太大,希望在存储库级别进行备份。

我尝试使用 svnadmin dump file:///c:/Repositories/root/trunk/repo1 > D:\repo1-backup.db

抛出错误,指出“svnadmin: file:///c:/Repositories/root/trunk/repo1”是一个 URL,而它应该是一个 URL小路”。错误是有道理的,因为我使用了 URL 而不是文件系统路径。

我通过帮助发现我可以使用,还没有尝试!

1)备份整个根目录 svnadmin dump C:\Repositories\root > >存储库转储文件 2)使用svndumpfilter包含repo1 svndumpfilter 包含 repo1 <存储库转储文件> repo1-dumpfile

我担心步骤 1,它会导致我的磁盘上出现巨大的文件。想知道是否有其他方法来备份我的存储库。

Few months ago our VisualSVN Server repositories got created, multiple repositories are exists under a single root, the structure looks as below:

Repository is located at C:\Repositories\root

root
-branches
-tags
-trunk
--repo1
---folder1
---folder2
--repo2
---folder1
---folder2

I was able to iterate thru repo1, repo2 folders using svn list commands (svn list file:///c:/Repositories/root/trunk/repo1) now I would like to back up repo1 and repo2.

I could do backup at root level, whereas backup file size is too large, would like to backup at repositories level.

I tried to use as svnadmin dump file:///c:/Repositories/root/trunk/repo1 > D:\repo1-backup.db

throws an error saying "svnadmin: file:///c:/Repositories/root/trunk/repo1' is an URL when it should be a path". Error makes sense that I used URL instead of file system paths.

I went thru help and found that I can use, have not tried yet!

1) backup the entire root
svnadmin dump C:\Repositories\root > repos-dumpfile
2) use svndumpfilter to include repo1
svndumpfilter include repo1 < repos-dumpfile > repo1-dumpfile

I worry about step1, it leads to huge file on my disk. Would like to know is there any other way to backup my repositories.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

深海蓝天 2024-09-23 01:52:39

据我所知,无法使用 svndump 从存储库中获取单个路径。

我认为您确实必须对整个事情进行转储,然后确实对其使用 svndumpfilter 。

As far as I know, there is no way to use svndump to fetch a single path from a repository.

I think you'll have indeed to do a dump of the whole thing, and then indeed use svndumpfilter on it.

偷得浮生 2024-09-23 01:52:39

你的存储库结构非常奇怪。
通常,repo1 和 repo2 是单独的顶级存储库,其中包含每个分支、标签和主干。

但您知道,如果您使用 fsfs 作为数据库结构,您可以逐个文件备份进行增量文件备份,并且每次只备份较新的文件。

You have very strange repository structure.
Typically repo1 and repo2 would be separate top level repositores with each branches, tags and trunk inside them.

But you know that if you have fsfs as database structure you can do an incremental file by file backup and only backup newer files each time.

下壹個目標 2024-09-23 01:52:39

SVNAdmin可以单独备份每个存储库。如果您有多个存储库,则必须单独备份。您可以编写一个脚本(例如Windows中的bat、vbs)来自动备份所有存储库。
对于备份repo1,请使用以下命令:

svnadmin.exe dump c:\Repositories\root\trunk\repo1 >  D:\repo1-backup.bak

对于多个存储库,请使用以下脚本:
转储库.bat

cd c:\Repositories\root\trunk\
dir /A:D /B> dirs.tmp
FOR /F %%i IN (dirs.tmp) DO (
 "svnadmin.exe" dump %%i > %%i.svn
)

SVNAdmin can backup each repository separately. If you have several repository you have to backup separately. You can write a script (for example bat, vbs in windows ) that backup all repositories automatically.
for backup repo1 use below command:

svnadmin.exe dump c:\Repositories\root\trunk\repo1 >  D:\repo1-backup.bak

for multiple repository use below script:
dump_repos.bat

cd c:\Repositories\root\trunk\
dir /A:D /B> dirs.tmp
FOR /F %%i IN (dirs.tmp) DO (
 "svnadmin.exe" dump %%i > %%i.svn
)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文