Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Restore database from SQL Server 2012 to SQL Server 2008 R2


Restore database from SQL Server 2012 to SQL Server 2008 R2

Author
Message
monilps
monilps
Valued Member
Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)

Group: General Forum Members
Points: 70 Visits: 221
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.
David Webb-CDS
David Webb-CDS
Ten Centuries
Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)

Group: General Forum Members
Points: 1014 Visits: 8584
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
Orlando Colamatteo
Orlando Colamatteo
SSCrazy Eights
SSCrazy Eights (9.6K reputation)SSCrazy Eights (9.6K reputation)SSCrazy Eights (9.6K reputation)SSCrazy Eights (9.6K reputation)SSCrazy Eights (9.6K reputation)SSCrazy Eights (9.6K reputation)SSCrazy Eights (9.6K reputation)SSCrazy Eights (9.6K reputation)

Group: General Forum Members
Points: 9643 Visits: 14375
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
anthony.green
anthony.green
SSCertifiable
SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)

Group: General Forum Members
Points: 6829 Visits: 6121
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
When a question, really isn't a question - Jeff Smith
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


Arun-235202
Arun-235202
SSC-Enthusiastic
SSC-Enthusiastic (119 reputation)SSC-Enthusiastic (119 reputation)SSC-Enthusiastic (119 reputation)SSC-Enthusiastic (119 reputation)SSC-Enthusiastic (119 reputation)SSC-Enthusiastic (119 reputation)SSC-Enthusiastic (119 reputation)SSC-Enthusiastic (119 reputation)

Group: General Forum Members
Points: 119 Visits: 80
+1

Scripts (create table and etc) out with comptiable to SQL 2008.
Lynn Pettis
Lynn Pettis
One Orange Chip
One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)

Group: General Forum Members
Points: 26400 Visits: 38120
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%.

Cool
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)
vikas.david
vikas.david
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 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".
george25
george25
Valued Member
Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)

Group: General Forum Members
Points: 56 Visits: 71
How do you run the sql file on the destination server? My file is not small - 13Gb - and when I try to open it in SSMS 2008R2 I get the error below. The file was created in 2012.

Error HRESULT E_FAIL has been returned from a call to a COM component
Lynn Pettis
Lynn Pettis
One Orange Chip
One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)

Group: General Forum Members
Points: 26400 Visits: 38120
george25 (11/27/2014)
How do you run the sql file on the destination server? My file is not small - 13Gb - and when I try to open it in SSMS 2008R2 I get the error below. The file was created in 2012.

Error HRESULT E_FAIL has been returned from a call to a COM component


You may need to run the file using SQLCMD.

Cool
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)
GilaMonster
GilaMonster
SSC Guru
SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)

Group: General Forum Members
Points: 53972 Visits: 44623
Don't script the data unless your database is under a couple hundred MB.

Script the schema, use bcp to export the data to flat files.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
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


Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search