将 Windows Server 文件和文件夹备份到 AzureBack up Windows Server files and folders to Azure

本文介绍如何使用 Azure 备份服务和 Azure 恢复服务 (MARS) 代理备份 Windows 计算机。This article explains how to back up Windows machines by using the Azure Backup service and the Azure Recovery Services (MARS) agent. MARS 也称为 Azure 备份代理。MARS is also known as the Azure Backup agent.

本文介绍如何执行以下操作:In this article, you will learn how to:

  • 验证先决条件Verify the prerequisites
  • 创建备份策略和计划。Create a backup policy and schedule.
  • 执行按需备份。Perform an on-demand backup.

开始之前Before you start

创建备份策略Create a backup policy

备份策略指定何时创建数据快照来创建恢复点。The backup policy specifies when to take snapshots of the data to create recovery points. 它还指定恢复点的保留期限。It also specifies how long to keep recovery points. 使用 MARS 代理配置备份策略。You use the MARS agent to configure a backup policy.

Azure 备份不会自动考虑夏令时 (DST)。Azure Backup doesn't automatically take daylight saving time (DST) into account. 此默认设置可能会导致实际时间与计划的备份时间存在一定的偏差。This default could cause some discrepancy between the actual time and the scheduled backup time.

创建备份策略:To create a backup policy:

  1. 下载并注册 MARS 代理后,打开代理控制台。After you download and register the MARS agent, open the agent console. 可以通过在计算机中搜索“Azure 备份”找到该代理。You can find it by searching your machine for Azure Backup.

  2. 在“操作”下,选择“计划备份”。 Under Actions, select Schedule Backup.

    计划 Windows Server 备份

  3. 在计划备份向导中,选择“开始” > “下一步”。 In the Schedule Backup Wizard, select Getting started > Next.

  4. 在“选择要备份的项”下,选择“添加项”。 Under Select Items to Back up, select Add Items.

    添加要备份的项

  5. 在“选择项”框中,选择要备份的项,然后选择“确定”。 In the Select Items box, select items to back up, and then select OK.

    选择要备份的项

  6. 在“选择要备份的项”页上,选择“下一步”。 On the Select Items to Back Up page, select Next.

  7. 在“指定备份计划”页上,指定何时创建每日或每周备份。On the Specify Backup Schedule page, specify when to take daily or weekly backups. 然后,选择“下一步”。Then select Next.

    • 创建备份时会创建一个恢复点。A recovery point is created when a backup is taken.

    • 在环境中创建的恢复点数目取决于备份计划。The number of recovery points created in your environment depends on your backup schedule.

    • 可以计划每日备份,每天最多备份三次。You can schedule up to three daily backups per day. 在以下示例中,每日会执行两次备份,一次发生在午夜,另一次发生在下午 6:00。In the following example, two daily backups occur, one at midnight and one at 6:00 PM.

      设置每日备份计划

    • 也可以运行每周备份。You can run weekly backups too. 在以下示例中,将每隔两周在星期日和星期三上午 9:30 和凌晨 1:00 创建备份。In the following example, backups are taken every alternate Sunday and Wednesday at 9:30 AM and 1:00 AM.

      设置每周备份计划

  8. 在“选择保留策略”页上,指定如何存储数据的历史副本。On the Select Retention Policy page, specify how to store historical copies of your data. 然后,选择“下一步”。Then select Next.

    • 保留设置指定要存储哪些恢复点,以及要存储多长时间。Retention settings specify which recovery points to store and how long to store them.

    • 对于每日保留设置,可以指明在针对每日保留指定的时间,要将最新恢复点保留指定的天数。For a daily retention setting, you indicate that at the time specified for the daily retention, the latest recovery point will be retained for the specified number of days. 或者,可以指定每月保留策略,指明在每个月的 30 日创建的恢复点应保留 12 个月。Or you could specify a monthly retention policy to indicate that the recovery point created on the 30th of every month should be stored for 12 months.

    • 每日和每周恢复点的保留期通常与备份计划相一致。Retention for daily and weekly recovery points usually coincides with the backup schedule. 因此,当计划触发备份时,备份创建的恢复点的存储持续时间与每日或每周保留策略指定的持续时间相一致。So when the schedule triggers a backup, the recovery point that the backup creates is stored for the duration that the daily or weekly retention policy specifies.

    • 在以下示例中:In the following example:

      • 在午夜和下午 6:00 创建的每日备份将保留 7 天。Daily backups at midnight and 6:00 PM are kept for seven days.
      • 在星期六的午夜和下午 6:00 创建的备份将保留 4 周。Backups taken on a Saturday at midnight and 6:00 PM are kept for four weeks.
      • 在当月最后一个星期六的午夜和下午 6:00 创建的备份将保留 12 个月。Backups taken on the last Saturday of the month at midnight and 6:00 PM are kept for 12 months.
      • 在三月份最后一个星期六创建的备份将保留 10 年。Backups taken on the last Saturday in March are kept for 10 years.

      保留策略的示例

  9. 在“选择初始备份类型”页上,确定如何通过网络或使用脱机备份创建初始备份。On the Choose Initial Backup Type page, decide if you want to take the initial backup over the network or use offline backup. 若要通过网络创建初始备份,请选择“自动通过网络” > “下一步”。 To take the initial backup over the network, select Automatically over the network > Next.

