Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

Database restore Expand / Collapse
Author
Message
Posted Tuesday, January 8, 2013 2:40 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, April 22, 2014 7:29 AM
Points: 8, Visits: 19
Hello All,
I hope and I'm sure to find an answer with all the experts on this forum.
Well this is the situation, this is in my home lab and I'm looking to restore an SQl Express 2005 DB to a 2008 SQL server is possible using just the MDF and the LDF files? (no migration no backup and restore)
I've looked around the web and what I can see is attaching these two files to the SQL 2008 server would be enough?
one other thing is that I no longer have the credentials of the user account where this SQL Express DB is created?
Post #1404075
Posted Tuesday, January 8, 2013 2:48 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, August 19, 2014 12:26 AM
Points: 2,840, Visits: 3,963
you need to test (as i havent tried this )but i think you cant restore database of prior versions.

-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done
Post #1404078
Posted Tuesday, January 8, 2013 2:54 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 8:36 AM
Points: 5,308, Visits: 9,700
There shouldn't be a problem with the version difference. Have you tried it, though? That's the best way of finding out. It will depend on whether the database was cleanly shut down - it's possible that the files will be corrupt otherwise. Don't worry about the security - you can fix that once you've successfully attached the databases.

John
Post #1404081
Posted Tuesday, January 8, 2013 3:12 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, April 22, 2014 7:29 AM
Points: 8, Visits: 19
Thanks for that,
Post #1404088
Posted Tuesday, January 8, 2013 3:18 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 7:54 AM
Points: 42,768, Visits: 35,867
mourad.b (1/8/2013)

Well this is the situation, this is in my home lab and I'm looking to restore an SQl Express 2005 DB to a 2008 SQL server is possible using just the MDF and the LDF files?


Yes, absolutely it is possible

I've looked around the web and what I can see is attaching these two files to the SQL 2008 server would be enough?


Correct, that's all that's needed.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1404089
Posted Tuesday, January 8, 2013 3:20 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 7:54 AM
Points: 42,768, Visits: 35,867
John Mitchell-245523 (1/8/2013)
It will depend on whether the database was cleanly shut down - it's possible that the files will be corrupt otherwise.


That's attaching without the log file. When you have both files, doesn't matter if SQL was cleanly shut down or not.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1404090
Posted Tuesday, January 8, 2013 3:25 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, April 22, 2014 7:29 AM
Points: 8, Visits: 19
John Mitchell-245523 (1/8/2013)
There shouldn't be a problem with the version difference. Have you tried it, though? That's the best way of finding out. It will depend on whether the database was cleanly shut down - it's possible that the files will be corrupt otherwise. Don't worry about the security - you can fix that once you've successfully attached the databases.

John


No I havent tried this yet, but will give it a try this evening.
I presume that the SQL Express was cleanly shutdown and I will give it a try later on tonight.

All the best and Thanks
Post #1404094
Posted Tuesday, January 8, 2013 3:40 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 8:36 AM
Points: 5,308, Visits: 9,700
GilaMonster (1/8/2013)
John Mitchell-245523 (1/8/2013)
It will depend on whether the database was cleanly shut down - it's possible that the files will be corrupt otherwise.


That's attaching without the log file. When you have both files, doesn't matter if SQL was cleanly shut down or not.

Thanks Gail - I didn't realise that. Do you happen to know whether it also applies if, for example, the LDF and MDF were backed up using open file agents?

John
Post #1404101
Posted Tuesday, January 8, 2013 4:12 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 7:54 AM
Points: 42,768, Visits: 35,867
John Mitchell-245523 (1/8/2013)
Do you happen to know whether it also applies if, for example, the LDF and MDF were backed up using open file agents?


Yes I do, and no it doesn't.

Unless the file backup tool either quiesced the IOs prior to the backup or somehow managed to copy the files at exactly the same nanosecond, there's a chance that the files are as of different points in time (small difference, but that's all it takes), and will fail to attach. If the log file was copied a smidgen later than the data file, the resultant files will probably attach. If the data file was copied a smidgen later than the log file, the resultant files probably won't attach.

Files that are copied when SQL is stopped or when the DB is offline or detached are static. Files that are copied while the database is active are not, and that's what may well make them not attach.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1404124
Posted Tuesday, January 8, 2013 4:18 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 8:36 AM
Points: 5,308, Visits: 9,700
GilaMonster (1/8/2013)
Files that are copied when SQL is stopped or when the DB is offline or detached are static. Files that are copied while the database is active are not, and that's what may well make them not attach.

Thanks for clarifying, Gail. That's what I was getting at when I talked about the database being cleanly shut down. Since the original post didn't mention how the files were obtained, I thought it safer not to assume.

John
Post #1404132
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse