使用C#备份和还原Azure SQL数据库

问题描述:

我想将Azure sql数据库备份到本地系统,然后将该备份还原到c#中的Azure sql数据库.有人可以帮我吗?有可能这样做吗?

I want to take backup of Azure sql database to my local system and then restore that backup to Azure sql database in c#. Can any body helps me out?Is it possible to do so?

Azure SQL数据库不支持按需创建.bak文件. Azure SQL DB 自动备份所有数据库使用本机备份使您能够及时将数据库还原到数据库保留期内的任何时间点.但是,这些备份不会公开,因此无法复制到本地系统.若要实现所需的功能,可以使用DACFx将BACPAC文件从Azure SQL数据库导出到本地系统,也可以将其从本地系统导入到SQL Azure数据库中. 本文可能是的帮助.

Azure SQL Database does not support creating .bak files on-demand. Azure SQL DB automatically backups up all databases using native backups to enable you to Point-in-Time restore your database to any point in time within the databases retention period. However, these backups are not exposed and cannot be copied to the local system. To achieve what you want you can export a BACPAC file from a Azure SQL database to the local system using DACFx and also import it into a SQL Azure database from the local system. This article may be of help.