Repository Upgrade: Difference between revisions

From SubversionWiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 2: Line 2:
<br>
<br>
-- Upgrade.bat -----------------------------------------<br>
-- Upgrade.bat -----------------------------------------<br>
@echo off<br>
@echo off
IF [NOT] %3=="" goto DoIt<br>
IF [NOT] %3=="" goto DoIt
<br>
cls<br>
cls
echo Upgrade existing Subversion repositories<br>
echo Upgrade existing Subversion repositories
echo .<br>
echo .
echo Command line syntax:<br>
echo Command line syntax:
echo Upgrade2 Source_Directory Working_Directory Target_Directory<br>
echo Upgrade2 Source_Directory Working_Directory Target_Directory
echo .<br>
echo .
echo Source Directory - Where the repositories exist now<br>
echo Source Directory - Where the repositories exist now
echo Working Directory - Where the dump files should be placed<br>
echo Working Directory - Where the dump files should be placed
echo Target Directory - Where the newly formatted files will be placed<br>
echo Target Directory - Where the newly formatted files will be placed
echo .<br>
echo .
echo NOTE: The upgrade_repos.bat file is, by default, using the default arguments for svnadmin create<br>
echo NOTE: The upgrade_repos.bat file is, by default, using the default arguments for svnadmin create
echo      If you want to use anything else, change the file before running.<br>
echo      If you want to use anything else, change the file before running.
goto exit<br>
goto exit
<br>
:DoIt<br>
:DoIt
:: call the actual upgrade batch file<br>
::call the actual upgrade batch file
for /D %%I in (*.) do call upgrade_repos.bat %%~nI %1 %2 %3<br>
for /D %%I in (*.) do call upgrade_repos.bat %%~nI %1 %2 %3
<br>
:: copy the master files - Files in the SVNParent<br>
::copy the master files - Files in the SVNParent
xcopy %1\*.* %3\ /y<br>
xcopy %1\*.* %3\ /y
<br>
:Exit<br>
:Exit
<br>
<br>
<br>
<br>
Line 32: Line 32:
<br>
<br>
-- Upgrade_Repos.bat -----------------------------------<br>
-- Upgrade_Repos.bat -----------------------------------<br>
echo Migrating %1<br>
echo Migrating %1
echo ...Creating Repository<br>
echo ...Creating Repository
svnadmin create %4\%1<br>
svnadmin create %4\%1
echo ...Dumping<br>
echo ...Dumping
svnadmin dump -q %2\%1 > %3\%1.dmp<br>
svnadmin dump -q %2\%1 > %3\%1.dmp
echo ...Loading<br>
echo ...Loading
svnadmin load -q %4\%1 < %3\%1.dmp<br>
svnadmin load -q %4\%1 < %3\%1.dmp
echo ...Copying hooks<br>
echo ...Copying hooks
xcopy %2\%1\hooks\*.* %4\%1\hooks /y<br>
xcopy %2\%1\hooks\*.* %4\%1\hooks /y
echo *******************************************************************<br>
echo *******************************************************************
<br>
<br>

Revision as of 08:22, 11 September 2006

I have used the following batch files to upgrade over 800 repositories this morning.

-- Upgrade.bat -----------------------------------------

@echo off
IF [NOT] %3=="" goto DoIt

cls
echo Upgrade existing Subversion repositories
echo .
echo Command line syntax:
echo Upgrade2 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 arguments for svnadmin create
echo       If you want to use anything else, change the file before running.
goto exit

:DoIt
::call the actual upgrade batch file
for /D %%I in (*.) do call upgrade_repos.bat %%~nI %1 %2 %3

::copy the master files - Files in the SVNParent
xcopy %1\*.* %3\ /y

:Exit





-- Upgrade_Repos.bat -----------------------------------

echo Migrating %1
echo ...Creating Repository
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
echo *******************************************************************