How to upgrade a database from localdb/v11.0 to localdb/mssqllocaldb without errors?

Visual Studio says I need to upgrade the database file. So I to try to attach the database file again. But whenever I attach, I get the following error-

So how can I upgrade it? Thanks. 


Note: I have moved the database from one computer to the other. 


August 27th, 2015 8:11am

Hi Lydia

Thanks for the response. Sorry for the delay in responding. I have got an intact copy of the database before attaching it to localdb/mssqllocaldb. It works fine if I open it through v11.0. I've tried many times to detach it from v11.0 and attach it to localdb/mssqllocald. In doing so, the database came up with above error. There might be something wrong with the structure of the database that localdb/mssqllocaldb doesn't like. I had many other databases that I'd transformed fine. 

Is there any other way that I could attached it without getting the error? I have a copy of the database that works fine in v11.0, hence, not corrupt. 


Free Windows Admin Tool Kit Click here and download it now
September 3rd, 2015 10:12am

Hi Bhupinder,

Could you please back up the database firstly in localdb/V11.0 instance and then restore it in localdb/mssqllocaldb instance? The database should also work properly in Visual Studio after being restored to localdb/mssqllocaldb.

Thanks,
L
September 4th, 2015 7:39am

Lydia, how can I restore the backup file that I make in v11.0? When I open it in mssqllocaldb, there is no option for using the backup file i made in v11.0. 

Is there a script that I can run to do the same? 

Thanks. 

Free Windows Admin Tool Kit Click here and download it now
September 4th, 2015 10:53am

Hi Bhupinder,

You can follow the steps in this similar blog to restore your database. Or you can restore database by using T-SQL scripts, for more details, please review this article.

Thanks,
Lydia Zhang

September 6th, 2015 11:17pm

Thanks Lydia,

I tried the method specified in the Blog, it still doesn't work! And the method is for creating a backup file in v11.0 and restoring back in v11.0. However, when I try to restore the backup file, it doesn't show up "backup set to restore", unlike the blog (as shown below). 

Is there any other way that I could upgrade my database to mssqllocaldb from v11.0? 

Free Windows Admin Tool Kit Click here and download it now
September 7th, 2015 8:09am

Hi Bhupinder,

When restoring database to localdb/mssqllocaldb instance via SQL Server Management Studio GUI, as described in the blog, you need to choose 'Device' option, then choose the .bak file from your drive and restore the database.

Alternatively, you can restore database to localdb/mssqllocaldb instance by executing the following T-SQL scripts. Replace the paths with your own paths.

Restore Database MATERIALSDB From Disk = 'C:\Program Files\Microsoft SQL Server\MSSQL12.SQL2014\MSSQL\Backup\MATERIALSDB.bak'
    With Move 'MATERIALSDB' To 'C:\Program Files\Microsoft SQL Server\MSSQL12.SQL2014\MSSQL\DATA\MATERIALSDB.mdf',
        Move 'MATERIALSDB_log' To 'C:\Program Files\Microsoft SQL Server\MSSQL12.SQL2014\MSSQL\DATA\MATERIALSDB_log.LDF',
        Replace,
        Recovery;
Go


Thanks,
Lydia

September 7th, 2015 10:18pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics