Home All Groups Group Topic Archive Search About

problem restoring backup of DB

Author
17 Feb 2006 5:12 PM
Rich
Hello,

I copied a backup file of a production DB on a production server to another
location on a Development server.  When I try to restore this backup on the
Dev server - from Enterprise Manager,  I am getting an error message that
states I need to use "With Move" to identify a valid location for the restore
file. 

On the Restore Database Dialog I enter the name of the mdf file (which is
not in the dropdown list) in the "Restore as database" textbox.  Then I
select the device - "Restore from"  Disk, click on Add - select the bak file,
click OK from that dialog, goto the Options tab and  enter the physical path
in the "Move to physical file name" window.  Then click OK on the Restore
Database dialog and get the error message above - "use With Move..."  How do
I use "With Move"?

I also copied the actual mdf file from the production server and moved it to
the Dev server and tried to attach it to the Dev serve.  But the mdf is
trying to reference the old Log file.  I thought (hoped) it would create its
own log file.  Is there a way to get around this?

Thanks,
Rich

Author
17 Feb 2006 5:24 PM
Mark Williams
> I also copied the actual mdf file from the production server and moved it to
> the Dev server and tried to attach it to the Dev serve.  But the mdf is
> trying to reference the old Log file.  I thought (hoped) it would create its
> own log file.  Is there a way to get around this?
>

Did you detach the database first, before copying the mdf file?

If not, try detaching the DB, then copying the file(s), then re-attaching to
the other server.
Author
17 Feb 2006 5:36 PM
Rich
The file is a replication DB and I did not want to fiddle with
sp_removereplication.  Otherwise I would have used the Copy Database wizard.
But since it is in Replication mode, I can't detach it or use the Copy
Database wizard. 

What I did was to stop the production server for a few minutes, copied the
file to the dev server - restart the prod server.  I did not copy the ldf
because it was kind of large.  I was hoping the copy DB would create its own
log file on the Dev server.  Is there a way to force that to happen?

Or am I stuck with using sp_removeReplication and then doing the copy?

Show quote
"Mark Williams" wrote:

> > I also copied the actual mdf file from the production server and moved it to
> > the Dev server and tried to attach it to the Dev serve.  But the mdf is
> > trying to reference the old Log file.  I thought (hoped) it would create its
> > own log file.  Is there a way to get around this?
> >
>
> Did you detach the database first, before copying the mdf file?
>
> If not, try detaching the DB, then copying the file(s), then re-attaching to
> the other server.
Author
17 Feb 2006 5:50 PM
Grant
You will need the ldf file along with your mdf file. What you did is the
same as detach method except you shut MS SQL server down for a few minutes.



Show quote
"Rich" <R***@discussions.microsoft.com> wrote in message
news:625F97FE-6DC8-4DB3-95AE-392A7CCAB396@microsoft.com...
> The file is a replication DB and I did not want to fiddle with
> sp_removereplication.  Otherwise I would have used the Copy Database
> wizard.
> But since it is in Replication mode, I can't detach it or use the Copy
> Database wizard.
>
> What I did was to stop the production server for a few minutes, copied the
> file to the dev server - restart the prod server.  I did not copy the ldf
> because it was kind of large.  I was hoping the copy DB would create its
> own
> log file on the Dev server.  Is there a way to force that to happen?
>
> Or am I stuck with using sp_removeReplication and then doing the copy?
>
> "Mark Williams" wrote:
>
>> > I also copied the actual mdf file from the production server and moved
>> > it to
>> > the Dev server and tried to attach it to the Dev serve.  But the mdf is
>> > trying to reference the old Log file.  I thought (hoped) it would
>> > create its
>> > own log file.  Is there a way to get around this?
>> >
>>
>> Did you detach the database first, before copying the mdf file?
>>
>> If not, try detaching the DB, then copying the file(s), then re-attaching
>> to
>> the other server.
Author
17 Feb 2006 6:03 PM
Rich
Yeah, I figured I would have to do that.  the ldf is like 3 gigs +.  So once
I get the DB attached, what is the best way to shrink down the ldf?  Can I
delete it once the mdf is attached and it will create a new one?

Show quote
"Grant" wrote:

