To migrate a DeMaSy and Licence database to a new server, you need to follow those steps:
- Detach the DeMaSy and Licence databases from the old server.
- Copy the DeMaSy.mdf, DeMaSy.ldf, Licence.mdf and the Licence.ldf file to the new server.
- Reattach the Database to the new server.
After that you have to a few queries to create the DeMaSy User and the DeMaSy Schema.
- DROP LOGIN DeMaSy
- CREATE LOGIN [DeMaSy] WITH PASSWORD = ‘YourPassword’, DEFAULT_LANGUAGE = [French],CHECK_POLICY = OFF;
- USE DeMaSy
- CREATE SCHEMA DeMaSy
- CREATE USER DeMaSy FOR LOGIN DeMaSy WITH DEFAULT_SCHEMA = DeMaSy
- exec sp_addrolemember ‘db_owner’, ‘DeMaSy’;
exec sp_addrolemember ‘db_accessadmin’, ‘DeMaSy’;
exec sp_addrolemember ‘db_securityadmin’, ‘DeMaSy’;
exec sp_addrolemember ‘db_ddladmin’, ‘DeMaSy’;
exec sp_addrolemember ‘db_backupoperator’, ‘DeMaSy’;
exec sp_addrolemember ‘db_datareader’, ‘DeMaSy’;
exec sp_addrolemember ‘db_datawriter’, ‘DeMaSy’; - USE Licence
- CREATE SCHEMA DeMaSy
- CREATE USER DeMaSy FOR LOGIN DeMaSy WITH DEFAULT_SCHEMA = DeMaSy
- exec sp_addrolemember ‘db_owner’, ‘DeMaSy’;
exec sp_addrolemember ‘db_accessadmin’, ‘DeMaSy’;
exec sp_addrolemember ‘db_securityadmin’, ‘DeMaSy’;
exec sp_addrolemember ‘db_ddladmin’, ‘DeMaSy’;
exec sp_addrolemember ‘db_backupoperator’, ‘DeMaSy’;
exec sp_addrolemember ‘db_datareader’, ‘DeMaSy’;
exec sp_addrolemember ‘db_datawriter’, ‘DeMaSy’;
After those queries go to this article to finish the process.