About a month ago, we migrated a production database and logins to a new instance. The client is currently troubleshooting an issue and wants to confirm that the login permissions in the new instance match exactly what they were in the old instance.
We have long since deleted the old logins as well as the database that was migrated from the old instance. However we have backups of the master database. I though I could restore the master as a regular user database and query the views to peek at the server and database principals as they existed before the migration, but the views appear to be returning current information rather than historical.
So for one, there's a fundamental misunderstanding on my part regarding what is contained in the master database (or at least how the views work). If anyone can shed some light on this, that would be great. But mostly, does anyone know if what I'm trying to do is possible?
Edit: As a test, I restored the same backup of the master database onto a completely different instance, naming the restored database: master_temp. Then I tried the following:
SELECT * FROM master_temp.sys.server_principals
The results that were returned only contained information from the instance the database was restored onto. Not a single user login from the instance the backup was taken from was returned in the result set.
sys.server_principals
in the restored copy of that database?sysxlgns
andsyspalnames
tables on the instance. I reckon if you connect to the Direct Admin Connection, it might work.sys.server_principals
to read the data. As this is unsupported, I'm not going to contribute an answer. My recommendation is to spin up a test instance of SQL Server Developer in a VM, and restoremaster
the right way.