<span data-ttu-id="38bfd-158">![选择初始备份类型](./media/backup-azure-manage-mars/choose-initial-backup-type.png)</span><span class="sxs-lookup"><span data-stu-id="38bfd-158">![Choose an initial backup type](./media/backup-azure-manage-mars/choose-initial-backup-type.png)</span></span>
  1. 在“确认”页上复查信息,然后选择“完成”。 On the Confirmation page, review the information, and then select Finish.

    确认备份类型

  2. 在向导完成创建备份计划后,选择“关闭”。After the wizard finishes creating the backup schedule, select Close.

    查看备份计划的进度

在安装了代理的每台计算机上创建一个策略。Create a policy on each machine where the agent is installed.

执行脱机初始备份Do the initial backup offline

可以通过网络自动运行初始备份,也可以使用脱机备份。You can run an initial backup automatically over the network, or you can back up offline. 如果需要消耗大量的网络带宽来传输大量的数据,则初始备份的脱机种子设定非常有用。Offline seeding for an initial backup is useful if you have large amounts of data that will require a lot of network bandwidth to transfer.

若要执行脱机传输:To do an offline transfer:

  1. 将备份数据写入暂存位置。Write the backup data to a staging location.

  2. 使用 AzureOfflineBackupDiskPrep 工具将暂存位置中的数据复制到一个或多个 SATA 磁盘。Use the AzureOfflineBackupDiskPrep tool to copy the data from the staging location to one or more SATA disks.

    该工具会创建 Azure 导入作业。The tool creates an Azure Import job. 有关详细信息,请参阅什么是 Azure 导入/导出服务For more information, see What is the Azure Import/Export service.

  3. 将 SATA 磁盘寄送到 Azure 数据中心。Send the SATA disks to an Azure datacenter.

    在数据中心,磁盘数据将复制到 Azure 存储帐户。At the datacenter, the disk data is copied to an Azure storage account. Azure 备份将数据从存储帐户复制到保管库,并计划增量备份。Azure Backup copies the data from the storage account to the vault, and incremental backups are scheduled.

启用网络限制Enable network throttling

可以通过启用网络限制,来控制 MARS 代理使用网络带宽的方式。You can control how the MARS agent uses network bandwidth by enabling network throttling. 如果你需要在工作时间备份数据,但想要控制备份和还原活动占用的带宽量,则限制会很有帮助。Throttling is helpful if you need to back up data during work hours but you want to control how much bandwidth the backup and restore activity uses.

Azure 备份中的网络限制在本地操作系统上使用服务质量 (QoS)Network throttling in Azure Backup uses Quality of Service (QoS) on the local operating system.

针对备份的网络限制适用于 Windows Server 2012 和更高版本,以及 Windows 8 和更高版本。Network throttling for backups is available on Windows Server 2012 and later, and on Windows 8 and later. 操作系统应该运行最新的服务包。Operating systems should be running the latest service packs.

