您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

迁移到 Azure 文件共享Migrate to Azure file shares

本文介绍迁移到 Azure 文件共享的基本内容。This article covers the basic aspects of a migration to Azure file shares.

本文包含迁移基础知识和迁移指南表。This article contains migration basics and a table of migration guides. 这些指南有助于将文件移到 Azure 文件共享。These guides help you move your files into Azure file shares. 指南根据数据所在的位置以及你要移动到的部署模型(仅限云的模型或混合模型)进行组织。The guides are organized based on where your data is and what deployment model (cloud-only or hybrid) you're moving to.

迁移基础知识Migration basics

Azure 有多种可用的云存储类型。Azure has multiple available types of cloud storage. 文件迁移到 Azure 的一个重要方面是确定哪个 Azure 存储选项适合你的数据。A fundamental aspect of file migrations to Azure is determining which Azure storage option is right for your data.

Azure 文件共享适用于常规用途的文件数据。Azure file shares are suitable for general-purpose file data. 这种数据包括你针对其使用本地 SMB 或 NFS 共享的任何内容。This data includes anything you use an on-premises SMB or NFS share for. 通过 Azure 文件同步,可以在本地运行 Windows Server 的服务器上缓存多个 Azure 文件共享的内容。With Azure File Sync, you can cache the contents of several Azure file shares on servers running Windows Server on-premises.

对于当前在本地服务器上运行的应用,将文件存储在 Azure 文件共享中可能是一个不错的选择。For an app that currently runs on an on-premises server, storing files in an Azure file share might be a good choice. 你可以将应用移到 Azure,并使用 Azure 文件共享作为共享存储。You can move the app to Azure and use Azure file shares as shared storage. 还可以考虑将 Azure 磁盘 用于此场景。You can also consider Azure Disks for this scenario.

某些云应用不依赖于 SMB 或计算机本地数据访问/共享访问。Some cloud apps don't depend on SMB or on machine-local data access or shared access. 对于这些应用,Azure Blob 之类的对象存储通常是最佳选择。For those apps, object storage like Azure blobs is often the best choice.

任何迁移的关键在于,将文件从其当前存储位置移到 Azure 时捕获所有适用的文件保真度。The key in any migration is to capture all the applicable file fidelity when moving your files from their current storage location to Azure. Azure 存储选项支持的保真度和场景所需的保真度同样有助于选择正确的 Azure 存储。How much fidelity the Azure storage option supports and how much your scenario requires also helps you pick the right Azure storage. 通常,常规用途的文件数据依赖于文件元数据。General-purpose file data traditionally depends on file metadata. 应用数据可能不会。App data might not.

下面是文件的两个基本组件:Here are the two basic components of a file:

  • 数据流:文件的数据流存储文件内容。Data stream: The data stream of a file stores the file content.
  • 文件元数据:文件元数据具有以下子组件:File metadata: The file metadata has these subcomponents:
    • 文件特性,如只读File attributes like read-only
    • 文件权限,可称为 NTFS 权限或文件和文件夹 ACL File permissions, which can be referred to as NTFS permissions or file and folder ACLs
    • 时间戳,最值得注意的是创建时间戳和上次修改时间戳Timestamps, most notably the creation, and last-modified timestamps
    • 备用数据流,用于存储更多非标准属性的空间An alternative data stream, which is a space to store larger amounts of nonstandard properties

可以将迁移中的文件保真度定义为能够执行以下操作的能力:File fidelity in a migration can be defined as the ability to:

  • 将所有适用的文件信息存储在源上。Store all applicable file information on the source.
  • 通过迁移工具传输文件。Transfer files with the migration tool.
  • 将文件存储在迁移的目标存储中。Store files in the target storage of the migration.

若要确保迁移顺利进行,请根据需要确定最佳复制工具,并将存储目标与源相匹配。To ensure your migration proceeds smoothly, identify the best copy tool for your needs and match a storage target to your source.

考虑到上述信息,可以发现 Azure 中常规用途文件的目标存储是 Azure 文件共享Taking the previous information into account, you can see that the target storage for general-purpose files in Azure is Azure file shares.

与 Azure Blob 中的对象存储不同,Azure 文件共享可本机存储文件元数据。Unlike object storage in Azure blobs, an Azure file share can natively store file metadata. Azure 文件共享还会保留文件和文件夹层次结构、特性和权限。Azure file shares also preserve the file and folder hierarchy, attributes, and permissions. 由于位于本地,因此 NTFS 权限可以存储在文件和文件夹。NTFS permissions can be stored on files and folders because they're on-premises.

Active Directory 用户(作为其本地域控制器)可以以本机方式访问 Azure 文件共享。A user of Active Directory, which is their on-premises domain controller, can natively access an Azure file share. Azure Active Directory 域服务 (Azure AD DS) 用户也可以。So can a user of Azure Active Directory Domain Services (Azure AD DS). 二者都可使用其当前标识,基于共享权限以及文件和文件夹 ACL 来获取访问权限。Each uses their current identity to get access based on share permissions and on file and folder ACLs. 此行为类似于连接到本地文件共享的用户。This behavior is similar to a user connecting to an on-premises file share.

