很多时间过去了,现在我解决了我的问题。
我遵循了本教程:
http ://www.aharmony.com/software-sagacity/2014/07/recovering-from-a-missing-svn-revision/
第一个转储必须没有 --incremental 和 --delta 选项。将其加载到新的 SVN 服务器。
其余的我写了一个 VBS 脚本。
call dumpRevs(0, 80000)
使用dumpRevs我将旧的存储库转储到其他地方(并记录它)。VBS 在旧的 SVN 服务器上启动。
call loadDump(newRepoPath, 0, 80000)
使用loadDump,我将转储的转速加载到新的仓库中。损坏的修订被虚拟提交替换。VBS 在新的 SVN 服务器上启动
最后,新仓库中可能会丢失文件。因此,我将它们相互匹配。为此,我检查两个存储库并将差异转移到新存储库并进行最终提交(不要忘记在旧存储库的同一修订版上进行虚拟提交,以便仍然可以转储和加载新签入) .
call updateRepos(https:\\oldSVNServer\oldRepo\projektA, projektA)
我使用updateRepos来检查我的存储库(大存储库..)。
我的脚本应该只是一个如何制作的想法。[]之间的所有内容都必须设置。
Function dumpRevs(revStart, revEnd)
Set oShell = CreateObject("WSCript.shell")
Dim rev, dumpCommand
rev = revStart
while rev <= revEnd
dumpCommand = "cmd.exe /C svnadmin dump [old Repo Folder] -r " & rev & " --incremental --deltas > [dump Folder]" & rev
oShell.run dumpCommand, 1, True
rev = rev + 1
wend
End Function
Function loadDump(repoPath, revStart, revEnd)
Set oShell = CreateObject("WSCript.shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Dim rev, dumpCommand, dumpFilesPath, logPath, dummyRev
dummyRev = "cmd.exe /C svnmucc propset dummy_prop 0 -m ""increases revision"" [new Repo URL] --username admin --password admin"
rev = revStart
while rev <= revEnd
dumpFilesPath = "[dumpFolder]" & rev
logPath = "[logFolder]" & rev & ".log"
loadCommand = "cmd.exe /C svnadmin load " & repoPath &" < " & dumpFilesPath & " > " & logPath & " 2>&1"
oShell.run loadCommand, 1, True
If fileContains(logPath, "Committed revision "& rev & "") = false Then
oShell.run dummyRev, 1, True
End If
rev = rev + 1
wend
End Function
Function updateRepos(repoPath, name)
Set oShell = CreateObject("WSCript.shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Dim logPath, uptodate, upCommand, cleanCommand, nr
uptodate = false
nr = 1
Do
logPath = "C:\Temp\up_" & name & nr & ".log"
upCommand = "cmd.exe /C svn up --username admin --password admin --non-interactive " & repoPath & " > " & logPath & " 2>&1"
cleanCommand = "cmd.exe /C svn cleanup --username admin --password admin --non-interactive " & repoPath & " > " & logPath & " 2>&1 & ECHO cleanup >>" & logPath
oShell.run upCommand, 1, True
If fileContains(logPath, "is already locked") =true Or fileIsEmpty(logPath) =true Then
oShell.run cleanCommand, 1, True
ElseIf (fileContains(logPath, "Request Entity Too Large") = true) Or (fileContains(logPath, "out of memory") = true) Or (fileContains(logPath, "Caught signal") = true) Or (fileContains(logPath, "At revision") = true) Or (fileContains(logPath, "The XML response contains invalid XML") = true) Then
Exit Function
End If
nr = nr + 1
Loop While fileContains(logPath, "Updated to revision") <> true
End Function
Function fileContains(filePath, str)
Set objFSO = CreateObject("Scripting.FileSystemObject")
Dim tempStr
Set objInputFile = objFSO.OpenTextFile(filePath, 1, False)
Do until objInputFile.AtEndOfStream
tmpStr = objInputFile.ReadLine
If InStr(tmpStr, str) > 0 Then
fileContains = true
Exit Function
End If
Loop
fileContains = false
End Function
Function fileIsEmpty(filePath)
Set objFSO = CreateObject("Scripting.FileSystemObject")
Dim size
Set ofile = objFSO.getfile(filePath)
size = ofile.size
If size < 30 Then
fileIsEmpty = true
Exit Function
End If
fileIsEmpty = false
End Function