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.

306 lines
11 KiB

  1. @ECHO OFF
  2. IF '%1%' == '/?' GOTO USAGE
  3. SET BOOTPATH=%~f1
  4. SET DATAPATH=%~f2
  5. SET MODE=%3
  6. IF '%MODE%' == '' SET MODE=/t
  7. :CHECKDIRS
  8. IF NOT EXIST migrate.exe GOTO ERROR
  9. IF NOT EXIST migrate.sql GOTO ERROR
  10. IF NOT EXIST %BOOTPATH% GOTO ERROR
  11. IF NOT EXIST %DATAPATH% GOTO ERROR
  12. :CHECKMODE
  13. IF '%MODE%' == '' SET MODE=/t
  14. IF /i '%MODE%' == '/h' GOTO STARTRUN
  15. IF /i '%MODE%' == '/t' GOTO STARTRUN
  16. IF /i '%MODE%' == '/p' GOTO STARTRUN ELSE GOTO ERROR
  17. :STARTRUN
  18. SET V15DB=uddi_v15
  19. SET READERDB=uddi_reader
  20. SET READER="Data Source=%COMPUTERNAME%\;Initial Catalog=%READERDB%;Integrated Security=SSPI"
  21. SET WRITERDB=uddi
  22. SET SYSPUID=System
  23. SET IBMOPERATORKEY=C8DBBBED-EEFB-45F9-BB23-DD3CBCF1DB9E
  24. SET EXCEPTIONPATH=exceptions
  25. SET EXCEPTIONFILE=migrate.exceptions.txt
  26. SET IBMPUBINSERT=EXEC UI_savePublisher @PUID='%IBMOPERATORKEY%', @isoLangCode='en', @name='IBM', @email='', @phone='', @tier=2
  27. SET IBMOPINSERT=EXEC net_operator_save @operatorKey='%IBMOPERATORKEY%', @PUID='%IBMOPERATORKEY%', @operatorStatusID=1, @name='IBM', @soapReplicationURL='', @certSerialNo='2D2D03BC-4782-4D97-B1CC-993D4352F09E', @certIssuer='', @certSubject='', @certificate=NULL
  28. SET DELPUBINSERT=EXEC UI_savePublisher @PUID='%USERDOMAIN%\%USERNAME%', @isoLangCode='en', @name='Delegate', @email='', @phone='', @tier=2
  29. :START
  30. ECHO ----------------------------------------------------------
  31. ECHO runmigrate.cmd starting in %MODE% mode.
  32. ECHO BOOTPATH=%BOOTPATH%
  33. ECHO DATAPATH=%DATAPATH%
  34. IF EXIST %EXCEPTIONPATH% DEL /Q %EXCEPTIONPATH%\*.*
  35. IF EXIST %EXCPTIONFILE% DEL %EXCEPTIONFILE%
  36. :sETREADERCONNECTION
  37. ECHO ----------------------------------------------------------
  38. ECHO Preparing to execute stage SetReaderconnection...
  39. PAUSE
  40. migrate -s SetReaderConnection -c %READER% -i
  41. IF ERRORLEVEL 1 GOTO ERROR
  42. :PREPAREDATABASES
  43. ECHO ----------------------------------------------------------
  44. ECHO Preparing to execute stage PrepareDatabases...
  45. PAUSE
  46. ECHO Restore a backup of the UDDI V1.5 Production Database
  47. PAUSE
  48. ECHO Backing up %WRITERDB%
  49. PAUSE
  50. OSQL -b -E -d master -e -Q "BACKUP DATABASE %WRITERDB% TO DISK='%DATAPATH%\uddi_migrate.bak' WITH INIT"
  51. IF ERRORLEVEL 1 GOTO ERROR
  52. ECHO Dropping %READERDB%
  53. PAUSE
  54. OSQL -b -E -d master -e -Q "IF EXISTS(SELECT * FROM [sysdatabases] WHERE [name] = '%READERDB%') DROP DATABASE %READERDB%"
  55. IF ERRORLEVEL 1 GOTO ERROR
  56. ECHO Restoring %READERDB%
  57. PAUSE
  58. OSQL -b -E -d master -e -Q "RESTORE DATABASE %READERDB% FROM DISK='%DATAPATH%\uddi_migrate.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'"
  59. IF ERRORLEVEL 1 GOTO ERROR
  60. ECHO Create ADM_migrate SP in %READERDB%
  61. PAUSE
  62. OSQL -b -E -d %READERDB% -i migrate.sql
  63. IF ERRORLEVEL 1 GOTO ERROR
  64. ECHO -
  65. ECHO Execute ADM_migrate SP
  66. PAUSE
  67. OSQL -b -E -d %READERDB% -e -Q "EXEC ADM_migrate @sourceDb='%V15DB%', @destDb='%READERDB%', @mode='%MODE%'" >> migrate.log.txt
  68. IF ERRORLEVEL 1 GOTO ERROR
  69. :RESETWRITER
  70. ECHO ----------------------------------------------------------
  71. ECHO Preparing to execute stage ResetWriter
  72. PAUSE
  73. migrate -s ResetWriter
  74. IF ERRORLEVEL 1 GOTO ERROR
  75. :MIGRATEPUBLISHERS
  76. ECHO ----------------------------------------------------------
  77. ECHO Preparing to execute stage MigratePublishers
  78. PAUSE
  79. migrate -s MigratePublishers
  80. IF ERRORLEVEL 1 GOTO ERROR
  81. :MIGRATEBARETMODELS
  82. ECHO ----------------------------------------------------------
  83. ECHO Preparing to execute stage MigrateBareTModels
  84. PAUSE
  85. migrate -s MigrateBareTModels
  86. IF ERRORLEVEL 1 GOTO ERROR
  87. :REPLICATE1
  88. ECHO ----------------------------------------------------------
  89. IF '%MODE%' == '/t' GOTO REPLICATE1TEST
  90. IF '%MODE%' == '/h' GOTO REPLICATE1HEARTLAND
  91. ECHO Prapring to execute interim replication phase 1 in %MODE% mode.
  92. PAUSE
  93. ECHO Install IBM operator / publisher now using rcf.exe
  94. PAUSE
  95. ECHO Retrieve from IBM
  96. PAUSE
  97. ECHO Ask IBM to retrieve from Microsoft
  98. PAUSE
  99. ECHO Preparing to bootstrap checked taxonomies...
  100. PAUSE
  101. bootstrap -f %BOOTPATH%\PRODUCTION\01.uddi-org-types.bootstrap.xml -u %SYSPUID%
  102. IF ERRORLEVEL 1 GOTO ERROR
  103. bootstrap -f %BOOTPATH%\PRODUCTION\06.uddi-org-relationships.bootstrap.xml -u %SYSPUID%
  104. IF ERRORLEVEL 1 GOTO ERROR
  105. bootstrap -f %BOOTPATH%\PRODUCTION\09.ntis-gov-sic-1987.microsoft.bootstrap.xml -u %SYSPUID%
  106. IF ERRORLEVEL 1 GOTO ERROR
  107. bootstrap -f %BOOTPATH%\PRODUCTION\10.unspsc-org-unspsc-3-1.ibm.bootstrap.xml -u %SYSPUID%
  108. IF ERRORLEVEL 1 GOTO ERROR
  109. bootstrap -f %BOOTPATH%\PRODUCTION\11.unspsc-org-unspsc-7-3.ibm.bootstrap.xml -u %SYSPUID%
  110. IF ERRORLEVEL 1 GOTO ERROR
  111. bootstrap -f %BOOTPATH%\PRODUCTION\12.uddi-org-iso-ch-3166-1999.ibm.bootstrap.xml -u %SYSPUID%
  112. IF ERRORLEVEL 1 GOTO ERROR
  113. bootstrap -f %BOOTPATH%\PRODUCTION\15.microsoft-com-geoweb-2000.microsoft.bootstrap.xml -u %SYSPUID%
  114. IF ERRORLEVEL 1 GOTO ERROR
  115. bootstrap -f %BOOTPATH%\PRODUCTION\16.ntis-gov-naics-1997.ibm.bootstrap.xml -u %SYSPUID%
  116. IF ERRORLEVEL 1 GOTO ERROR
  117. bootstrap -f %BOOTPATH%\PRODUCTION\17.ms-com-vstudio.bootstrap.xml -u %SYSPUID%
  118. IF ERRORLEVEL 1 GOTO ERROR
  119. GOTO MIGRATEFULLTMODELS
  120. :REPLICATE1TEST
  121. ECHO Inserting a test IBM publisher.
  122. PAUSE
  123. OSQL -b -E -d %WRITERDB% -e -Q "%IBMPUBINSERT%"
  124. PAUSE
  125. ECHO Inserting a test IBM operator
  126. PAUSE
  127. OSQL -b -E -d %WRITERDB% -e -Q "%IBMOPINSERT%"
  128. ECHO Inserting a delegate publisher
  129. PAUSE
  130. OSQL -b -E -d %WRITERDB% -e -Q "%DELPUBINSERT%"
  131. ECHO Bootstrapping test tmodels and checked taxonomies under IBM account
  132. bootstrap -f %BOOTPATH%\TEST\01.uddi-org-types.bootstrap.xml -u %IBMOPERATORKEY%
  133. IF ERRORLEVEL 1 GOTO ERROR
  134. bootstrap -f %BOOTPATH%\TEST\02.v1-canonical.bootstrap.xml -u %IBMOPERATORKEY%
  135. IF ERRORLEVEL 1 GOTO ERROR
  136. bootstrap -f %BOOTPATH%\TEST\03.v2-canonical.bootstrap.xml -u %IBMOPERATORKEY%
  137. IF ERRORLEVEL 1 GOTO ERROR
  138. bootstrap -f %BOOTPATH%\TEST\04.uddi-org-general_keywords.bootstrap.xml -u %IBMOPERATORKEY%
  139. IF ERRORLEVEL 1 GOTO ERROR
  140. bootstrap -f %BOOTPATH%\TEST\05.uddi-org-owningBusiness.bootstrap.xml -u %IBMOPERATORKEY%
  141. IF ERRORLEVEL 1 GOTO ERROR
  142. bootstrap -f %BOOTPATH%\TEST\06.uddi-org-relationships.bootstrap.xml -u %IBMOPERATORKEY%
  143. IF ERRORLEVEL 1 GOTO ERROR
  144. bootstrap -f %BOOTPATH%\TEST\07.uddi-org-operators.bootstrap.xml -u %IBMOPERATORKEY%
  145. IF ERRORLEVEL 1 GOTO ERROR
  146. bootstrap -f %BOOTPATH%\TEST\08.uddi-core-other.bootstrap.xml -u %IBMOPERATORKEY%
  147. IF ERRORLEVEL 1 GOTO ERROR
  148. bootstrap -f %BOOTPATH%\TEST\09.ntis-gov-sic-1987.microsoft.bootstrap.xml -u %SYSPUID%
  149. IF ERRORLEVEL 1 GOTO ERROR
  150. bootstrap -f %BOOTPATH%\TEST\10.unspsc-org-unspsc-3-1.ibm.bootstrap.xml -u %IBMOPERATORKEY%
  151. IF ERRORLEVEL 1 GOTO ERROR
  152. bootstrap -f %BOOTPATH%\TEST\11.unspsc-org-unspsc-7-3.ibm.bootstrap.xml -u %IBMOPERATORKEY%
  153. IF ERRORLEVEL 1 GOTO ERROR
  154. bootstrap -f %BOOTPATH%\TEST\12.uddi-org-iso-ch-3166-1999.ibm.bootstrap.xml -u %IBMOPERATORKEY%
  155. IF ERRORLEVEL 1 GOTO ERROR
  156. bootstrap -f %BOOTPATH%\TEST\13.dnb-com-D-U-N-S.ibm.bootstrap.xml -u %IBMOPERATORKEY%
  157. IF ERRORLEVEL 1 GOTO ERROR
  158. bootstrap -f %BOOTPATH%\TEST\14.thomasregister-com-supplierID.ibm.bootstrap.xml -u %IBMOPERATORKEY%
  159. IF ERRORLEVEL 1 GOTO ERROR
  160. bootstrap -f %BOOTPATH%\TEST\15.microsoft-com-geoweb-2000.microsoft.bootstrap.xml -u %SYSPUID%
  161. IF ERRORLEVEL 1 GOTO ERROR
  162. bootstrap -f %BOOTPATH%\TEST\16.ntis-gov-naics-1997.ibm.bootstrap.xml -u %IBMOPERATORKEY%
  163. IF ERRORLEVEL 1 GOTO ERROR
  164. bootstrap -f %BOOTPATH%\TEST\17.ms-com-vstudio.bootstrap.xml -u %SYSPUID%
  165. IF ERRORLEVEL 1 GOTO ERROR
  166. GOTO MIGRATEFULLTMODELS
  167. :REPLICATE1HEARTLAND
  168. ECHO Inserting a delegate publisher
  169. PAUSE
  170. OSQL -b -E -d %WRITERDB% -e -Q "%DELPUBINSERT%"
  171. ECHO Preparing to Bootstrap tmodels and checked taxonomies under System account
  172. PAUSE
  173. bootstrap -f %BOOTPATH%\01.uddi-org-types.bootstrap.xml -u %SYSPUID%
  174. IF ERRORLEVEL 1 GOTO ERROR
  175. bootstrap -f %BOOTPATH%\02.v1-canonical.bootstrap.xml -u %SYSPUID%
  176. IF ERRORLEVEL 1 GOTO ERROR
  177. bootstrap -f %BOOTPATH%\03.v2-canonical.bootstrap.xml -u %SYSPUID%
  178. IF ERRORLEVEL 1 GOTO ERROR
  179. bootstrap -f %BOOTPATH%\04.uddi-org-general_keywords.bootstrap.xml -u %SYSPUID%
  180. IF ERRORLEVEL 1 GOTO ERROR
  181. bootstrap -f %BOOTPATH%\04a.ms-com-authmodels.bootstrap.xml -u %SYSPUID%
  182. IF ERRORLEVEL 1 GOTO ERROR
  183. bootstrap -f %BOOTPATH%\04b.ms-com-extensions.bootstrap.xml -u %SYSPUID%
  184. IF ERRORLEVEL 1 GOTO ERROR
  185. bootstrap -f %BOOTPATH%\04c.ms-com.catbrowse.bootstrap.xml -u %SYSPUID%
  186. IF ERRORLEVEL 1 GOTO ERROR
  187. bootstrap -f %BOOTPATH%\05.uddi-org-owningBusiness.bootstrap.xml -u %SYSPUID%
  188. IF ERRORLEVEL 1 GOTO ERROR
  189. bootstrap -f %BOOTPATH%\06.uddi-org-relationships.bootstrap.xml -u %SYSPUID%
  190. IF ERRORLEVEL 1 GOTO ERROR
  191. bootstrap -f %BOOTPATH%\07.uddi-org-operators.bootstrap.xml -u %SYSPUID%
  192. IF ERRORLEVEL 1 GOTO ERROR
  193. bootstrap -f %BOOTPATH%\08.uddi-core-other.bootstrap.xml -u %SYSPUID%
  194. IF ERRORLEVEL 1 GOTO ERROR
  195. bootstrap -f %BOOTPATH%\09.ms-com-vstudio.bootstrap.xml -u %SYSPUID%
  196. IF ERRORLEVEL 1 GOTO ERROR
  197. GOTO MIGRATEFULLTMODELS
  198. :MIGRATEFULLTMODELS
  199. ECHO ----------------------------------------------------------
  200. ECHO Preparing to execute stage MigrateFullTModels
  201. PAUSE
  202. migrate -s MigrateFullTModels
  203. IF ERRORLEVEL 1 GOTO ERROR
  204. :MIGRATEHIDDENTMODELS
  205. ECHO ----------------------------------------------------------
  206. ECHO Preparing to execute stage MigrateHiddenTModels
  207. PAUSE
  208. migrate -s MigrateHiddenTModels
  209. IF ERRORLEVEL 1 GOTO ERROR
  210. :REPLICATE2
  211. IF '%MODE%' == '/t' GOTO MIGRATEBUSINESSENTITIES
  212. IF '%MODE%' == '/h' GOTO MIGRATEBUSINESSENTITIES
  213. ECHO ----------------------------------------------------------
  214. ECHO Prepring to execute interim replication phase 2
  215. ECHO Retrieve from IBM
  216. PAUSE
  217. ECHO Ask IBM to retrieve from Microsoft
  218. PAUSE
  219. PAUSE
  220. :MIGRATEBUSINESSENTITIES
  221. ECHO ----------------------------------------------------------
  222. ECHO Preparing to execute stage MigrateBusinessEntities
  223. PAUSE
  224. migrate -s MigrateBusinessEntities
  225. IF ERRORLEVEL 1 GOTO ERROR
  226. :REPLICATE3
  227. ECHO ----------------------------------------------------------
  228. ECHO Prepring to execute interim replication phase 3
  229. ECHO Retrieve from IBM
  230. PAUSE
  231. ECHO Ask IBM to retrieve from Microsoft
  232. PAUSE
  233. :RESTOREREADERCONNECTION
  234. ECHO ----------------------------------------------------------
  235. ECHO Preparing to execute stage RestoreReaderConnection
  236. PAUSE
  237. migrate -s RestoreReaderConnection
  238. GOTO END
  239. :ERROR
  240. ECHO ----------------------------------------------------------
  241. ECHO runmigrate.cmd terminating with an error
  242. ECHO see migrate.log.txt for details
  243. migrate -s RestoreReaderConnection
  244. GOTO END
  245. :USAGE
  246. ECHO runmigrate [bootpath] [datapath] [/t or /p]
  247. ECHO [bootpath]: path to bootstrap files, e.g. ..\bootstrap
  248. ECHO [datapath]: path to data directory, e.g. ..\data
  249. ECHO [/t]: test mode (default)
  250. ECHO [/h]: heartland mode
  251. ECHO [/p]: production mode
  252. GOTO END
  253. :END
  254. SET MODE=
  255. SET READER=
  256. SET BINPATH=
  257. SET BOOTPATH=
  258. SET V15DB=
  259. SET READERDB=
  260. SET WRITERDB=
  261. SET SYSPUID=
  262. SET IBMOPERATORKEY=
  263. SET EXCEPTIONPATH=
  264. SET EXCEPTIONFILE=
  265. SET IBMPUBINSERT=
  266. SET DELPUBINSERT=
  267. SET IBMOPINSERT=
  268. ECHO ----------------------------------------------------------
  269. ECHO runmigrate.cmd ending