Link to home
Start Free TrialLog in
Avatar of ibgadmin
ibgadminFlag for United States of America

asked on

Copy Server logins and SQL Server roles and permissions

We have a physical server running Windows Server 2003 with SQL Server 2005.  We are moving to a new Windows Server 2012 with SQL Web 2014 environment and would like to see if it was possible to move the server logins as well as db permissions and roles.  Does anyone know if this is possible?
Avatar of Deepak Chauhan
Deepak Chauhan
Flag of India image

In this case you can use  "sp_help_revlogin" stored procedure provided by microsoft specifically for migration. Here is step by step info and in your case Method 3 is useful.

https://support.microsoft.com/en-us/kb/918992

 execute the sp_help_revlogin SP in master database and it will generate the create login script for you then copy the script and execute on target server.

Because users are mapped with the login sid and this SP generate login script with SID so rare chances of orphan users. But you can run below script to check the orphan users.

 use <database>
 go
 exec sp_change_users_login 'report'

 If orphan users exist in the database
you have to run this script to remap.


use <database>
 go
 exec sp_change_users_login 'Auto_fix', '<username>'
ASKER CERTIFIED SOLUTION
Avatar of Deepak Chauhan
Deepak Chauhan
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial