------------------------------------------ ReportServer ------------------------------------------ PRINT 'Database: ReportServer' -- Make Database to single user Mode ALTER DATABASE ReportServer SET SINGLE_USER WITH ROLLBACK IMMEDIATE -- Restore Database RESTORE DATABASE ReportServer FROM DISK = 'D:\Temp\Backup\PDCSRV01 - Whidbey\ReportServer_backup_200707272105.bak' WITH REPLACE, MOVE 'ReportServer' TO 'D:\SQLServer\Data\ReportServer.mdf', MOVE 'ReportServer_log' TO 'D:\SQLServer\Logs\ReportServer_log.ldf' -- If there is no error in statement before database will be in multiuser mode. -- If error occurs please execute following command it will convert database in multi user. ALTER DATABASE ReportServer SET MULTI_USER GO -------------------------------------------------------------------------------------------------- ------------------------------------------ ReportServerTempDB ------------------------------------ PRINT 'Database: ReportServerTempDB' -- Make Database to single user Mode ALTER DATABASE ReportServerTempDB SET SINGLE_USER WITH ROLLBACK IMMEDIATE -- Restore Database RESTORE DATABASE ReportServerTempDB FROM DISK = 'D:\Temp\Backup\PDCSRV01 - Whidbey\ReportServerTempDB_backup_200707272105.bak' WITH REPLACE, MOVE 'ReportServerTempDB' TO 'D:\SQLServer\Data\ReportServerTempDB.mdf', MOVE 'ReportServerTempDB_log' TO 'D:\SQLServer\Logs\ReportServerTempDB_log.ldf' -- If there is no error in statement before database will be in multiuser mode. -- If error occurs please execute following command it will convert database in multi user. ALTER DATABASE ReportServerTempDB SET MULTI_USER GO -------------------------------------------------------------------------------------------------- ------------------------------------------ STS_Content_TFS --------------------------------------- PRINT 'Database: STS_Content_TFS' --Make Database to single user Mode ALTER DATABASE STS_Content_TFS SET SINGLE_USER WITH ROLLBACK IMMEDIATE --Restore Database RESTORE DATABASE STS_Content_TFS FROM DISK = 'D:\Temp\Backup\PDCSRV01 - Whidbey\STS_Content_TFS_backup_200707272112.trn' WITH REPLACE, MOVE 'STS_Content_TFS' TO 'D:\SQLServer\Data\STS_Content_TFS.mdf', MOVE 'STS_Content_TFS_log' TO 'D:\SQLServer\Logs\STS_Content_TFS_log.ldf' --If there is no error in statement before database will be in multiuser mode. --If error occurs please execute following command it will convert database in multi user. ALTER DATABASE STS_Content_TFS SET MULTI_USER GO -------------------------------------------------------------------------------------------------- ------------------------------------------ TfsActivityLogging ------------------------------------ PRINT 'Database: TfsActivityLogging' --Make Database to single user Mode ALTER DATABASE TfsActivityLogging SET SINGLE_USER WITH ROLLBACK IMMEDIATE --Restore Database RESTORE DATABASE TfsActivityLogging FROM DISK = 'D:\Temp\Backup\PDCSRV01 - Whidbey\TfsActivityLogging_backup_200707272112.trn' WITH REPLACE, MOVE 'TfsActivityLogging' TO 'D:\SQLServer\Data\TfsActivityLogging.mdf', MOVE 'TfsActivityLogging_log' TO 'D:\SQLServer\Logs\TfsActivityLogging_log.ldf' --If there is no error in statement before database will be in multiuser mode. --If error occurs please execute following command it will convert database in multi user. ALTER DATABASE TfsActivityLogging SET MULTI_USER GO -------------------------------------------------------------------------------------------------- ------------------------------------------ TfsBuild ---------------------------------------------- PRINT 'Database: TfsBuild' --Make Database to single user Mode ALTER DATABASE TfsBuild SET SINGLE_USER WITH ROLLBACK IMMEDIATE --Restore Database RESTORE DATABASE TfsBuild FROM DISK = 'D:\Temp\Backup\PDCSRV01 - Whidbey\TfsBuild_backup_200707272112.trn' WITH REPLACE, MOVE 'TfsBuild' TO 'D:\SQLServer\Data\TfsBuild.mdf', MOVE 'TfsBuild_log' TO 'D:\SQLServer\Logs\TfsBuild_log.ldf' --If there is no error in statement before database will be in multiuser mode. --If error occurs please execute following command it will convert database in multi user. ALTER DATABASE TfsBuild SET MULTI_USER GO -------------------------------------------------------------------------------------------------- ------------------------------------------ TfsIntegration ---------------------------------------- PRINT 'Database: TfsIntegration' --Make Database to single user Mode ALTER DATABASE TfsIntegration SET SINGLE_USER WITH ROLLBACK IMMEDIATE --Restore Database RESTORE DATABASE TfsIntegration FROM DISK = 'D:\Temp\Backup\PDCSRV01 - Whidbey\TfsIntegration_backup_200707272112.trn' WITH REPLACE, MOVE 'TfsIntegration' TO 'D:\SQLServer\Data\TfsIntegration.mdf', MOVE 'TfsIntegration_log' TO 'D:\SQLServer\Logs\TfsIntegration_log.ldf' --If there is no error in statement before database will be in multiuser mode. --If error occurs please execute following command it will convert database in multi user. ALTER DATABASE TfsIntegration SET MULTI_USER GO -------------------------------------------------------------------------------------------------- ------------------------------------------ TfsVersionControl ------------------------------------- PRINT 'Database: TfsVersionControl' --Make Database to single user Mode ALTER DATABASE TfsVersionControl SET SINGLE_USER WITH ROLLBACK IMMEDIATE --Restore Database RESTORE DATABASE TfsVersionControl FROM DISK = 'D:\Temp\Backup\PDCSRV01 - Whidbey\TfsVersionControl_backup_200707272112' WITH REPLACE, MOVE 'TfsVersionControl' TO 'D:\SQLServer\Data\TfsVersionControl.mdf', MOVE 'TfsVersionControl_log' TO 'D:\SQLServer\Logs\TfsVersionControl_log.ldf' --If there is no error in statement before database will be in multiuser mode. --If error occurs please execute following command it will convert database in multi user. ALTER DATABASE TfsVersionControl SET MULTI_USER GO -------------------------------------------------------------------------------------------------- ------------------------------------------ TfsWarehouse ------------------------------------------ PRINT 'Database: TfsWarehouse' --Make Database to single user Mode ALTER DATABASE TfsWarehouse SET SINGLE_USER WITH ROLLBACK IMMEDIATE --Restore Database RESTORE DATABASE TfsWarehouse FROM DISK = 'D:\Temp\Backup\PDCSRV01 - Whidbey\TfsWarehouse_backup_200707272112.trn' WITH REPLACE, MOVE 'TfsWarehouse' TO 'D:\SQLServer\Data\TfsWarehouse.mdf', MOVE 'TfsWarehouse_log' TO 'D:\SQLServer\Logs\TfsWarehouse_log.ldf' --If there is no error in statement before database will be in multiuser mode. --If error occurs please execute following command it will convert database in multi user. ALTER DATABASE TfsWarehouse SET MULTI_USER GO -------------------------------------------------------------------------------------------------- ------------------------------------------ TfsWorkItemTracking ----------------------------------- PRINT 'Database: TfsWorkItemTracking' --Make Database to single user Mode ALTER DATABASE TfsWorkItemTracking SET SINGLE_USER WITH ROLLBACK IMMEDIATE --Restore Database RESTORE DATABASE TfsWorkItemTracking FROM DISK = 'D:\Temp\Backup\PDCSRV01 - Whidbey\TfsWorkItemTracking_backup_200707272112.trn' WITH REPLACE, MOVE 'TfsWorkItemTracking' TO 'D:\SQLServer\Data\TfsWorkItemTracking.mdf', MOVE 'TfsWorkItemTracking_log' TO 'D:\SQLServer\Logs\TfsWorkItemTracking_log.ldf' --If there is no error in statement before database will be in multiuser mode. --If error occurs please execute following command it will convert database in multi user. ALTER DATABASE TfsWorkItemTracking SET MULTI_USER GO -------------------------------------------------------------------------------------------------- ------------------------------------------ TfsWorkItemTrackingAttachments ------------------------- PRINT 'Database: TfsWorkItemTrackingAttachments' --Make Database to single user Mode ALTER DATABASE TfsWorkItemTrackingAttachments SET SINGLE_USER WITH ROLLBACK IMMEDIATE --Restore Database RESTORE DATABASE TfsWorkItemTrackingAttachments FROM DISK = 'D:\Temp\Backup\PDCSRV01 - Whidbey\TfsWorkItemTrackingAttachments_backup_200707272112.trn' WITH REPLACE, MOVE 'TfsWorkItemTrackingAttachments' TO 'D:\SQLServer\Data\TfsWorkItemTrackingAttachments.mdf', MOVE 'TfsWorkItemTrackingAttachments_log' TO 'D:\SQLServer\Logs\TfsWorkItemTrackingAttachments_log.ldf' --If there is no error in statement before database will be in multiuser mode. --If error occurs please execute following command it will convert database in multi user. ALTER DATABASE TfsWorkItemTrackingAttachments SET MULTI_USER GO --------------------------------------------------------------------------------------------------