备用数据流是文件保真度的主要方面,当前无法存储在 Azure 文件共享中的文件上。The alternative data stream is the primary aspect of file fidelity that currently can't be stored on a file in an Azure file share. 它将在使用 Azure 文件同步时,保留在本地。It's preserved on-premises when Azure File Sync is used.

详细了解 Azure 文件共享的 Azure AD 身份验证Azure AD DS 身份验证Learn more about Azure AD authentication and Azure AD DS authentication for Azure file shares.

迁移指南Migration guides

下表列出了详细的迁移指南。The following table lists detailed migration guides.

如何使用该表:How to use the table:

  1. 找到当前存储文件的源系统的行。Locate the row for the source system your files are currently stored on.

  2. 选择以下目标之一:Choose one of these targets:

    • 使用 Azure 文件同步在本地缓存 Azure 文件共享内容的混合部署A hybrid deployment using Azure File Sync to cache the content of Azure file shares on-premises
    • 云中的 Azure 文件共享Azure file shares in the cloud

    选择与你的选择相匹配的目标列。Select the target column that matches your choice.

  3. 在源和目标的交集内,表单元格列出可用的迁移场景。Within the intersection of source and target, a table cell lists available migration scenarios. 选择一个场景即可直接链接到详细的迁移指南。Select one to directly link to the detailed migration guide.

没有链接的场景目前还没有发布的迁移指南。A scenario without a link doesn't yet have a published migration guide. 偶尔检查此表中是否有更新。Check this table occasionally for updates. 新指南出台后将会发布。New guides will be published when they're available.

Source 目标:Target:
混合部署Hybrid deployment
目标:Target:
仅限云的部署Cloud-only deployment
工具组合:Tool combination: 工具组合:Tool combination:
Windows Server 2012 R2 和更高版本Windows Server 2012 R2 and later
  • 通过 RoboCopy 迁移到已装载的 Azure 文件共享Via RoboCopy to a mounted Azure file share
  • 通过 Azure 文件同步Via Azure File Sync
Windows Server 2012 和更低版本Windows Server 2012 and earlier
  • 通过 DataBox 和 Azure 文件同步迁移到最近的服务器 OSVia DataBox and Azure File Sync to recent server OS
  • 使用 Azure 文件同步通过存储迁移服务迁移到最新的服务器,然后上传Via Storage Migration Service to recent server with Azure File Sync, then upload
  • 使用 Azure 文件同步通过存储迁移服务迁移到最新的服务器Via Storage Migration Service to recent server with Azure File Sync
  • 通过 RoboCopy 迁移到已装载的 Azure 文件共享Via RoboCopy to a mounted Azure file share
网络连接存储 (NAS)Network-attached storage (NAS)
Linux/SambaLinux / Samba
  • 通过 RoboCopy 迁移到已装载的 Azure 文件共享Via RoboCopy to a mounted Azure file share
Microsoft Azure StorSimple 云设备 8100 或 StorSimple 云设备 8600Microsoft Azure StorSimple Cloud Appliance 8100 or StorSimple Cloud Appliance 8600
StorSimple 云设备 1200StorSimple Cloud Appliance 1200

迁移工具箱Migration toolbox

文件复制工具File-copy tools

Microsoft 和其他公司提供了几种文件复制工具。There are several file-copy tools available from Microsoft and others. 若要为迁移场景选择合适的工具,必须考虑以下基本问题:To select the right tool for your migration scenario, you must consider these fundamental questions:

  • 该工具是否支持文件复制的源位置和目标位置?Does the tool support the source and target locations for your file copy?

  • 该工具是否支持源存储位置和目标存储位置之间的网络路径或可用协议(例如 REST、SMB 或 NFS)?Does the tool support your network path or available protocols (such as REST, SMB, or NFS) between the source and target storage locations?

  • 该工具是否保留源位置和目标位置支持的必要文件保真度?Does the tool preserve the necessary file fidelity supported by your source and target locations?

    在某些情况下,目标存储不支持与源相同的保真度。In some cases, your target storage doesn't support the same fidelity as your source. 如果目标存储足以满足你的需求,则该工具只必须匹配目标的文件保真功能。If the target storage is sufficient for your needs, the tool must match only the target's file-fidelity capabilities.

  • 该工具是否具有可使其适应你的迁移策略的功能?Does the tool have features that let it fit into your migration strategy?

    例如,考虑该工具是否可以最大程度地减少停机时间。For example, consider whether the tool lets you minimize your downtime.

    当某个工具支持将源镜像到目标的选项时,通常可以在同一源和目标上多次运行该工具,而源仍可访问。When a tool supports an option to mirror a source to a target, you can often run it multiple times on the same source and target while the source stays accessible.

    首次运行该工具时,它会复制大量数据。The first time you run the tool, it copies the bulk of the data. 此初始运行可能会持续一段时间。This initial run might last a while. 它持续的时间通常比使业务流程的数据源脱机所需的时间长。It often lasts longer than you want for taking the data source offline for your business processes.

    通过将源镜像到目标(与使用 robocopy/MIR 一样),可以在该相同源和目标上再次运行该工具。By mirroring a source to a target (as with robocopy /MIR), you can run the tool again on that same source and target. 该运行的速度要快得多,因为它只需要传输在上次运行后发生的源更改。The run is much faster because it needs to transport only source changes that occur after the previous run. 通过这种方式重新运行复制工具可显著减少停机时间。Rerunning a copy tool this way can reduce downtime significantly.

