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
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 BAK --> Empty Server with no related databases

Author  Topic 

mikebird
Aged Yak Warrior

529 Posts

Posted - 2010-05-14 : 06:14:21

I have a full, 3Gb .bak file to restore.

I've created a new DB instance, with just master, model, msdb & tempdb, plus ReportServer and its tempDB.

How do I restore this BAK? The first dropdown prompts for the database to put this into. I can't, because it doesn't exist.

I was expecting an .mdf file to attach. Would that be better? Can a BAK be restored without the associated DB?

I spoke to the support bloke and he says the BAK is what I need. I think I would need a script to build an empty DB infrastructure first, or just get an .mdf initially. Am I right? Do I have any options?

Thanks

Kristen
Test

22859 Posts

Posted - 2010-05-14 : 06:56:18
If you do it from SSMS then I think the database has to exist. Just create one ...

Then make sure you look at the OPTIONS tab and change the target path for the MDF / LDF (they will be set as-per the database the backup was made from, you will need to change the name to something more appropriate for your database, and possibly the Path too.

You should also change the Logical Name (assuming you can do that from SSMS, I can't remember)

And you may have to choose the OVERWRITE option (be very careful you aren't overwriting something you didn't mean to!

Personally I would prefer a backup file to attaching the MDF/LDF but technically either will do.
Go to Top of Page

mikebird
Aged Yak Warrior

529 Posts

Posted - 2010-05-14 : 10:21:00
I like that you agree.

After a bit of fiddling, I think it might be possible to restore a BAK file, by creating a new database, on the fly, although I've never done it yet.

When you specify the BAK file, and look in the top dropdown of databases, one appears in the list which doesn't currently exist - the NAME of the database where the FULL backup came from. The error caused seems to be elsewhere - rather than using the BAK file specified, it's complaining about not finding an .mdf file on an E:\ CD.

Has anyone encountered this before?
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-05-14 : 10:39:28
Check the File/Path on the OPTIONS tab (once you have done "Add a device" to add the Backup File to restore from. Is that pointing to E:?

I find it much easier to restore using the SQL Command syntax ... but ... you kinda have to know what you are doing to do it that way. I helped someone restore a file with SSMS, over the phone, yesterday and it took us ages to work out which options had to be selected. Strikes me it could do with a wizard:

Choose backup filename
Restore to New database, or existing one?
...
Go to Top of Page

mikebird
Aged Yak Warrior

529 Posts

Posted - 2010-05-14 : 11:23:17
Also, is there a difference between right-clicking 'Databases' at the top of the tree, or right-clicking an existing database?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-05-14 : 12:09:44
Yes there's a different as right-clicking on databases is how you can restore a database that doesn't exist.

Do not bother looking in the list in the GUI, just go to devices to add the bak file.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -