Summary
Move or migrate the database used by the PolicyServer to a new SQL server using .mdf and .ldf files when the PolicyServer server machine is unchanged.
Details
To migrate the PolicyServer database:
- Stop the PolicyServer Windows Service.
- Back up the MobileArmorDB and MobileArmorLog databases. Detach them afterwards.
- Copy the following MDF and LDF files for both databases and move them to the new SQL server:
- MobileArmorDB.mdf
- MobileArmor_log.ldf
- MobileArmorLog.mdf
- MobileArmorLog_log.ldf
- On the new SQL server, attach both databases using the MDF and LDF files.
- Recreate the SQL Login account and associate it to the existing SQL database users by running SQL queries on both databases by doing the following:
- Right-click database and select New Query.
- Run the following queries:
sp_change_users_login cannot be used to map database users to Windows-level principals, certificates, or asymmetric keys. To add orphaned users, check this Microsoft article.
- "sp_change_users_login 'Report'"
This lists the PolicyServer database username if unknown. - "sp_change_users_login 'Auto_Fix', 'user', 'login', 'password'"
This creates and sets a password for the new Login, and then link it to the existing database user.Take note of the Login name and password as they will be used later for the PolicyServer application server installation.- ‘user’ is the PolicyServer database username (used for original installation or found via sp_change_users_login ‘Report’)
- ‘login’ is the desired SQL login name
- ‘password’ is the desired password for the SQL login
- "sp_change_users_login 'Report'"
- Do any of the following:
- Reinstall the PolicyServer.
- On the PolicyServer machine, run the PolicyServer installer and select Restore.
- When prompted to enter a SQL database, enter the server and credentials of the new SQL server.
- Proceed with the installation until it completes.
- Use the PolicyServer Change Setting Tool to point your existing PolicyServer to the new SQL Server.
- Reinstall the PolicyServer.
- Log in to the PolicyServer using the PolicyServer MMC.
Note: The server name should be the PolicyServer machine and not the SQL server.