下表对 Microsoft 工具及其当前对 Azure 文件共享的适用性进行了分类:The following table classifies Microsoft tools and their current suitability for Azure file shares:

建议Recommended 工具Tool 对 Azure 文件共享的支持Support for Azure file shares 对文件保真度的保留Preservation of file fidelity
是,推荐 RoboCopyRoboCopy 支持。Supported. 可以将 Azure 文件共享装载为网络驱动器。Azure file shares can be mounted as network drives. 完全保真。*Full fidelity.*
是,推荐 Azure 文件同步Azure File Sync 以本机方式集成到 Azure 文件共享中。Natively integrated into Azure file shares. 完全保真。*Full fidelity.*
是,推荐 存储迁移服务Storage Migration Service 间接支持。Indirectly supported. 可以在 SMS 目标服务器上将 Azure 文件共享装载为网络驱动器。Azure file shares can be mounted as network drives on SMS target servers. 完全保真。*Full fidelity.*
是,推荐 AzCopyAzCopy
版本 10.6version 10.6
支持。Supported. 不支持源根 ACL 的复制,否则为完全保真。*Doesn't support copy of source root ACL, otherwise full fidelity.*
了解如何将 AzCopy 与 Azure 文件共享配合使用Learn how to use AzCopy with Azure file shares
是,推荐 Data BoxData Box 支持。Supported. DataBox 完全支持元数据。DataBox fully supports metadata.
不完全推荐 Azure 存储资源管理器Azure Storage Explorer
版本 1.14version 1.14
支持。Supported. 不复制 ACL。Doesn't copy ACLs. 支持时间戳。Supports timestamps.
不推荐 Azure 数据工厂Azure Data Factory 支持。Supported. 不复制元数据。Doesn't copy metadata.

完全保真:达到或超过 Azure 文件共享功能** Full fidelity: meets or exceeds Azure file-share capabilities.

迁移帮助程序工具Migration helper tools

本部分介绍有助于计划和运行迁移的工具。This section describes tools that help you plan and run migrations.

Microsoft Corporation 的 RoboCopyRoboCopy from Microsoft Corporation

RoboCopy 是最适用于文件迁移的工具之一。RoboCopy is one of the tools most applicable to file migrations. 它作为 Windows 的一部分提供。It comes as part of Windows. 对于此工具的众多选项,主要的 RoboCopy 文档是一个有用的资源。The main RoboCopy documentation is a helpful resource for this tool's many options.

JAM Software GmbH 的 TreeSizeTreeSize from JAM Software GmbH

Azure 文件同步主要随项(文件和文件夹)的数量而非总存储量而缩放。Azure File Sync scales primarily with the number of items (files and folders) and not with the total storage amount. 通过 TreeSize 工具,可确定 Windows Server 卷上的项数。The TreeSize tool lets you determine the number of items on your Windows Server volumes.

可以使用该工具在 Azure 文件同步部署之前创建透视。You can use the tool to create a perspective before an Azure File Sync deployment. 部署后启用云分层时,也可以使用它。You can also use it when cloud tiering is engaged after deployment. 在这种场景下,可以看到项数以及哪些目录使用服务器缓存最多。In that scenario, you see the number of items and which directories use your server cache the most.

该工具的测试版本为 4.4.1。The tested version of the tool is version 4.4.1. 它与云分层文件兼容。It's compatible with cloud-tiered files. 该工具在正常运行期间不会导致分层文件的重调。The tool won't cause recall of tiered files during its normal operation.

后续步骤Next steps

  1. 为所需的 Azure 文件共享的部署(仅限云的部署或混合部署)创建一个计划。Create a plan for which deployment of Azure file shares (cloud-only or hybrid) you want.
  2. 查看可用迁移指南列表,查找与 Azure 文件共享的源和部署匹配的详细指南。Review the list of available migration guides to find the detailed guide that matches your source and deployment of Azure file shares.

关于本文中提到的 Azure 文件存储技术的详细信息:More information about the Azure Files technologies mentioned in this article: