You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何导出特定时间点的Azure数据库备份?

Exporting a 2-Day-Old Hourly Automated Backup from Azure SQL Database

Hey there! I get it—tracking down and exporting an older automated backup can feel frustrating when the standard docs only cover current data exports. Let’s break down exactly how to get that 2-day-old hourly backup exported:

Step 1: Confirm Your Backup Retention Policy First

Before diving in, make sure your database’s automated backup retention period actually covers the 2-day window you need. Azure SQL Database’s default retention varies by tier (7 days for Basic, 35 days for Standard/Premium), but it might have been customized:

  • Head to your Azure SQL Database in the Azure Portal
  • Open the Backup tab in the left-hand menu
  • Check the Retention policy section to verify 2 days falls within the allowed timeframe

Step 2: Restore the Hourly Backup to a Temporary Database

You can’t directly export a historical automated backup—instead, you first restore it to a temporary database, then export that temp copy:

  1. In the Azure Portal, go to your original SQL Database > Backup > Restore
  2. Under Restore source, select Point-in-time restore
  3. Use the date picker to jump back exactly 2 days, then select the specific hour you need from the timeline
  4. Name your temporary database (e.g., MyDB_Temp_Restore_2DaysAgo) and finish the restore process—wait time depends on your database size, but it’s usually a few minutes

Step 3: Export the Restored Temporary Database

Now that you have the restored copy, you can use the export workflow you’re familiar with, but apply it to this temp DB:

  • Navigate to the temporary database you just created
  • Open the Export tab in the left-hand menu
  • Configure your export settings:
    • Pick a target Azure Storage account and container to save the export file
    • Enter the SQL admin credentials for the temp database
    • Choose your preferred export format (BACPAC is the standard choice)
  • Click Export—you can monitor the job’s progress in the Notifications panel or under Export/Import history

Alternative: Scripted Workflow with PowerShell (Optional)

If you prefer automation, use Azure PowerShell to handle the restore and export in one go:

# Restore the 2-day-old point-in-time backup to a temp DB
Restore-AzSqlDatabase -ResourceGroupName "YourResourceGroup" -ServerName "YourSQLServer" `
  -DatabaseName "OriginalDatabase" -PointInTime (Get-Date).AddDays(-2) `
  -TargetDatabaseName "MyDB_Temp_Restore"

# Export the restored temp DB to Azure Storage
Export-AzSqlDatabase -ResourceGroupName "YourResourceGroup" -ServerName "YourSQLServer" `
  -DatabaseName "MyDB_Temp_Restore" -StorageKeyType "StorageAccessKey" `
  -StorageKey "YourStorageAccountAccessKey" -StorageUri "https://yourstorage.blob.core.windows.net/container/export_2daysago.bacpac" `
  -AdministratorLogin "SQLAdminUsername" -AdministratorLoginPassword "SQLAdminPassword"

Quick Tips

  • Once you’ve downloaded the export file, delete the temporary database to avoid extra costs
  • Use a storage account in the same region as your SQL database for faster export speeds
  • Make sure you have the SQL DB Contributor role or equivalent permissions to perform restores and exports

内容的提问来源于stack exchange,提问作者Ashkan S

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 09:31:41