Home All Groups Group Topic Archive Search About

Moving databases to a different partition

Author
6 Mar 2007 12:23 AM
Don Murphy
Is there a good resource that shows how to move the database file from one
drive partition to another for SQL 2005 SP2?

This is a new server with the default database getting ready for Sharepoint.
Right now I start "SQL Server Management Studio" and drill down to database
settings properties.

I see two entries:

C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA

one for data and one for log.

Is it as easy as stopping some service (please tell me which ones) and
changing these pats and restarting the services?


TIA

Author
6 Mar 2007 12:39 AM
Gail Erickson [MS]
> Is there a good resource that shows how to move the database file from one
> drive partition to another for SQL 2005 SP2?

See the section Planned Relocation Procedure in this Books Online topic
http://msdn2.microsoft.com/en-us/library/ms345483.aspx for step-by-step
instructions
--
Gail Erickson [MS]
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights
Download the latest version of Books Online from
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx

Show quote
"Don Murphy" <DonMur***@discussions.microsoft.com> wrote in message
news:F29306B2-D89B-467A-8096-B3807FEBBD60@microsoft.com...
> Is there a good resource that shows how to move the database file from one
> drive partition to another for SQL 2005 SP2?
>
> This is a new server with the default database getting ready for
> Sharepoint.
> Right now I start "SQL Server Management Studio" and drill down to
> database
> settings properties.
>
> I see two entries:
>
> C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA
>
> one for data and one for log.
>
> Is it as easy as stopping some service (please tell me which ones) and
> changing these pats and restarting the services?
>
>
> TIA
>
Author
6 Mar 2007 12:57 AM
Don Murphy
Thanks for the response.  Is there no way to do this with managementy studio?

or some other tool?  I am not an sql weeny...    ;)



Show quote
"Gail Erickson [MS]" wrote:

> > Is there a good resource that shows how to move the database file from one
> > drive partition to another for SQL 2005 SP2?
>
> See the section Planned Relocation Procedure in this Books Online topic
> http://msdn2.microsoft.com/en-us/library/ms345483.aspx for step-by-step
> instructions
> --
> Gail Erickson [MS]
> SQL Server Documentation Team
> This posting is provided "AS IS" with no warranties, and confers no rights
> Download the latest version of Books Online from
> http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
>
> "Don Murphy" <DonMur***@discussions.microsoft.com> wrote in message
> news:F29306B2-D89B-467A-8096-B3807FEBBD60@microsoft.com...
> > Is there a good resource that shows how to move the database file from one
> > drive partition to another for SQL 2005 SP2?
> >
> > This is a new server with the default database getting ready for
> > Sharepoint.
> > Right now I start "SQL Server Management Studio" and drill down to
> > database
> > settings properties.
> >
> > I see two entries:
> >
> > C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA
> >
> > one for data and one for log.
> >
> > Is it as easy as stopping some service (please tell me which ones) and
> > changing these pats and restarting the services?
> >
> >
> > TIA
> >
>
>
>
Author
6 Mar 2007 2:55 AM
Gail Erickson [MS]
>  Is there no way to do this with managementy studio?

Sure, you've got two choices that can be GUI-only tasks: Detach/attach or
Backup/Restore.

For Detach/Attach, see
http://msdn2.microsoft.com/en-us/library/ms191491.aspx  and
http://msdn2.microsoft.com/en-us/library/ms190209.aspx. Just remember to
physically move the files to the new location before you attach :>)   I
recommend making a full backup of the database prior to moving just as a
safeguard.

For Backup/Restore, I didn't find any how-to topics that were not T-SQL code
specific.  But you can certainly backup and restore a database using the GUI
in Management Studio and specify a new file location in the "Restore As"
part of the interface.

--
Gail Erickson [MS]
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights
Download the latest version of Books Online from
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx

