Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

157 lines
4.9 KiB

  1. @ECHO OFF
  2. ECHO Microsoft (R) UDDI Services migrate.uddi.cmd Batch Utility
  3. ECHO Copyright (c) Microsoft Corp. 2002. All rights reserved.
  4. IF '%1%' == '/?' GOTO USAGE
  5. SET BOOTPATH=%~f1
  6. SET DATAPATH=%~f2
  7. SET SQLINSTANCE=%3
  8. :CHECKDIRS
  9. IF NOT EXIST migrate.exe GOTO ERROR
  10. IF NOT EXIST %BOOTPATH% GOTO ERROR
  11. IF NOT EXIST %DATAPATH% GOTO ERROR
  12. IF NOT EXIST %DATAPATH%\uddi.database.bak GOTO ERROR
  13. :STARTRUN
  14. SET READERDB=uddi_reader
  15. SET READER="Data Source=%SQLINSTANCE%;Initial Catalog=%READERDB%;Integrated Security=SSPI"
  16. SET WRITERDB=uddi
  17. SET EXCEPTIONPATH=exceptions
  18. SET EXCEPTIONFILE=migrate.exceptions.txt
  19. :START
  20. ECHO ----------------------------------------------------------
  21. ECHO BOOTPATH=%BOOTPATH%
  22. ECHO DATAPATH=%DATAPATH%
  23. ECHO SQLINSTANCE=%SQLINSTANCE%
  24. IF EXIST %EXCEPTIONPATH% DEL /Q %EXCEPTIONPATH%\*.*
  25. IF EXIST %EXCPTIONFILE% DEL %EXCEPTIONFILE%
  26. :sETREADERCONNECTION
  27. ECHO ----------------------------------------------------------
  28. ECHO Preparing to execute stage SetReaderconnection...
  29. PAUSE
  30. migrate -s SetReaderConnection -c %READER% -i
  31. IF ERRORLEVEL 1 GOTO ERROR
  32. :PREPAREDATABASES
  33. ECHO ----------------------------------------------------------
  34. ECHO Dropping %READERDB%
  35. PAUSE
  36. OSQL -b -E -d master -S %SQLINSTANCE% -e -Q "IF EXISTS(SELECT * FROM [sysdatabases] WHERE [name] = '%READERDB%') DROP DATABASE %READERDB%"
  37. IF ERRORLEVEL 1 GOTO ERROR
  38. ECHO Restoring %READERDB%
  39. PAUSE
  40. OSQL -b -E -d master -S %SQLINSTANCE% -e -Q "RESTORE DATABASE %READERDB% FROM DISK='%DATAPATH%\uddi.database.bak' WITH MOVE 'UDDI_SYS' TO '%DATAPATH%\UDDI_SYS_READER.MDF', MOVE 'UDDI_CORE_1' TO '%DATAPATH%\UDDI_CORE_1_READER.NDF', MOVE 'UDDI_CORE_2' TO '%DATAPATH%\UDDI_CORE_2_READER.NDF', MOVE 'UDDI_JOURNAL_1' TO '%DATAPATH%\UDDI_JOURNAL_1_READER.NDF', MOVE 'UDDI_STAGING_1' TO '%DATAPATH%\UDDI_STAGING_1_READER.NDF', MOVE 'UDDI_LOG' TO '%DATAPATH%\UDDI_LOG_READER.LDF'"
  41. IF ERRORLEVEL 1 GOTO ERROR
  42. :RESETWRITER
  43. ECHO ----------------------------------------------------------
  44. ECHO Preparing to execute stage ResetWriter
  45. PAUSE
  46. migrate -s ResetWriter
  47. IF ERRORLEVEL 1 GOTO ERROR
  48. :MIGRATEPUBLISHERS
  49. ECHO ----------------------------------------------------------
  50. ECHO Preparing to execute stage MigratePublishers
  51. PAUSE
  52. migrate -s MigratePublishers
  53. IF ERRORLEVEL 1 GOTO ERROR
  54. :MIGRATEBARETMODELS
  55. ECHO ----------------------------------------------------------
  56. ECHO Preparing to execute stage MigrateBareTModels
  57. PAUSE
  58. migrate -s MigrateBareTModels
  59. IF ERRORLEVEL 1 GOTO ERROR
  60. :MIGRATEBAREBUSINESSENTITIES
  61. ECHO ----------------------------------------------------------
  62. ECHO Preparing to execute stage MigrateBareBusinessEntities
  63. PAUSE
  64. migrate -s MigrateBareBusinessEntities
  65. IF ERRORLEVEL 1 GOTO ERROR
  66. :BOOTSTRAPRESOURCES
  67. ECHO ----------------------------------------------------------
  68. ECHO Preparing to execute stage BootstrapResources
  69. PAUSE
  70. migrate -s BootstrapResources
  71. IF ERRORLEVEL 1 GOTO ERROR
  72. :MIGRATECATEGORIZATIONSCHEMES
  73. ECHO ----------------------------------------------------------
  74. ECHO Preparing to execute stage MigrateCategorizatonSchemes
  75. PAUSE
  76. migrate -s MigrateCategorizationSchemes
  77. IF ERRORLEVEL 1 GOTO ERROR
  78. :MIGRATEFULLTMODELS
  79. ECHO ----------------------------------------------------------
  80. ECHO Preparing to execute stage MigrateFullTModels
  81. PAUSE
  82. migrate -s MigrateFullTModels
  83. IF ERRORLEVEL 1 GOTO ERROR
  84. :MIGRATEHIDDENTMODELS
  85. ECHO ----------------------------------------------------------
  86. ECHO Preparing to execute stage MigrateHiddenTModels
  87. PAUSE
  88. migrate -s MigrateHiddenTModels
  89. IF ERRORLEVEL 1 GOTO ERROR
  90. :MIGRATEBUSINESSENTITIES
  91. ECHO ----------------------------------------------------------
  92. ECHO Preparing to execute stage MigrateBusinessEntities
  93. PAUSE
  94. migrate -s MigrateBusinessEntities
  95. IF ERRORLEVEL 1 GOTO ERROR
  96. :MIGRATEPUBLISHERASSERTIONS
  97. ECHO ----------------------------------------------------------
  98. ECHO Preparing to execute stage MigratePublisherAssertions
  99. PAUSE
  100. migrate -s MigratePublisherAssertions
  101. IF ERRORLEVEL 1 GOTO ERROR
  102. :RESTOREREADERCONNECTION
  103. ECHO ----------------------------------------------------------
  104. ECHO Preparing to execute stage RestoreReaderConnection
  105. PAUSE
  106. migrate -s RestoreReaderConnection
  107. GOTO END
  108. :ERROR
  109. ECHO ----------------------------------------------------------
  110. ECHO migrate.uddi.cmd terminating with an error
  111. ECHO see migrate.log.txt for details
  112. migrate -s RestoreReaderConnection
  113. GOTO END
  114. :USAGE
  115. ECHO runmigrate [bootpath] [datapath] [sqlinstance]
  116. ECHO [bootpath]: path to bootstrap files, e.g. ..\bootstrap
  117. ECHO [datapath]: path to data directory, e.g. ..\data
  118. ECHO [sqlinstance]: instance name of sql server, e.g. (local)
  119. GOTO END
  120. :END
  121. SET BOOTPATH=
  122. SET DATAPATH=
  123. SET SQLINSTANCE=
  124. SET READERDB=
  125. SET READER=
  126. SET WRITERDB=
  127. SET EXCEPTIONPATH=
  128. SET EXCEPTIONFILE=
  129. ECHO ----------------------------------------------------------
  130. ECHO migrate.uddi.cmd ending