Repository Upgrade: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m Reverted edits by DarliErc4t (Talk); changed back to last version by Leo |
||
(10 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
I have used the following batch files to upgrade over 800 repositories this morning.<br> | I have used the following batch files to upgrade over 800 repositories this morning.<br> | ||
And then someone gave me another challenge. Spaces....<br> | |||
Here's the updated script. Note it uses commands added in WindowsXP PushD and PopD as well as some of the formatting options used to navigate repositories | |||
<br> | <br> | ||
-- Upgrade.bat -----------------------------------------<br> | -- Upgrade.bat -----------------------------------------<br> | ||
@echo off | @echo off | ||
IF | IF NOT %3=="" goto DoIt | ||
cls | cls | ||
echo Upgrade existing Subversion repositories | echo Upgrade existing Subversion repositories | ||
echo . | echo . | ||
echo Command line syntax: | echo Command line syntax: | ||
echo | echo Upgrade Source_Directory Working_Directory Target_Directory | ||
echo . | echo . | ||
echo Source Directory - Where the repositories exist now | echo Source Directory - Where the repositories exist now | ||
echo Working Directory - Where the dump files should be placed | echo Working Directory - Where the dump files should be placed | ||
echo Target Directory - Where the newly formatted files will be placed | echo Target Directory - Where the newly formatted files will be placed | ||
echo . | echo . | ||
echo NOTE: The upgrade_repos.bat file is, by default, using the default arguments for svnadmin create | echo NOTE: The upgrade_repos.bat file is, by default, using the default | ||
echo If you want to use anything else, change the file before running. | echo arguments for svnadmin create. | ||
goto exit | echo If you want to use anything else, change the file before running. | ||
goto exit | |||
:DoIt | |||
:: call the actual upgrade batch file | :DoIt | ||
for /D %%I in (*.) do call upgrade_repos.bat %%~nI %1 %2 %3 | pushd "%1" | ||
:: copy the master files - Files in the SVNParent | ::call the actual upgrade batch file | ||
xcopy %1\*.* %3\ /y | for /D %%I in (*.) do call D:\Scripts\upgrade_repos.bat "%%~nI" %1 %2 %3 | ||
:Exit | ::copy the master files - Files in the SVNParent | ||
xcopy "%1\*.*" "%3\" /y | |||
popd | |||
:Exit | |||
<br> | <br> | ||
<br> | <br> | ||
Line 32: | Line 40: | ||
<br> | <br> | ||
-- Upgrade_Repos.bat -----------------------------------<br> | -- Upgrade_Repos.bat -----------------------------------<br> | ||
echo Migrating %1 | echo Migrating %1 | ||
echo ...Creating Repository | echo ...Creating Repository | ||
svnadmin create %4\%1 | echo %~4\%~1 | ||
echo ...Dumping | svnadmin create "%~4\%~1" | ||
svnadmin dump -q %2\%1 > %3\%1.dmp | echo ...Dumping | ||
echo ...Loading | svnadmin dump -q "%~2\%~1" > "%~3\%~1.dmp" | ||
svnadmin load -q %4\%1 < %3\%1.dmp | echo ...Loading | ||
echo ...Copying hooks | svnadmin load -q "%~4\%~1" < "%~3\%1.dmp" | ||
xcopy %2\%1\hooks\*.* %4\%1\hooks /y | echo ...Copying hooks | ||
echo ******************************************************************* | xcopy "%~2\%~1\hooks\*.*" "%~4\%~1\hooks" /y /d | ||
echo ******************************************************************* | |||
<br> | <br> |
Latest revision as of 23:26, 19 February 2008
I have used the following batch files to upgrade over 800 repositories this morning.
And then someone gave me another challenge. Spaces....
Here's the updated script. Note it uses commands added in WindowsXP PushD and PopD as well as some of the formatting options used to navigate repositories
-- Upgrade.bat -----------------------------------------
@echo off IF NOT %3=="" goto DoIt cls echo Upgrade existing Subversion repositories echo . echo Command line syntax: echo Upgrade Source_Directory Working_Directory Target_Directory echo . echo Source Directory - Where the repositories exist now echo Working Directory - Where the dump files should be placed echo Target Directory - Where the newly formatted files will be placed echo . echo NOTE: The upgrade_repos.bat file is, by default, using the default echo arguments for svnadmin create. echo If you want to use anything else, change the file before running. goto exit :DoIt pushd "%1" ::call the actual upgrade batch file for /D %%I in (*.) do call D:\Scripts\upgrade_repos.bat "%%~nI" %1 %2 %3 ::copy the master files - Files in the SVNParent xcopy "%1\*.*" "%3\" /y popd :Exit
-- Upgrade_Repos.bat -----------------------------------
echo Migrating %1 echo ...Creating Repository echo %~4\%~1 svnadmin create "%~4\%~1" echo ...Dumping svnadmin dump -q "%~2\%~1" > "%~3\%~1.dmp" echo ...Loading svnadmin load -q "%~4\%~1" < "%~3\%1.dmp" echo ...Copying hooks xcopy "%~2\%~1\hooks\*.*" "%~4\%~1\hooks" /y /d echo *******************************************************************