Show quote
"Don Murphy" <DonMur***@discussions.microsoft.com> wrote in message
news:05163DE7-E9D7-46FB-A623-D40CB27266DA@microsoft.com...
> Thanks for the response.  Is there no way to do this with managementy
> studio?
>
> or some other tool?  I am not an sql weeny...    ;)
>
>
>
> "Gail Erickson [MS]" wrote:
>
>> > Is there a good resource that shows how to move the database file from
>> > one
>> > drive partition to another for SQL 2005 SP2?
>>
>> See the section Planned Relocation Procedure in this Books Online topic
>> http://msdn2.microsoft.com/en-us/library/ms345483.aspx for step-by-step
>> instructions
>> --
>> Gail Erickson [MS]
>> SQL Server Documentation Team
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights
>> Download the latest version of Books Online from
>> http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
>>
>> "Don Murphy" <DonMur***@discussions.microsoft.com> wrote in message
>> news:F29306B2-D89B-467A-8096-B3807FEBBD60@microsoft.com...
>> > Is there a good resource that shows how to move the database file from
>> > one
>> > drive partition to another for SQL 2005 SP2?
>> >
>> > This is a new server with the default database getting ready for
>> > Sharepoint.
>> > Right now I start "SQL Server Management Studio" and drill down to
>> > database
>> > settings properties.
>> >
>> > I see two entries:
>> >
>> > C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA
>> >
>> > one for data and one for log.
>> >
>> > Is it as easy as stopping some service (please tell me which ones) and
>> > changing these pats and restarting the services?
>> >
>> >
>> > TIA
>> >
>>
>>
>>
Author
6 Mar 2007 6:46 AM
Don Murphy
I can't just use the browse button in the pop up I identified above?

I used that technique to move exchange databases?



Show quote
"Gail Erickson [MS]" wrote:

> >  Is there no way to do this with managementy studio?
>
> Sure, you've got two choices that can be GUI-only tasks: Detach/attach or
> Backup/Restore.
>
> For Detach/Attach, see
> http://msdn2.microsoft.com/en-us/library/ms191491.aspx  and
> http://msdn2.microsoft.com/en-us/library/ms190209.aspx. Just remember to
> physically move the files to the new location before you attach :>)   I
> recommend making a full backup of the database prior to moving just as a
> safeguard.
>
> For Backup/Restore, I didn't find any how-to topics that were not T-SQL code
> specific.  But you can certainly backup and restore a database using the GUI
> in Management Studio and specify a new file location in the "Restore As"
> part of the interface.
>
> --
> Gail Erickson [MS]
> SQL Server Documentation Team
> This posting is provided "AS IS" with no warranties, and confers no rights
> Download the latest version of Books Online from
> http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
>
> "Don Murphy" <DonMur***@discussions.microsoft.com> wrote in message
> news:05163DE7-E9D7-46FB-A623-D40CB27266DA@microsoft.com...
> > Thanks for the response.  Is there no way to do this with managementy
> > studio?
> >
> > or some other tool?  I am not an sql weeny...    ;)
> >
> >
> >
> > "Gail Erickson [MS]" wrote:
> >
> >> > Is there a good resource that shows how to move the database file from
> >> > one
> >> > drive partition to another for SQL 2005 SP2?
> >>
> >> See the section Planned Relocation Procedure in this Books Online topic
> >> http://msdn2.microsoft.com/en-us/library/ms345483.aspx for step-by-step
> >> instructions
> >> --
> >> Gail Erickson [MS]
> >> SQL Server Documentation Team
> >> This posting is provided "AS IS" with no warranties, and confers no
> >> rights
> >> Download the latest version of Books Online from
> >> http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
> >>
> >> "Don Murphy" <DonMur***@discussions.microsoft.com> wrote in message
> >> news:F29306B2-D89B-467A-8096-B3807FEBBD60@microsoft.com...
> >> > Is there a good resource that shows how to move the database file from
> >> > one
> >> > drive partition to another for SQL 2005 SP2?
> >> >
> >> > This is a new server with the default database getting ready for
> >> > Sharepoint.
> >> > Right now I start "SQL Server Management Studio" and drill down to
> >> > database
> >> > settings properties.
> >> >
> >> > I see two entries:
> >> >
> >> > C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA
> >> >
> >> > one for data and one for log.
> >> >
> >> > Is it as easy as stopping some service (please tell me which ones) and
> >> > changing these pats and restarting the services?
> >> >
> >> >
> >> > TIA
> >> >
> >>
> >>
> >>
>
>
>
Author
6 Mar 2007 4:48 PM
Gail Erickson [MS]
>I can't just use the browse button in the pop up I identified above?

No, you cannot  change the directory path of the file in the Database
Properties pop up.  The detach and attach tasks are very straightforward and
easy to use.

--
Gail Erickson [MS]
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights
Download the latest version of Books Online from
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx

