可以在 SQL Server 2012 上还原 SQL Server 2014 的备份吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25042746/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Possible to restore a backup of SQL Server 2014 on SQL Server 2012?
提问by RayofCommand
I know that you can't (at least not easily) restore a SQL Server 2012 backup on SQL Server 2008. But how does it work for SQL Server 2014 to SQL Server 2012 ?
我知道你不能(至少不容易)在 SQL Server 2008 上恢复 SQL Server 2012 备份。但是它如何从 SQL Server 2014 到 SQL Server 2012 工作?
On database level there is the property to adjust the compatibility mode to any other SQL Server version.
在数据库级别有将兼容模式调整为任何其他 SQL Server 版本的属性。
How does this helps or work ? Will it only disallow the features from 2014?
这如何帮助或工作?它只会禁止 2014 年的功能吗?
To be honest I already tried to restore a backup, but 2012 didn't recognize the datafile, so I couldn't click ok Button
to start the restore procedure.
老实说,我已经尝试过恢复备份,但是 2012 无法识别数据文件,因此我无法单击ok Button
以启动恢复过程。
Did I miss some important option ?
我错过了一些重要的选择吗?
回答by marc_s
You CANNOTdo this - you cannot attach/detach or backup/restore a database from a newer versionof SQL Server down to an older version- the internal file structures are just too different to support backwards compatibility. This is still true in SQL Server 2014 - you cannotrestore a 2014 backup on anything other than another 2014 box (or something newer).
你不能这样做 - 你不能从新版本的 SQL Server连接/分离或备份/恢复数据库到旧版本- 内部文件结构太不同,无法支持向后兼容性。这在 SQL Server 2014 中仍然如此 -除了另一个 2014 机器(或更新的东西)之外,您无法在任何其他设备上还原 2014 备份。
You can either get around this problem by
您可以通过以下方式解决此问题
using the same version of SQL Server on all your machines - then you can easily backup/restore databases between instances
otherwise you can create the database scripts for both structure (tables, view, stored procedures etc.) and for contents (the actual data contained in the tables) either in SQL Server Management Studio (
Tasks > Generate Scripts
) or using a third-party toolor you can use a third-party tool like Red-Gate's SQL Compareand SQL Data Compareto do "diffing" between your source and target, generate update scripts from those differences, and then execute those scripts on the target platform; this works across different SQL Server versions.
在所有机器上使用相同版本的 SQL Server - 然后您可以轻松地在实例之间备份/恢复数据库
否则,您可以在 SQL Server Management Studio (
Tasks > Generate Scripts
) 或使用第三方工具为结构(表、视图、存储过程等)和内容(表中包含的实际数据)创建数据库脚本或者您可以使用第三方工具,如 Red-Gate 的SQL Compare和SQL Data Compare来在源和目标之间进行“差异化”,根据这些差异生成更新脚本,然后在目标平台上执行这些脚本;这适用于不同的 SQL Server 版本。
The compatibility modesetting just controls what T-SQL features are available to you - which can help to prevent accidentally using new features not available in other servers. But it does NOTchange the internal file format for the .mdf
files - this is NOTa solution for that particular problem - there is no solution for restoring a backup from a newer version of SQL Server on an older instance.
在兼容模式设置只是控制什么T-SQL的功能是提供给你-它可以帮助防止意外使用在其他的服务器不可用的新功能。但它确实不改变内部文件格式的.mdf
文件-这是不针对特定问题的解决方案-有来自SQL Server的新版本在旧的实例恢复备份无解。
回答by Jordan Medina
Sure it's possible... use Export Wizard in source option use SQL SERVER NATIVE CLIENT 11, later your source server ex.192.168.100.65\SQLEXPRESS next step select your new destination server ex.192.168.100.65\SQL2014
当然有可能...在源选项中使用导出向导使用 SQL SERVER NATIVE CLIENT 11,稍后您的源服务器 ex.192.168.100.65\SQLEXPRESS 下一步选择您的新目标服务器 ex.192.168.100.65\SQL2014
Just be sure to be using correct instance and connect each other
只要确保使用正确的实例并相互连接
Just pay attention in Stored procs must be recompiled
只需要注意 Stored procs 必须重新编译