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 2008 Forums
 SQL Server Administration (2008)
 Have 2008 DB files, but not the backup file

Author  Topic 

token
Posting Yak Master

133 Posts

Posted - 2012-09-21 : 14:47:40
Hi all!

I have found my old 2008 database file (.mdf) and log file and I want this database to appear in my new installation of SQL Server 2012. Unfortunately I don't have a .bak file for the database - I only have the actual DB files themselves.

What I have tried to do so far is create a new database with the same name as my old one but in SQL 2012 and then deleted the new DB files and replaced them with my old database files. However SQL 2012 is not happy with this and when I go to look at the database in Management Studio it says "recovery pending" and the database is inaccessible.

Any suggestions on what I can do please?

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-09-21 : 14:58:31
You can try to attach the database - follow the steps described here: http://msdn.microsoft.com/en-us/library/ms190209.aspx
Go to Top of Page

token
Posting Yak Master

133 Posts

Posted - 2012-09-21 : 16:55:30
thank you so much it worked :)
Go to Top of Page

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-09-22 : 12:47:29
Great, I am glad it worked!! Attaching a database may not always work correctly, if what I hear on the grapevine can be believed. In the future, if you want to move the database, rather than detaching and attaching, use backup/restore.
Go to Top of Page
   

- Advertisement -