> You will need the ldf file along with your mdf file. What you did is the
> same as detach method except you shut MS SQL server down for a few minutes.
>
>
>
> "Rich" <R***@discussions.microsoft.com> wrote in message
> news:625F97FE-6DC8-4DB3-95AE-392A7CCAB396@microsoft.com...
> > The file is a replication DB and I did not want to fiddle with
> > sp_removereplication.  Otherwise I would have used the Copy Database
> > wizard.
> > But since it is in Replication mode, I can't detach it or use the Copy
> > Database wizard.
> >
> > What I did was to stop the production server for a few minutes, copied the
> > file to the dev server - restart the prod server.  I did not copy the ldf
> > because it was kind of large.  I was hoping the copy DB would create its
> > own
> > log file on the Dev server.  Is there a way to force that to happen?
> >
> > Or am I stuck with using sp_removeReplication and then doing the copy?
> >
> > "Mark Williams" wrote:
> >
> >> > I also copied the actual mdf file from the production server and moved
> >> > it to
> >> > the Dev server and tried to attach it to the Dev serve.  But the mdf is
> >> > trying to reference the old Log file.  I thought (hoped) it would
> >> > create its
> >> > own log file.  Is there a way to get around this?
> >> >
> >>
> >> Did you detach the database first, before copying the mdf file?
> >>
> >> If not, try detaching the DB, then copying the file(s), then re-attaching
> >> to
> >> the other server.
>
>
>
Author
17 Feb 2006 6:17 PM
Tibor Karaszi
> I get the DB attached, what is the best way to shrink down the ldf?

You shrink if *before* you detach. Or after you have attached. Use DBCC SHRINKFILE.

Show quote
"Rich" <R***@discussions.microsoft.com> wrote in message
news:D1264111-609E-4190-922C-A88BB233D0CB@microsoft.com...
> Yeah, I figured I would have to do that.  the ldf is like 3 gigs +.  So once
> I get the DB attached, what is the best way to shrink down the ldf?  Can I
> delete it once the mdf is attached and it will create a new one?
>
> "Grant" wrote:
>
>> You will need the ldf file along with your mdf file. What you did is the
>> same as detach method except you shut MS SQL server down for a few minutes.
>>
>>
>>
>> "Rich" <R***@discussions.microsoft.com> wrote in message
>> news:625F97FE-6DC8-4DB3-95AE-392A7CCAB396@microsoft.com...
>> > The file is a replication DB and I did not want to fiddle with
>> > sp_removereplication.  Otherwise I would have used the Copy Database
>> > wizard.
>> > But since it is in Replication mode, I can't detach it or use the Copy
>> > Database wizard.
>> >
>> > What I did was to stop the production server for a few minutes, copied the
>> > file to the dev server - restart the prod server.  I did not copy the ldf
>> > because it was kind of large.  I was hoping the copy DB would create its
>> > own
>> > log file on the Dev server.  Is there a way to force that to happen?
>> >
>> > Or am I stuck with using sp_removeReplication and then doing the copy?
>> >
>> > "Mark Williams" wrote:
>> >
>> >> > I also copied the actual mdf file from the production server and moved
>> >> > it to
>> >> > the Dev server and tried to attach it to the Dev serve.  But the mdf is
>> >> > trying to reference the old Log file.  I thought (hoped) it would
>> >> > create its
>> >> > own log file.  Is there a way to get around this?
>> >> >
>> >>
>> >> Did you detach the database first, before copying the mdf file?
>> >>
>> >> If not, try detaching the DB, then copying the file(s), then re-attaching
>> >> to
>> >> the other server.
>>
>>
>>
Author
17 Feb 2006 6:19 PM
Tibor Karaszi
Following or explaining GUI in text is incredibly hard. I suggest you investigate the file structure
of your backup using RESTORE FILELISTONLY. And based on that construct a RESTORE command with the
proper commands. If restore from that doesn't work, you can post the output from RESTORE
FILELISTONLY, your RESTORE command you tried and the error message.

