简体   繁体   English

备份还原db从sql server 2008 r2到2008

[英]Backup restore db from sql server 2008 r2 to 2008

I need to backup and restore a db on sql server 2008R2 to sql server 2008. The backup file is not compatible this way. 我需要在sql server 2008R2上备份和恢复数据库到sql server 2008.备份文件不兼容这种方式。 The other option that i found is to generate scripts that include data. 我找到的另一个选项是生成包含数据的脚本。 Will the inserts succeed since i have the db normalised with lots of foreign keys? 插入是否会成功,因为我使用大量外键对db进行了规范化?

Is there any other reliable approach? 还有其他可靠的方法吗?

As you noted: the direct restore cannot be done. 如您所述: 无法进行直接还原。 SQL Server has never been backwards compatible in the sense of restoring a database from a newer version back to a server with an older version. 在将数据库从较新版本还原到具有旧版本的服务器的意义上,SQL Server从未向后兼容。

What you could do is use generated INSERT statements (using SSMS directly, or a handy add-in such as SSMS Toolpack ), or you could use a good SQL DIFF tool like Red-Gate SQL Data Compare to compare your two databases (even from a backup file, in the pro version!) and update one from the other. 你可以做的是使用生成的INSERT语句(直接使用SSMS,或SSMS Toolpack等方便的加载 ),或者你可以使用一个好的SQL DIFF工具,如Red-Gate SQL Data Compare来比较你的两个数据库(甚至来自专业版中的备份文件!)并从另一个更新一个。

SQL Server does not allow downgrading you can create a backup of your database in SQL Server 2008R2 instance and use third party tools, ApexSQL Diff and ApexSQL Data Diff to restore the backup an older version of SQL Server. SQL Server不允许降级您可以在SQL Server 2008R2实例中创建数据库备份,并使用第三方工具ApexSQL Diff和ApexSQL Data Diff将备份恢复为旧版本的SQL Server。

You can read detailed explanation of the process in this article: Restoring SQL Server database backup to an older version of SQL Server 您可以在本文中阅读有关该过程的详细说明:将SQL Server数据库备份还原到较旧版本的SQL Server

Hope this helps 希望这可以帮助

Disclaimer: I work for ApexSQL as a Support Engineer 免责声明:我作为支持工程师为ApexSQL工作

Backward compatibility is not available in SQL server 2008 R2 . SQL Server 2008 R2中不提供向后兼容性。 One solution is that the database script generate and run the desired server. 一种解决方案是数据库脚本生成并运行所需的服务器。

You could try using the export data wizard. 您可以尝试使用导出数据向导。 Right click on the Database in SSMS, Tasks, Export Data and copy all or whichever objects you need. 右键单击SSMS中的数据库,任务,导出数据并复制您需要的所有或任何对象。

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

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