Sql-server – ny other way apart from sa to login to a migrated instance where the target environment is in a different domain

migrationsql server

We are migrating sql server instances from one domain to a different domain. New AD accounts/groups will be used in the new domain so SQL logins and database users in the source SQL instances will be unusable in the target instances.

Migration is by taking a snapshot backup of the host server and restoring to the target environment, which means the SQL instances have come across with the server images.

Having logged in to the migrated host server with new credentials, we now need to login to the SQL server to configure the security with new AD accounts.

Is there any other way of login in to the SQL server apart from doing so as sa with SQL authentication?

I am unable to use SSMS even in single user mode, as there is no valid AD login that can be used.

Does anyone have any other ideas please? Thank you so much.

Best Answer

To avoid this, I usually prefer to set up a fresh installation of an instance in the new domain. Then I restore the databases. Then I script proper instance configurations/agents/other things, adapting them to the new domain.

As suggested by @Ronaldo, you can enter in this emergency situation using:

https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/connect-to-sql-server-when-system-administrators-are-locked-out?view=sql-server-2017

Please, take a look at this guide in case of domain change: https://social.technet.microsoft.com/wiki/contents/articles/24960.migrating-sql-server-to-new-domain.aspx

It's quite old but the general overview is fine.

This guide to regaining access is also fine:

https://www.sqlservercentral.com/articles/regaining-access-to-sql-server-after-changing-the-domain