Show quote
"Rich" <R***@discussions.microsoft.com> wrote in message
news:665B37F8-7FBD-4F62-9939-BFE283A242A7@microsoft.com...
> Hello,
>
> I copied a backup file of a production DB on a production server to another
> location on a Development server.  When I try to restore this backup on the
> Dev server - from Enterprise Manager,  I am getting an error message that
> states I need to use "With Move" to identify a valid location for the restore
> file.
>
> On the Restore Database Dialog I enter the name of the mdf file (which is
> not in the dropdown list) in the "Restore as database" textbox.  Then I
> select the device - "Restore from"  Disk, click on Add - select the bak file,
> click OK from that dialog, goto the Options tab and  enter the physical path
> in the "Move to physical file name" window.  Then click OK on the Restore
> Database dialog and get the error message above - "use With Move..."  How do
> I use "With Move"?
>
> I also copied the actual mdf file from the production server and moved it to
> the Dev server and tried to attach it to the Dev serve.  But the mdf is
> trying to reference the old Log file.  I thought (hoped) it would create its
> own log file.  Is there a way to get around this?
>
> Thanks,
> Rich
Author
17 Feb 2006 6:48 PM
Rich
Thank you for your suggestion.  Here is what Restore Filelist returned:
Subscriber_Data    D:\MSSQLDATA\Subscriber_Data.MDF    D    PRIMARY    654573568    35184372080640
Subscriber_Log    E:\MSSQLLOGS\Subscriber_log.LDF    L    NULL    2818572288    35184372080640


And here is what I tried with Restore Database - which is currently running

RESTORE DATABASE Subscriber
   FROM DISK = 'G:\MSSQL\DevData\MSSQL$Dev\Backup\Subscriber.bak'
   WITH MOVE 'Subscriber' TO
'G:\MSSQL\DevData\MSSQL$Dev\Backup\Subscriber_Data.mdf',
   MOVE 'Subscriber_log' TO
'G:\MSSQL\DevData\MSSQL$Dev\Backup\Subscriber_Log.ldf'

I will post the results of this restore effort - still running - probably
for an hour or so.



Show quote
"Tibor Karaszi" wrote:

> Following or explaining GUI in text is incredibly hard. I suggest you investigate the file structure
> of your backup using RESTORE FILELISTONLY. And based on that construct a RESTORE command with the
> proper commands. If restore from that doesn't work, you can post the output from RESTORE
> FILELISTONLY, your RESTORE command you tried and the error message.
>
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
>
> "Rich" <R***@discussions.microsoft.com> wrote in message
> news:665B37F8-7FBD-4F62-9939-BFE283A242A7@microsoft.com...
> > Hello,
> >
> > I copied a backup file of a production DB on a production server to another
> > location on a Development server.  When I try to restore this backup on the
> > Dev server - from Enterprise Manager,  I am getting an error message that
> > states I need to use "With Move" to identify a valid location for the restore
> > file.
> >
> > On the Restore Database Dialog I enter the name of the mdf file (which is
> > not in the dropdown list) in the "Restore as database" textbox.  Then I
> > select the device - "Restore from"  Disk, click on Add - select the bak file,
> > click OK from that dialog, goto the Options tab and  enter the physical path
> > in the "Move to physical file name" window.  Then click OK on the Restore
> > Database dialog and get the error message above - "use With Move..."  How do
> > I use "With Move"?
> >
> > I also copied the actual mdf file from the production server and moved it to
> > the Dev server and tried to attach it to the Dev serve.  But the mdf is
> > trying to reference the old Log file.  I thought (hoped) it would create its
> > own log file.  Is there a way to get around this?
> >
> > Thanks,
> > Rich
>
>
Author
18 Feb 2006 8:22 AM
Tibor Karaszi
The restore command looks fine with one comment, and I also noticed the other post where you said it
was successful.

The comment is that you specified the location for the database files to be created by your restore
process to be in the Backup directory. Not that it is harmful, but perhaps a little bit unusual.

