Restore 2008R2Express DB to 2012Express DB

  • I am trying to restore a SQL Express 2008R2 DB to a 2012 Express DB and it's failing with a security error.

    I created a full backup from the 2008R2 DB. Then created a DB in 2012 with the same name. When executing the Backup function to restore the 2008DB to the 2012 DB I get the following security error. What am I missing here?

    TITLE: Microsoft SQL Server Management Studio

    ------------------------------

    Restore of database 'Lepton' failed. (Microsoft.SqlServer.Management.RelationalEngineTasks)

    ------------------------------

    ADDITIONAL INFORMATION:

    System.Data.SqlClient.SqlError: The operating system returned the error '5(Access is denied.)' while attempting 'RestoreContainer::ValidateTargetForCreation' on 'c:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS2008R2\MSSQL\DATA\Lepton.mdf'. (Microsoft.SqlServer.SmoExtended)

    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=11.0.3000.0+((SQL11_PCU_Main).121019-1325+)&LinkId=20476

    Thanks,

    Bill

  • i think both the 2008R2 and the 2012 are on the same server, right?

    when you try to restore that 2008R2 backup, it's remembering where it's mdf and ldf files were last stored on the disk...see your error message references a file in a 2008R2 folder....and it still exists.

    simply change the path for the mdf and ldf files so they will be appropriate for the 2012 instance.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Yes, bot instances of SQLExpress are on the same local machine. Ok, thanks. I'll look at that. I see your point here. I noted that SSMS seemed to be pointing to the 2008R2 mdf but I am restoring from a backup file ( xxx.bak ) which was confusing me.

    I'll have to look a this. Not sure where you would change file paths in the SSMS interface for a Restore operation ( never had to before ).

    Bill

  • Ok, manually changing the file paths fixed it. Don't like this though. In SSMS if I specify a DB as a target to to be restored it seems to me that SSMS should "default" to the mdf/ldf of the specified DB, not one with the same/similar name in another engine just because it "knows" about it.

    Thanks,

    Bill

  • Great! You said it all.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply