前段時間公司SA離職,主動申請了一部分工作是關於SVN維護的,新的SA來了,馬上要交接,小小總結一下這段時間的SVN Management Experience。
NOTE:如何創建SVN 版本庫就不贅述了, 不會Google。
以下是一些日創管理時遇到的issue 和 備份和鏡像的恢復。
repo_local_path: file:///e:/svn/7thOnline
I Dairy Schedule
1 sync with main server manaully
svnsync sync repo_local_path
NOTE:
Issue 3:locked
C:\Documents and Settings\ntadmin>svnsync sync repo_local_path
Failed to get lock on destination repos, currently held by 'Utility01:c8d0ab56-e
4f5-7244-a8a6-ba639e98254e'
Failed to get lock on destination repos, currently held by 'Utility01:c8d0ab56-e
4f5-7244-a8a6-ba639e98254e'
Failed to get lock on destination repos, currently held by 'Utility01:c8d0ab56-e
4f5-7244-a8a6-ba639e98254e'
Failed to get lock on destination repos, currently held by 'Utility01:c8d0ab56-e
4f5-7244-a8a6-ba639e98254e'
Failed to get lock on destination repos, currently held by 'Utility01:c8d0ab56-e
4f5-7244-a8a6-ba639e98254e'
Failed to get lock on destination repos, currently held by 'Utility01:c8d0ab56-e
4f5-7244-a8a6-ba639e98254e'
Failed to get lock on destination repos, currently held by 'Utility01:c8d0ab56-e
4f5-7244-a8a6-ba639e98254e'
Failed to get lock on destination repos, currently held by 'Utility01:c8d0ab56-e
4f5-7244-a8a6-ba639e98254e'
Failed to get lock on destination repos, currently held by 'Utility01:c8d0ab56-e
4f5-7244-a8a6-ba639e98254e'
Failed to get lock on destination repos, currently held by 'Utility01:c8d0ab56-e
4f5-7244-a8a6-ba639e98254e'
svnsync: Couldn't get lock on destination repos after 10 attempts
Solution: unlock
svn propdel svn:sync-lock --revprop -r 0 repo_local_path
II: Recovery
如果有幾個main svn server 的鏡像 一個鏡像無法同步了,我們可以通過物理拷貝 其他正常鏡像的相關文件 去恢復此鏡像。 如果只有一個鏡像,就不能通過這種方式恢復此鏡像。(不得已使用)
copy_svn.bat: (至於某倉庫root path)
mkdir dst
copy db\current dst\
mkdir dst\revprops
copy db\revprops\0 dst\revprops
copy db\revprops\46989 dst\revprops
mkdir dst\revs
copy db\revs\0 dst\revs
copy db\revs\46989 dst\revs
Dump / Load Steps:
1 dump from the mian svn server or other mirror svn server (Eg:from version A to version B )
2 dos: go to repro root path
D:\svn>
3 D:\svn> svnadmin load 7thOnline <d:\svn_backup\46988.dmp
4 update 0 version file
NOTE:
Issue 1
D:\svn>svnadmin load 7thOnline <d:\svn_backup\46988.dmp
<<< Started new transaction, based on original revision 46988
* editing path : 2012Q2-GA5.4.1 GRI/JavaDev/cmm/data/ADDataParser.java ...
done.
------- Committed new rev 46998 (loaded from original rev 46988) >>>
<<< Started new transaction, based on original revision 46989
* editing path : 2012Q2-GA5.4.1 GRI/JavaDev/cmm/applet/builder/OTBSheetBuil
der.java ... done.
* editing path : 2012Q2-GA5.4.1 GRI/JavaDev/cmm/data/CMMDataParser.java ...
done.
* adding path : 2012Q2-GA5.4.1 GRI/JavaDev/cmm/data/RatioCalculator.java ..
.svnadmin: File already exists: filesystem '7thOnline/db', transaction '46998-1'
, path '2012Q2-GA5.4.1 GRI/JavaDev/cmm/data/RatioCalculator.java'
Solution:
remove related version file
change 0 and current info to keep current version to be dump start version - 1 (here is 46987).
Issue2:
C:\Documents and Settings\ntadmin>svnsync sync repo_local_path
svnsync: Revision being currently copied (47009), last merged revision (47008),
he destination without using svnsync?
Solution:
update 0 version file
NOTE:如何創建SVN 版本庫就不贅述了, 不會Google。
以下是一些日創管理時遇到的issue 和 備份和鏡像的恢復。
repo_local_path: file:///e:/svn/7thOnline
I Dairy Schedule
1 sync with main server manaully
svnsync sync repo_local_path
NOTE:
Issue 3:locked
C:\Documents and Settings\ntadmin>svnsync sync repo_local_path
Failed to get lock on destination repos, currently held by 'Utility01:c8d0ab56-e
4f5-7244-a8a6-ba639e98254e'
Failed to get lock on destination repos, currently held by 'Utility01:c8d0ab56-e
4f5-7244-a8a6-ba639e98254e'
Failed to get lock on destination repos, currently held by 'Utility01:c8d0ab56-e
4f5-7244-a8a6-ba639e98254e'
Failed to get lock on destination repos, currently held by 'Utility01:c8d0ab56-e
4f5-7244-a8a6-ba639e98254e'
Failed to get lock on destination repos, currently held by 'Utility01:c8d0ab56-e
4f5-7244-a8a6-ba639e98254e'
Failed to get lock on destination repos, currently held by 'Utility01:c8d0ab56-e
4f5-7244-a8a6-ba639e98254e'
Failed to get lock on destination repos, currently held by 'Utility01:c8d0ab56-e
4f5-7244-a8a6-ba639e98254e'
Failed to get lock on destination repos, currently held by 'Utility01:c8d0ab56-e
4f5-7244-a8a6-ba639e98254e'
Failed to get lock on destination repos, currently held by 'Utility01:c8d0ab56-e
4f5-7244-a8a6-ba639e98254e'
Failed to get lock on destination repos, currently held by 'Utility01:c8d0ab56-e
4f5-7244-a8a6-ba639e98254e'
svnsync: Couldn't get lock on destination repos after 10 attempts
Solution: unlock
svn propdel svn:sync-lock --revprop -r 0 repo_local_path
II: Recovery
如果有幾個main svn server 的鏡像 一個鏡像無法同步了,我們可以通過物理拷貝 其他正常鏡像的相關文件 去恢復此鏡像。 如果只有一個鏡像,就不能通過這種方式恢復此鏡像。(不得已使用)
copy_svn.bat: (至於某倉庫root path)
mkdir dst
copy db\current dst\
mkdir dst\revprops
copy db\revprops\0 dst\revprops
copy db\revprops\46989 dst\revprops
mkdir dst\revs
copy db\revs\0 dst\revs
copy db\revs\46989 dst\revs
Dump / Load Steps:
1 dump from the mian svn server or other mirror svn server (Eg:from version A to version B )
2 dos: go to repro root path
D:\svn>
3 D:\svn> svnadmin load 7thOnline <d:\svn_backup\46988.dmp
4 update 0 version file
NOTE:
Issue 1
D:\svn>svnadmin load 7thOnline <d:\svn_backup\46988.dmp
<<< Started new transaction, based on original revision 46988
* editing path : 2012Q2-GA5.4.1 GRI/JavaDev/cmm/data/ADDataParser.java ...
done.
------- Committed new rev 46998 (loaded from original rev 46988) >>>
<<< Started new transaction, based on original revision 46989
* editing path : 2012Q2-GA5.4.1 GRI/JavaDev/cmm/applet/builder/OTBSheetBuil
der.java ... done.
* editing path : 2012Q2-GA5.4.1 GRI/JavaDev/cmm/data/CMMDataParser.java ...
done.
* adding path : 2012Q2-GA5.4.1 GRI/JavaDev/cmm/data/RatioCalculator.java ..
.svnadmin: File already exists: filesystem '7thOnline/db', transaction '46998-1'
, path '2012Q2-GA5.4.1 GRI/JavaDev/cmm/data/RatioCalculator.java'
Solution:
remove related version file
change 0 and current info to keep current version to be dump start version - 1 (here is 46987).
Issue2:
C:\Documents and Settings\ntadmin>svnsync sync repo_local_path
svnsync: Revision being currently copied (47009), last merged revision (47008),
he destination without using svnsync?
Solution:
update 0 version file