Show quote
"Rich" <R***@discussions.microsoft.com> wrote in message
news:C2E59AEB-3FF8-4930-B0E6-DDACEE2B9104@microsoft.com...
> Thank you for your suggestion.  Here is what Restore Filelist returned:
>
> Subscriber_Data D:\MSSQLDATA\Subscriber_Data.MDF D PRIMARY 654573568 35184372080640
>
> Subscriber_Log E:\MSSQLLOGS\Subscriber_log.LDF L NULL 2818572288 35184372080640
>
>
> And here is what I tried with Restore Database - which is currently running
>
> RESTORE DATABASE Subscriber
>   FROM DISK = 'G:\MSSQL\DevData\MSSQL$Dev\Backup\Subscriber.bak'
>   WITH MOVE 'Subscriber' TO
> 'G:\MSSQL\DevData\MSSQL$Dev\Backup\Subscriber_Data.mdf',
>   MOVE 'Subscriber_log' TO
> 'G:\MSSQL\DevData\MSSQL$Dev\Backup\Subscriber_Log.ldf'
>
> I will post the results of this restore effort - still running - probably
> for an hour or so.
>
>
>
> "Tibor Karaszi" wrote:
>
>> Following or explaining GUI in text is incredibly hard. I suggest you investigate the file
>> structure
>> of your backup using RESTORE FILELISTONLY. And based on that construct a RESTORE command with the
>> proper commands. If restore from that doesn't work, you can post the output from RESTORE
>> FILELISTONLY, your RESTORE command you tried and the error message.
>>
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>> Blog: http://solidqualitylearning.com/blogs/tibor/
>>
>>
>> "Rich" <R***@discussions.microsoft.com> wrote in message
>> news:665B37F8-7FBD-4F62-9939-BFE283A242A7@microsoft.com...
>> > Hello,
>> >
>> > I copied a backup file of a production DB on a production server to another
>> > location on a Development server.  When I try to restore this backup on the
>> > Dev server - from Enterprise Manager,  I am getting an error message that
>> > states I need to use "With Move" to identify a valid location for the restore
>> > file.
>> >
>> > On the Restore Database Dialog I enter the name of the mdf file (which is
>> > not in the dropdown list) in the "Restore as database" textbox.  Then I
>> > select the device - "Restore from"  Disk, click on Add - select the bak file,
>> > click OK from that dialog, goto the Options tab and  enter the physical path
>> > in the "Move to physical file name" window.  Then click OK on the Restore
>> > Database dialog and get the error message above - "use With Move..."  How do
>> > I use "With Move"?
>> >
>> > I also copied the actual mdf file from the production server and moved it to
>> > the Dev server and tried to attach it to the Dev serve.  But the mdf is
>> > trying to reference the old Log file.  I thought (hoped) it would create its
>> > own log file.  Is there a way to get around this?
>> >
>> > Thanks,
>> > Rich
>>
>>
Author
17 Feb 2006 6:57 PM
Rich
Success!!!   Thank you very much for your help.  The restore DB works
perfectly!

Show quote
"Tibor Karaszi" wrote:

> Following or explaining GUI in text is incredibly hard. I suggest you investigate the file structure
> of your backup using RESTORE FILELISTONLY. And based on that construct a RESTORE command with the
> proper commands. If restore from that doesn't work, you can post the output from RESTORE
> FILELISTONLY, your RESTORE command you tried and the error message.
>
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
>
> "Rich" <R***@discussions.microsoft.com> wrote in message
> news:665B37F8-7FBD-4F62-9939-BFE283A242A7@microsoft.com...
> > Hello,
> >
> > I copied a backup file of a production DB on a production server to another
> > location on a Development server.  When I try to restore this backup on the
> > Dev server - from Enterprise Manager,  I am getting an error message that
> > states I need to use "With Move" to identify a valid location for the restore
> > file.
> >
> > On the Restore Database Dialog I enter the name of the mdf file (which is
> > not in the dropdown list) in the "Restore as database" textbox.  Then I
> > select the device - "Restore from"  Disk, click on Add - select the bak file,
> > click OK from that dialog, goto the Options tab and  enter the physical path
> > in the "Move to physical file name" window.  Then click OK on the Restore
> > Database dialog and get the error message above - "use With Move..."  How do
> > I use "With Move"?
> >
> > I also copied the actual mdf file from the production server and moved it to
> > the Dev server and tried to attach it to the Dev serve.  But the mdf is
> > trying to reference the old Log file.  I thought (hoped) it would create its
> > own log file.  Is there a way to get around this?
> >
> > Thanks,
> > Rich
>
>

AddThis Social Bookmark Button