若要启用网络限制:To enable network throttling:

  1. 在 MARS 代理中,选择“更改属性”。In the MARS agent, select Change Properties.

  2. 在“限制”选项卡上,选择“为备份操作启用 Internet 带宽使用限制”。On the Throttling tab, select Enable internet bandwidth usage throttling for backup operations.

    针对备份操作设置网络限制

  3. 指定在工作时间和下班时间允许的带宽。Specify the allowed bandwidth during work hours and nonwork hours. 带宽值最小为 512 Kbps,最大为 1,023 MBps。Bandwidth values begin at 512 Kbps and go up to 1,023 MBps. 然后选择“确定”。Then select OK.

运行按需备份Run an on-demand backup

  1. 在 MARS 代理中,选择“立即备份”。In the MARS agent, select Back Up Now.

    在 Windows Server 中立即备份

  2. 如果 MARS 代理版本为 2.0.9169.0 或更高,则你可以设置自定义保留日期。If the MARS agent version is 2.0.9169.0 or newer, then you can set a custom retention date. 在“备份保留截止日期”部分,从日历中选择一个日期。In the Retain Backup Till section, choose a date from the calendar.

    使用日历自定义保留日期

  3. 在“确认”页上复查设置,然后选择“备份”。 On the Confirmation page, review the settings, and select Back Up.

  4. 选择“关闭”以关闭向导。Select Close to close the wizard. 如果在备份完成之前关闭向导,向导将继续在后台运行。If you close the wizard before the backup finishes, the wizard continues to run in the background.

完成初始备份后,备份控制台中显示“作业已完成”状态。After the initial backup finishes, the Job completed status appears in the Backup console.

设置按需备份策略保留行为Set up on-demand backup policy retention behavior

备注

此信息仅适用于低于 2.0.9169.0 的 MARS 代理版本。This information applies only to MARS agent versions that are older than 2.0.9169.0.

备份计划选项Backup-schedule option 数据保留持续时间Duration of data retention
日期Day 默认保留期:相当于“每日备份的保留期(以天为单位)”。Default retention: Equivalent to the "retention in days for daily backups."

例外:如果为长期保留(周、月、年)设置的每日计划备份失败,则会考虑将失败后立即触发的按需备份进行长期保留。Exception: If a daily scheduled backup that's set for long-term retention (weeks, months, or years) fails, an on-demand backup that's triggered right after the failure is considered for long-term retention. 否则,将考虑进行下一次计划备份以进行长期保留。Otherwise, the next scheduled backup is considered for long-term retention.

示例方案:在星期四上午 8:00 进行的计划备份失败。Example scenario: The scheduled backup on Thursday at 8:00 AM failed. 考虑每周、每月或每年保留此备份。This backup was to be considered for weekly, monthly, or yearly retention. 因此,在下一次于星期五上午 8:00 执行计划备份之前触发的第一个按需备份将自动标记为每周、每月或每年保留。So the first on-demand backup triggered before the next scheduled backup on Friday at 8:00 AM is automatically tagged for weekly, monthly, or yearly retention. 此备份会替代星期四上午 8:00 的备份。This backup substitutes for the Thursday 8:00 AM backup.
WeekWeek 默认保留期:一天。Default retention: One day. 为使用每周备份策略的数据源创建的按需备份将在第二天删除。On-demand backups that are taken for a data source that has a weekly backup policy are deleted the next day. 即使它们是该数据源的最新备份,也仍会将其删除。They're deleted even if they're the most recent backups for the data source.

例外:如果为长期保留(周、月、年)设置的每周计划备份失败,则会考虑将失败后立即触发的按需备份进行长期保留。Exception: If a weekly scheduled backup that's set for long-term retention (weeks, months, or years) fails, an on-demand backup that's triggered right after the failure is considered for long-term retention. 否则,将考虑进行下一次计划备份以进行长期保留。Otherwise, the next scheduled backup is considered for long-term retention.

示例方案:在星期四上午 8:00 进行的计划备份失败。Example scenario: The scheduled backup on Thursday at 8:00 AM failed. 考虑每月或每年保留此备份。This backup was to be considered for monthly or yearly retention. 因此,在下一次于星期四上午 8:00 执行计划备份之前触发的第一个按需备份将自动标记为每月或每年保留。So the first on-demand backup that's triggered before the next scheduled backup on Thursday at 8:00 AM is automatically tagged for monthly or yearly retention. 此备份会替代星期四上午 8:00 的备份。This backup substitutes for the Thursday 8:00 AM backup.

有关详细信息,请参阅创建备份策略For more information, see Create a backup policy.

后续步骤Next steps