SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Restore DB in different instance


Restore DB in different instance

Author
Message
Netanel
Netanel
SSCommitted
SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)

Group: General Forum Members
Points: 1507 Visits: 470
Hello,
I have 2 instances.
1 for production and 1 for QA.
i backed up 1 of my db in production and restore it on my QA instance but it didn't restore my user & credentials.
What am i doing wrong?

Thanks in advance!
anthony.green
anthony.green
SSC Guru
SSC Guru (101K reputation)SSC Guru (101K reputation)SSC Guru (101K reputation)SSC Guru (101K reputation)SSC Guru (101K reputation)SSC Guru (101K reputation)SSC Guru (101K reputation)SSC Guru (101K reputation)

Group: General Forum Members
Points: 101380 Visits: 8698

Logins are stored in the master databases and are not copied on a backup and restore.

What is copied is the mappings between logins and users.

I would recommend you get sp_help_revlogin, run it on your prod server and copy the output to your QA server to recreate the logins.





How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger


Thom A
Thom A
SSC Guru
SSC Guru (82K reputation)SSC Guru (82K reputation)SSC Guru (82K reputation)SSC Guru (82K reputation)SSC Guru (82K reputation)SSC Guru (82K reputation)SSC Guru (82K reputation)SSC Guru (82K reputation)

Group: General Forum Members
Points: 82559 Visits: 21133
89netanel - Monday, November 20, 2017 7:14 AM
Hello,
I have 2 instances.
1 for production and 1 for QA.
i backed up 1 of my db in production and restore it on my QA instance but it didn't restore my user & credentials.
What am i doing wrong?

Thanks in advance!

A back up of a database will contain all the user details for that database. When you restore it, it will (again) contain those credentials.

Don't forget that logins (these are DIFFERENT to users) are server specific (their details are contained in the master database). If you are using SQL logins, then your SQL Login will very likely have a different SSID on your two different instances, so the users may not be mapped to the respective logins. If you're using AD, however, then the SSID will be the same on both servers.



Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does :-P

Please always remember to encapsulate your code in IFCode Markup. For example [code=sql] [/code].
Click here to read Jeffs Guide on how to post SQL questions, and get swift and helpful answers from the community
Netanel
Netanel
SSCommitted
SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)

Group: General Forum Members
Points: 1507 Visits: 470
Hi anthony.green and Thom,
Thanks for your quick reply!!!
i didn't mention that i use azure as SAAS and not as PAAS

Is it still possible to use sp_help_revlogin in order to export and import my logins ?
or maybe there is a different way for that?

I have both "Azure SQL login" and "AD integrated login"

Thanks in advance!
anthony.green
anthony.green
SSC Guru
SSC Guru (101K reputation)SSC Guru (101K reputation)SSC Guru (101K reputation)SSC Guru (101K reputation)SSC Guru (101K reputation)SSC Guru (101K reputation)SSC Guru (101K reputation)SSC Guru (101K reputation)

Group: General Forum Members
Points: 101380 Visits: 8698

Not that clued up on Azure as I work on government projects which we cant use the cloud, but does the following link help at all https://docs.microsoft.com/en-us/azure/sql-database/sql-database-copy





How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger


Grant Fritchey
Grant Fritchey
SSC Guru
SSC Guru (354K reputation)SSC Guru (354K reputation)SSC Guru (354K reputation)SSC Guru (354K reputation)SSC Guru (354K reputation)SSC Guru (354K reputation)SSC Guru (354K reputation)SSC Guru (354K reputation)

Group: General Forum Members
Points: 354828 Visits: 34368
89netanel - Monday, November 20, 2017 7:29 AM
Hi anthony.green and Thom,
Thanks for your quick reply!!!
i didn't mention that i use azure as SAAS and not as PAAS

Is it still possible to use sp_help_revlogin in order to export and import my logins ?
or maybe there is a different way for that?

I have both "Azure SQL login" and "AD integrated login"

Thanks in advance!


Nah, it's still a VM here (PaaS is just a database, no backups or restores available, so since you're doing a backup). It's the issues and solutions already identified.

----------------------------------------------------
The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
Theodore Roosevelt

The Scary DBA
Author of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd Edition
Product Evangelist for Red Gate Software
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search