Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I restore a database backup file (.bak) from SQL Server 2012 into SQL Server 2008 Express?

Tags:

A database that was originally from SQL Server 2008, was restored into SQL Server 2012. A backup from SQL Server 2012 was made and I am trying to restore it on my local SQL Server 2008 Express. However I get an error 'Specified cast is not valid' (SQLManagerUI).

I have generated an SQL Script from 2012 and set it so that it will generate with compatibility to SQL Server 2008. However it is a large sql file, around 700mb.

I recall before that I had tried to run a script of that size before on my local SQLExpress and also got an error.

Is there a way I can get a "large" database from SQL Server 2012 into SQL Server 2008 Express?

like image 951
stormwild Avatar asked May 25 '12 10:05

stormwild


People also ask

How do I restore a SQL Server database from a BAK file?

Restore the database from a BAK fileRight-click on the database server in the left navigation pane, click Tasks, click Restore. The name of the restoring database appears in the To database list box. To create a new database, enter its name in the list box. Select 'From device'.

Can we restore SQL Server 2012 backup to 2017?

Yes, SQL Server is backward compatible. You can restore a database from any previous version of SQL Server that was supported at the time of the release.


1 Answers

Thanks to Marc and Aaron for providing the answers.

The quick answer is no, it's not possible to restore a backup file from a higher version to a lower version of SQL Server.

A work around would be to generate the scripts to create the database.

You can target the script generation to a lower version.

Please see comments above for more information.

Links:

Why an SQL Server Database from a higher version cannot be restored onto a lower version of SQL Server?

Create Database in SQL Server 2012, Script and Use in 2008?

like image 183
stormwild Avatar answered Oct 02 '22 02:10

stormwild