Show quote
"Don Murphy" <DonMur***@discussions.microsoft.com> wrote in message
news:D495ADA3-1FA0-4AF0-97BD-D001F5B8F6C6@microsoft.com...
>I can't just use the browse button in the pop up I identified above?
>
> I used that technique to move exchange databases?
>
>
>
> "Gail Erickson [MS]" wrote:
>
>> >  Is there no way to do this with managementy studio?
>>
>> Sure, you've got two choices that can be GUI-only tasks: Detach/attach or
>> Backup/Restore.
>>
>> For Detach/Attach, see
>> http://msdn2.microsoft.com/en-us/library/ms191491.aspx  and
>> http://msdn2.microsoft.com/en-us/library/ms190209.aspx. Just remember to
>> physically move the files to the new location before you attach :>)   I
>> recommend making a full backup of the database prior to moving just as a
>> safeguard.
>>
>> For Backup/Restore, I didn't find any how-to topics that were not T-SQL
>> code
>> specific.  But you can certainly backup and restore a database using the
>> GUI
>> in Management Studio and specify a new file location in the "Restore As"
>> part of the interface.
>>
>> --
>> Gail Erickson [MS]
>> SQL Server Documentation Team
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights
>> Download the latest version of Books Online from
>> http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
>>
>> "Don Murphy" <DonMur***@discussions.microsoft.com> wrote in message
>> news:05163DE7-E9D7-46FB-A623-D40CB27266DA@microsoft.com...
>> > Thanks for the response.  Is there no way to do this with managementy
>> > studio?
>> >
>> > or some other tool?  I am not an sql weeny...    ;)
>> >
>> >
>> >
>> > "Gail Erickson [MS]" wrote:
>> >
>> >> > Is there a good resource that shows how to move the database file
>> >> > from
>> >> > one
>> >> > drive partition to another for SQL 2005 SP2?
>> >>
>> >> See the section Planned Relocation Procedure in this Books Online
>> >> topic
>> >> http://msdn2.microsoft.com/en-us/library/ms345483.aspx for
>> >> step-by-step
>> >> instructions
>> >> --
>> >> Gail Erickson [MS]
>> >> SQL Server Documentation Team
>> >> This posting is provided "AS IS" with no warranties, and confers no
>> >> rights
>> >> Download the latest version of Books Online from
>> >> http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
>> >>
>> >> "Don Murphy" <DonMur***@discussions.microsoft.com> wrote in message
>> >> news:F29306B2-D89B-467A-8096-B3807FEBBD60@microsoft.com...
>> >> > Is there a good resource that shows how to move the database file
>> >> > from
>> >> > one
>> >> > drive partition to another for SQL 2005 SP2?
>> >> >
>> >> > This is a new server with the default database getting ready for
>> >> > Sharepoint.
>> >> > Right now I start "SQL Server Management Studio" and drill down to
>> >> > database
>> >> > settings properties.
>> >> >
>> >> > I see two entries:
>> >> >
>> >> > C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA
>> >> >
>> >> > one for data and one for log.
>> >> >
>> >> > Is it as easy as stopping some service (please tell me which ones)
>> >> > and
>> >> > changing these pats and restarting the services?
>> >> >
>> >> >
>> >> > TIA
>> >> >
>> >>
>> >>
>> >>
>>
>>
>>
Author
6 Mar 2007 11:20 PM
Erland Sommarskog
Don Murphy (DonMur***@discussions.microsoft.com) writes:
Show quote
> Is there a good resource that shows how to move the database file from one
> drive partition to another for SQL 2005 SP2?
>
> This is a new server with the default database getting ready for
> Sharepoint.
> Right now I start "SQL Server Management Studio" and drill down to
> database settings properties.
>
> I see two entries:
>
> C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA
>
> one for data and one for log.
>
> Is it as easy as stopping some service (please tell me which ones) and
> changing these pats and restarting the services?

No. That path is for the default of new databases. But if you haven't
created any databases yet, you can change this setting and then create
databases. No need to stop and start. (As for stopping and starting
services you do this from the SQL Server Configuration Manager, or the
Registered Servers window in Mgmt Studio.)

Since you don't seem very interesting in learning T-SQL commands for doing
this, you could try the Copy Database Wizard, using the attach/detach
method. You find it by right-clicking the database and select the
Tasks submenu.


--
Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

AddThis Social Bookmark Button