Welcome to the Linux Foundation Forum!

How do I migrate SQL Server logins and users to a new server?

To migrate SQL Server logins and users to a new server, you need to transfer both server-level logins and database users while keeping permissions intact. First, script out the logins from the source server using the sp_help_revlogin stored procedure. This captures the login name, password hash, and security identifier (SID), ensuring the login remains the same on the new server. Run the generated script on the target server to recreate the logins. Next, restore or attach the database on the new server. Then, run ALTER USER [username] WITH LOGIN = [loginname] to map database users to their corresponding logins. Finally, verify that permissions and roles are correct by checking user mappings and running test queries. If you prefer an automated method, tools Aryson SQL Database Recovery Software can simplify the migration and reduce errors.

Categories

Upcoming Training