Moving Your SELECTserver Database


SELECTserver: Database moving to another server

SUMMARY:
How to move SELECTserver database to another server using SQL Server Desktop Engine (MSDE 2000) or SQL Server 2005 Express Edition 

Applies to:

Database can be moved by creating backup and restoring it on the new server or detaching and attaching procedure.

Backup creating and restoring - Use if you are moving between version of SQL Server - Note: you can only move up in version, meaning a backup from MSDE can be restored to SQL Server 2005 Express but a backup from 2005 Express cannot be restored to MSDE

        osql –E
        BACKUP DATABASE _DBname_ TO DISK = 'C:\Program Files\Bentley\SelectServer\Database\Backup\_DBname_.bak'
        BACKUP LOG DBname TO DISK = 'C:\Program Files\Bentley\SelectServer\Database\Backup\_DBname_log.bak'
        RESTORE DATABASE _DBname_ FROM DISK ='C:\TEMP\_DBname_.bak'


NOTE: If you are using the default database that was installed with SELECTserver than the database name is SELECTserver

Detaching and attaching (skip it if backup/restore was performed)

        osql –E
        EXEC sp_detach_db 'MyDBname'
        EXEC sp_attach_db @dbname = N'_MyDBname_', 
        @filename1 = N'C:\Program Files\Bentley\SELECTserver\Database\MSSQL$SELECTSERVER\Data\_MyDBname_.mdf', 
        @filename2 = N'C:\Program Files\Bentley\SELECTserver\Database\MSSQL$SELECTSERVER\Data\_MyDBname_.ldf'

Configure database to support the SELECTserver