Home All Groups Group Topic Archive Search About

moving dB to new server and recreate login?

Author
22 Sep 2006 4:09 PM
geek-y-guy
Hi All: I'm missing a basic concept in SQL2005 Security.

I have a dB on a staging server set up like:

dBname: someDBname
login: someDBname --mapped as dbo

where the database and the dbo login have the same name

I want to move the dB to a live server, so I detach the dB, copy it to the
live server, and attach it to the live server.

When I examine the dB on the live server using SSMS, it still has the
username in it.

Now I need to recreate the login...but if I create a new login with the same
name as before, and try to map it to the existing username in the dB, I get
an error "The server principal 'someDBname' already exists"

In the past, I've just created a new login like "someDBname2" and mapped it
to the "someDBname" user, but I would prefer to be able to preserve the
original login...and I'm not sure I understand what I'm doing wrong?

Author
22 Sep 2006 4:30 PM
Arnie Rowland
This article may be useful for you.

http://www.support.microsoft.com/?id=314546

--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc

Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous


Show quote
"geek-y-guy" <no***@nowhere.org> wrote in message
news:uVWG%23Gm3GHA.324@TK2MSFTNGP05.phx.gbl...
> Hi All: I'm missing a basic concept in SQL2005 Security.
>
> I have a dB on a staging server set up like:
>
> dBname: someDBname
> login: someDBname --mapped as dbo
>
> where the database and the dbo login have the same name
>
> I want to move the dB to a live server, so I detach the dB, copy it to the
> live server, and attach it to the live server.
>
> When I examine the dB on the live server using SSMS, it still has the
> username in it.
>
> Now I need to recreate the login...but if I create a new login with the
> same name as before, and try to map it to the existing username in the dB,
> I get an error "The server principal 'someDBname' already exists"
>
> In the past, I've just created a new login like "someDBname2" and mapped
> it to the "someDBname" user, but I would prefer to be able to preserve the
> original login...and I'm not sure I understand what I'm doing wrong?
>
>
>
Author
25 Sep 2006 3:53 PM
Keith.Wilson@nospam.microsoft.com
In addition to the link provided by Arnie, SQL Server 2005 Service Pack 2
includes a more robust "Copy Database Wizard" feature and documentation which
allows the copy or move of a database and related objects from source
instances such as SQL Server 2000, SQL Server 2005, and SQL Express.

Regards,

Keith Wilson
Microsoft SQL Server

Keith.Wilson@nospam.microsoft.com
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


Show quote
"Arnie Rowland" wrote:

> This article may be useful for you.
>
> http://www.support.microsoft.com/?id=314546
>
> --
> Arnie Rowland, Ph.D.
> Westwood Consulting, Inc
>
> Most good judgment comes from experience.
> Most experience comes from bad judgment.
> - Anonymous
>
>
> "geek-y-guy" <no***@nowhere.org> wrote in message
> news:uVWG%23Gm3GHA.324@TK2MSFTNGP05.phx.gbl...
> > Hi All: I'm missing a basic concept in SQL2005 Security.
> >
> > I have a dB on a staging server set up like:
> >
> > dBname: someDBname
> > login: someDBname --mapped as dbo
> >
> > where the database and the dbo login have the same name
> >
> > I want to move the dB to a live server, so I detach the dB, copy it to the
> > live server, and attach it to the live server.
> >
> > When I examine the dB on the live server using SSMS, it still has the
> > username in it.
> >
> > Now I need to recreate the login...but if I create a new login with the
> > same name as before, and try to map it to the existing username in the dB,
> > I get an error "The server principal 'someDBname' already exists"
> >
> > In the past, I've just created a new login like "someDBname2" and mapped
> > it to the "someDBname" user, but I would prefer to be able to preserve the
> > original login...and I'm not sure I understand what I'm doing wrong?
> >
> >
> >
>
>
>
Author
30 Sep 2006 4:24 PM
geek-y-guy
> In addition to the link provided by Arnie, SQL Server 2005 Service Pack 2
> includes a more robust "Copy Database Wizard" feature and documentation
> which
> allows the copy or move of a database and related objects from source
> instances such as SQL Server 2000, SQL Server 2005, and SQL Express.
>
> Regards,
>
> Keith Wilson
> Microsoft SQL Server


Hi Keith: Where is Service Pack 2? Has it been officially released yet? I
don't see it on M$oft's public site?


Show quote
>
> Keith.Wilson@nospam.microsoft.com
> ==================================================
>
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
>
> ==================================================
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
>
> "Arnie Rowland" wrote:
>
>> This article may be useful for you.
>>
>> http://www.support.microsoft.com/?id=314546
>>
>> --
>> Arnie Rowland, Ph.D.
>> Westwood Consulting, Inc
>>
>> Most good judgment comes from experience.
>> Most experience comes from bad judgment.
>> - Anonymous
>>
>>
>> "geek-y-guy" <no***@nowhere.org> wrote in message
>> news:uVWG%23Gm3GHA.324@TK2MSFTNGP05.phx.gbl...
>> > Hi All: I'm missing a basic concept in SQL2005 Security.
>> >
>> > I have a dB on a staging server set up like:
>> >
>> > dBname: someDBname
>> > login: someDBname --mapped as dbo
>> >
>> > where the database and the dbo login have the same name
>> >
>> > I want to move the dB to a live server, so I detach the dB, copy it to
>> > the
>> > live server, and attach it to the live server.
>> >
>> > When I examine the dB on the live server using SSMS, it still has the
>> > username in it.
>> >
>> > Now I need to recreate the login...but if I create a new login with the
>> > same name as before, and try to map it to the existing username in the
>> > dB,
>> > I get an error "The server principal 'someDBname' already exists"
>> >
>> > In the past, I've just created a new login like "someDBname2" and
>> > mapped
>> > it to the "someDBname" user, but I would prefer to be able to preserve
>> > the
>> > original login...and I'm not sure I understand what I'm doing wrong?
>> >
>> >
>> >
>>
>>
>>

AddThis Social Bookmark Button