Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 db restore lost all the users.

Author  Topic 

funketekun
Constraint Violating Yak Guru

491 Posts

Posted - 2007-05-18 : 13:46:48
i restored a database from a .bak file.
from production to development.



But i dropped the database from development before restoring. Now all the users are gone from this database. Anyone know how to recover them?

the users from development are different from production's


rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-05-18 : 14:33:09
You can get user list with sp_helpuser then remap them with sp_change_users_login.
Go to Top of Page

funketekun
Constraint Violating Yak Guru

491 Posts

Posted - 2007-05-18 : 16:05:58
sp_helpuser only displays the username from the original DB (production DB).
I want the usernames from the Dropped DB (Development DB).

e.g.
I drop DBTEST from Development server. User: funketekun
backup DBTEST from Production with extension .bak. User: Mario
Paste the .bak file accross the network to Development server. Restore .bak on Development Server. Username funketekun is missing. Mario is there only.

I will like to get back the username funketekun
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-05-18 : 16:31:30
No way even you didn't drop it since restoring will overwrite existing db, unless you create a new db then restore to it.
Go to Top of Page

funketekun
Constraint Violating Yak Guru

491 Posts

Posted - 2007-05-18 : 16:58:26
no way i can recover the usernames?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-05-18 : 17:06:41
Restore from backups.

Tara Kizer
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-05-18 : 17:10:30
backups? what are those???

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

funketekun
Constraint Violating Yak Guru

491 Posts

Posted - 2007-05-18 : 17:11:34
i restored from the backup file.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-05-19 : 06:46:38
See: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=12615#228994
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-05-19 : 20:21:47
Have to restore from dev db's backup to get user list.
Go to Top of Page

funketekun
Constraint Violating Yak Guru

491 Posts

Posted - 2007-05-20 : 19:31:53
rmiao,

i dropped the DB from Dev. The backup is from Production. But they have different usernames.
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-05-20 : 20:30:01
Then you can't get them.
Go to Top of Page

mr_mist
Grunnio

1870 Posts

Posted - 2007-05-21 : 05:39:01
If you want the original set of users adding in then you will need to re-map the development logins.

-------
Moo. :)
Go to Top of Page

funketekun
Constraint Violating Yak Guru

491 Posts

Posted - 2007-05-21 : 11:39:29
mr_mist,
how will you do that?
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-05-21 : 11:43:03
Did you try the link I posted above, i.e.

See: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=12615#228994

??
Go to Top of Page
   

- Advertisement -