简体   繁体   English

如何在 SQL Server 2008 中恢复 SQL Server 2014 备份

[英]How to restore SQL Server 2014 backup in SQL Server 2008

Were there any changes in this area with SQL Server 2014? SQL Server 2014 在这方面有什么变化吗? I've seen this post Is it possible to restore Sql Server 2008 backup in sql server 2005 and I know that this was not possible as a scenario for 2012 -> 2008 but I wonder if MS made any changes here with the 2014 version.我看过这篇文章Is it possible to restore Sql Server 2008 backup in sql server 2005 and I know that this is not possible as a scenario for 2012 -> 2008 但我想知道 MS 是否在这里对 2014 版本进行了任何更改。

We are evaluating 2014 version and we have a fairly large database in testing.我们正在评估 2014 版本,我们有一个相当大的数据库正在测试中。 We'd like to restore a backup of that database to SQL Server 2008 because that physical machine has more space, RAM,…我们想将该数据库的备份还原到 SQL Server 2008,因为该物理机有更多空间、RAM、...

I'm getting standard error message when I try to restore backup but I was wondering if there is something else in SQL Server 2014 that I might be missing.当我尝试恢复备份时收到标准错误消息,但我想知道 SQL Server 2014 中是否还有我可能遗漏的其他内容。

No, it is not possible.不,这是不可能的。 Stack Overflow wants me to answer with a longer answer, so I will say no again. Stack Overflow 想让我用更长的答案来回答,所以我会再说不。

Documentation: https://docs.microsoft.com/en-us/sql/t-sql/statements/backup-transact-sql#compatibility文档: https : //docs.microsoft.com/en-us/sql/t-sql/statements/backup-transact-sql#compatibility

Backups that are created by more recent version of SQL Server cannot be restored in earlier versions of SQL Server.由较新版本的 SQL Server 创建的备份无法在较早版本的 SQL Server 中恢复。

Not really as far as I know but here are couple things you can try.据我所知,并非如此,但您可以尝试以下几件事。

Third party tools: Create empty database on 2008 instance and use third party tools such as ApexSQL Diff and Data Diff to synchronize schema and tables.第三方工具:在2008实例上创建空数据库,使用ApexSQL DiffData Diff等第三方工具同步schema和表。

Just use these (or any other on the market such as Red Gate, Idera, Dev Art, there are many similar) in trial mode to get the job done.只需在试用模式下使用这些(或市场上的任何其他产品,例如 Red Gate、Idera、Dev Art,有许多类似的)即可完成工作。

Generate scripts: Go to Tasks -> Generate Scripts, select option to script the data too and execute it on 2008 instance.生成脚本:转到任务 -> 生成脚本,选择选项来编写数据脚本并在 2008 实例上执行它。 Works just fine but note that script order is something you must be careful about.工作正常,但请注意脚本顺序是您必须小心的事情。 By default scripts are not ordered to take dependencies into account.默认情况下,脚本不会被排序以考虑依赖项。

It is a pretty old post, but I just had to do it today.这是一个很旧的帖子,但我今天不得不这样做。 I just right-clicked database from SQL2014 and selected Export Data option and that helped me to move data to SQL2012.我只是右键单击 SQL2014 中的数据库并选择了导出数据选项,这有助于我将数据移动到 SQL2012。

Pretty old question... but I had the same problem today and solved with script, a little bit slow and complex but worked.很老的问题......但我今天遇到了同样的问题并用脚本解决了,有点慢和复杂但有效。 I did this:我这样做了:

Let's start from the source DB (SQL 2014) right click on the database you would like to backup -> Generate Scripts -> "Script entire database and all database objet" (or u can select only some table if u want) -> the most important step is in the " Set Scripting Options " tab, here you have to click on " Advanced " and look for the option " Script for Server version " and in my case I could select everything from SQL 2005, also pay attention to the option " Types of data to script " I advice " Schema and data " and also Script Triggers and Script Full-text Indexes (if you need, it's false by default) and finally click ok and next.让我们从源数据库 (SQL 2014) 开始,右键单击要备份的数据库 ->生成脚本-> “脚本整个数据库和所有数据库对象”(或者,如果您愿意,您可以只选择一些表)->最重要的一步是在“设置脚本选项”选项卡中,在这里您必须单击“高级”并查找选项“服务器版本脚本”,在我的情况下,我可以选择 SQL 2005 中的所有内容,还要注意选项“要编写脚本的数据类型”我建议“架构和数据”以及脚本触发器和脚本全文索引(如果需要,默认情况下为 false),最后单击确定并下一步。 Should look like this:应该是这样的:

设置脚本选项

Now transfer your generated script into your SQL 2008, open it and last Important Step : You must change mdf and ldf location!!现在将生成的脚本传输到 SQL 2008 中,打开它并执行最后一个重要步骤:您必须更改mdfldf位置!!

That's all folks, happy F5!!就是这样,F5 快乐!! :D :D

No I guess you cannot restore the databases from higher version to lower version , you can make data flow b/w them i,e you can scriptout.不,我猜您无法将数据库从较高版本恢复到较低版本,您可以使数据流黑白,您可以编写脚本。 http://www.mssqltips.com/sqlservertip/2810/how-to-migrate-a-sql-server-database-to-a-lower-version/ http://www.mssqltips.com/sqlservertip/2810/how-to-migrate-a-sql-server-database-to-a-lower-version/

请使用 SQL Server Integration Services 中的 SQL Server Data Tools(传输数据库任务),如下所示: https : //stackoverflow.com/a/27777823/2127493

If you have both versions you can create a merge replication from new to old.如果您有两个版本,则可以创建从新到旧的合并复制。 Create a merge publication on your newer sql server and a subscription on the older version.在较新的 sql server 上创建合并发布,并在旧版本上创建订阅。 After initializing the subscription you can create a backup of the database with the same structure and the same content but in an older version and restore it on your old target server.初始化订阅后,您可以创建具有相同结构和相同内容但版本较旧的数据库备份,并将其恢复到旧目标服务器上。 You can use this method also with sql server 2016 to target 2014, 2012 or 2008.您也可以将此方法与 sql server 2016 结合使用以定位 2014、2012 或 2008。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM