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

Restore database from SQL Server 2012 to SQL Server 2008 R2 Expand / Collapse
Author
Message
Posted Wednesday, January 9, 2013 3:10 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, May 7, 2014 6:48 AM
Points: 36, Visits: 146
Hi,

I initially took backup from SQL Server 2012 (database compatibility mode was set to SQL Server 2008 (100)) but when I try to restore that backup on SQL Server 2008 R2 it is giving me error as "Specified cast is not valid".

I would appreciate if anyone can help me or if there is any alternate solution to backup from SQL Server 2012 and successfully restore it on SQL Server 2008 R2, please let me know.

Thank you.

Post #1405038
Posted Wednesday, January 9, 2013 3:17 PM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Yesterday @ 4:26 PM
Points: 896, Visits: 7,082
As far as I know, there is no way to do a backward restore, even if the database was in a compatibility mode that matched the lower version. The compatibility mode impacts how certain sql constructs behave on a database but it doesn't mean that the database is actually internally structured as a database on that native version would be. A 2012 database, no matter what the compatibility mode, is still a 2012 database internally, so a 2008 server wouldn't understand that internal structure or be able to restore it.

Best advice is to script out all the objects, create them on the older database, then copy the data.




And then again, I might be wrong ...
David Webb
Post #1405041
Posted Wednesday, January 9, 2013 4:13 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 9:57 AM
Points: 7,080, Visits: 12,571
David Webb-200187 (1/9/2013)
As far as I know, there is no way to do a backward restore, even if the database was in a compatibility mode that matched the lower version. The compatibility mode impacts how certain sql constructs behave on a database but it doesn't mean that the database is actually internally structured as a database on that native version would be. A 2012 database, no matter what the compatibility mode, is still a 2012 database internally, so a 2008 server wouldn't understand that internal structure or be able to restore it.

Best advice is to script out all the objects, create them on the older database, then copy the data.

+1


__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Post #1405067
Posted Thursday, January 10, 2013 2:06 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 6:53 AM
Points: 5,132, Visits: 4,922
David Webb-200187 (1/9/2013)
As far as I know, there is no way to do a backward restore, even if the database was in a compatibility mode that matched the lower version. The compatibility mode impacts how certain sql constructs behave on a database but it doesn't mean that the database is actually internally structured as a database on that native version would be. A 2012 database, no matter what the compatibility mode, is still a 2012 database internally, so a 2008 server wouldn't understand that internal structure or be able to restore it.

Best advice is to script out all the objects, create them on the older database, then copy the data.


+1, couldnt of said it better myself.




Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1405275
Posted Thursday, January 10, 2013 5:59 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, July 10, 2014 9:05 PM
Points: 117, Visits: 78
+1

Scripts (create table and etc) out with comptiable to SQL 2008.
Post #1405368
Posted Thursday, January 10, 2013 7:55 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Yesterday @ 8:50 PM
Points: 23,003, Visits: 31,495
David Webb-200187 (1/9/2013)
As far as I know, there is no way to do a backward restore, even if the database was in a compatibility mode that matched the lower version. The compatibility mode impacts how certain sql constructs behave on a database but it doesn't mean that the database is actually internally structured as a database on that native version would be. A 2012 database, no matter what the compatibility mode, is still a 2012 database internally, so a 2008 server wouldn't understand that internal structure or be able to restore it.

Best advice is to script out all the objects, create them on the older database, then copy the data.


Have to agree 100%.



Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #1405473
Posted Tuesday, May 6, 2014 11:36 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, May 6, 2014 11:30 PM
Points: 1, Visits: 0
Right-click the database in SQL 2012...Tasks..."Generate Scripts". Choose the "Advanced" button under "Set scripting options" and set the "script for server version" to the required database format. For "Types of data to script" choose "Schema and data".
Post #1568282
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse