Skip to content

Commit 6b54ba1

Browse files
committed
Main content add
1 parent fd2e7c2 commit 6b54ba1

File tree

2 files changed

+216
-16
lines changed

2 files changed

+216
-16
lines changed

articles/storage/files/storage-files-migration-nas-hybrid.md

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
---
2+
title: On-premises NAS migration to Azure File Sync
3+
description: Learn how to migrate files from an on-premises Network Attached Storage (NAS) location to a hybrid cloud deployment with Azure File Sync and Azure file shares.
4+
author: fauhse
5+
ms.service: storage
6+
ms.topic: conceptual
7+
ms.date: 03/19/2020
8+
ms.author: fauhse
9+
ms.subservice: files
10+
---
11+
12+
# Migrate files from an on-premises Network Attached Storage (NAS) location to a hybrid cloud deployment with Azure File Sync and Azure file shares
13+
14+
Azure File Sync works on Direct Attached Storage (DAS) locations and does not support sync to Network Attached Storage (NAS) locations.
15+
This fact makes a migration of your files necessary and this article guides you through the planning and execution of such a migration.
16+
17+
## Migration goals
18+
19+
The goal is to move the shares that you have on your NAS appliance to a Windows Server with Azure File Sync in a way that guarantees the integrity of the production data as well as availability during the migration. The latter requires keeping downtime to a minimum, so that it can fit into or only slightly exceed regular maintenance windows.
20+
21+
## Migration overview
22+
23+
As mentioned in the [Azure Files migration overview](storage-files-migration-overview.md) article, using the correct copy tool and approach is important. Your NAS appliance is exposing SMB shares directly on your local network. RoboCopy, built-into Windows Server, is the best way to to move your files in this migration scenario.
24+
25+
- Phase 1: Identify how many Azure file shares you need
26+
- Phase 2: Provision a suitable Windows Server on-premises
27+
- Phase 3: Deploy Azure storage resources
28+
- Phase 4: Deploy the Azure File Sync agent
29+
- Phase 5: Configure Azure File Sync on the Windows Server
30+
- Phase 6: RoboCopy
31+
- Phase 7: User cut-over
32+
33+
## Phase 1: Identify how many Azure file shares you need
34+
35+
[!INCLUDE [storage-files-migration-namespace-mapping](../../../includes/storage-files-migration-namespace-mapping.md)]
36+
37+
## Phase 2: Provision a suitable Windows Server on-premises
38+
39+
* Create a Windows Server 2019 - at a minimum 2012R2 - as a virtual machine or physical server. A Windows Server fail-over cluster is also supported.
40+
* Provision or add Direct Attached Storage (DAS as compared to NAS, which is not supported).
41+
42+
The amount of storage you provision can be smaller than what you are currently using on your NAS appliance, if you plan on using Azure File Syncs [cloud tiering](storage-sync-cloud-tiering.md) feature.
43+
However, when you copy your files from the larger NAS space to the smaller Windows Server volume in a later phase, you will need to work in batches. Move a set of files that fits onto the disk, let file sync and cloud tiering engage and when more free space arrives, proceed with the next batch of files. You can avoid this batching approach by provisioning the necessary space on the Windows Server. After the migration and when sync had a chance to get your server mostly in sync with the Azure file shares, you can decide to reduce the volume size and create a smaller on-premises cache.
44+
45+
The resource configuration (compute and RAM) of the Windows Server you deploy depends mostly on the number of items (files and folders) you will be syncing. We recommend going with a higher performance configuration if you have any concerns.
46+
47+
[Learn how to size a Windows Server based on the number of items (files and folders) you need to sync.](storage-sync-files-planning.md#recommended-system-resources)
48+
49+
> [!NOTE]
50+
> The previously linked article presents a table with a range for server memory (RAM). You can orient towards the smaller number for your server but expect that initial sync can take significantly more time.
51+
52+
53+
## Phase 3: Deploy Azure storage resources
54+
55+
In this phase, consult the mapping table from phase one and use it to provision the correct number of Azure storage accounts and file shares within them.
56+
57+
[!INCLUDE [storage-files-migration-provision-azfs](../../../includes/storage-files-migration-provision-azure-file-share.md)]
58+
59+
## Phase 4: Deploy Azure File Sync
60+
61+
[!INCLUDE [storage-files-migration-deploy-afs-agent](../../../includes/storage-files-migration-deploy-azure-file-sync-agent.md)]
62+
63+
# Phase 5: Configure Azure File Sync on the Windows Server
64+
65+
Your registered on-premises Windows Server must be ready and connected to the internet for this process.
66+
67+
[!INCLUDE [storage-files-migration-configure-sync](../../../includes/storage-files-migration-configure-sync.md)]
68+
69+
> [!IMPORTANT]
70+
> Cloud tiering is the AFS feature that allows the local server to have less storage capacity than is stored in the cloud, yet have the full namespace available. Locally interesting data is also cached locally for fast access performance. Cloud tiering is an optional feature per Azure File Sync "server endpoint".
71+
72+
> [!WARNING]
73+
> If you provisioned less storage on your Windows server volume(s) than your data used on the NAS appliance, then cloud tiering is mandatory. If you do not turn on cloud tiering, your server will not free up space to store all files. Set your tiering policy, temporarily for the migration, to 99% volume free space. Be sure to return to your cloud tiering settings after the migration is complete, and set it to a more long-term useful level.
74+
75+
Repeat the steps of sync group creation and addition of the matching server folder as a server endpoint for all Azure file shares / server locations, that need to be configured for sync.
76+
77+
After the creation of all server endpoints, sync is working. You can create a test file and see it sync up from your server location to the connected Azure file share (as described by the cloud endpoint in the sync group).
78+
79+
Both locations, the server folders and the Azure file shares are otherwise empty and awaiting data in either location. In the next step, you will begin to copy files into the Windows Server for Azure File Sync to move them up to the cloud. In case you've enabled cloud tiering, the server will then begin to tier files, should you run out of capacity on the local volume(s).
80+
81+
## Phase 6: RoboCopy
82+
83+
The basic migration approach is a RoboCopy from your NAS appliance to your Windows Server, and Azure File Sync to Azure file shares.
84+
85+
Run the first local copy to your Windows Server target folder:
86+
87+
* Identify the first location on your NAS appliance.
88+
* Identify the matching folder on the Windows Server, that already has Azure File Sync configured on it.
89+
* Start the copy using RoboCopy
90+
91+
The following RoboCopy command will copy files from your NAS storage to your Windows Server target folder. The Windows Server will sync it to the Azure file share(s).
92+
93+
If you provisioned less storage on your Windows Server, than your files take up on the NAS appliance, then you have configured cloud tiering. As the local Windows Server volume gets full, [cloud tiering](storage-sync-cloud-tiering.md) will kick in and tier files that have successfully synced already. Cloud tiering will generate enough space to continue the copy from the StorSimple virtual appliance. Cloud tiering checks once an hour to see what has synced and to free up disk space to reach the 99% volume free space.
94+
It is possible, that RoboCopy moves files faster than you can sync to the cloud and tier locally, thus running out of local disk space. RoboCopy will fail. It is recommended that you work through the shares ina sequence that prevents that. For example, not starting RoboCopy jobs for all shares at the same time, or only moving shares that fit on the current amount of free space on the Windows Server, to mention a few.
95+
96+
```console
97+
Robocopy /MT:32 /UNILOG:<file name> /TEE /B /MIR /COPYALL /DCOPY:DAT <SourcePath> <Dest.Path>
98+
```
99+
100+
Background:
101+
102+
:::row:::
103+
:::column span="1":::
104+
/MT
105+
:::column-end:::
106+
:::column span="1":::
107+
Allows for RoboCopy to run multi-threaded. Default is 8, max is 128.
108+
:::column-end:::
109+
:::row-end:::
110+
:::row:::
111+
:::column span="1":::
112+
/UNILOG:\<file name\>
113+
:::column-end:::
114+
:::column span="1":::
115+
Outputs status to LOG file as UNICODE (overwrites existing log).
116+
:::column-end:::
117+
:::row-end:::
118+
:::row:::
119+
:::column span="1":::
120+
/TEE
121+
:::column-end:::
122+
:::column span="1":::
123+
Outputs to console window. Used in conjunction with output to a log file.
124+
:::column-end:::
125+
:::row-end:::
126+
:::row:::
127+
:::column span="1":::
128+
/B
129+
:::column-end:::
130+
:::column span="1":::
131+
Runs RoboCopy in the same mode a backup application would use. It allows RoboCopy to move files that the current user does not have permissions to.
132+
:::column-end:::
133+
:::row-end:::
134+
:::row:::
135+
:::column span="1":::
136+
/MIR
137+
:::column-end:::
138+
:::column span="1":::
139+
Allows to run this RoboCopy command several times, sequentially on the same target / destination. It identifies what has been copied before and omits it. Only changes, additions and "*deletes*" will be processed, that occurred since the last run. If the command wasn't run before, nothing is omitted. This is an excellent option for source locations that are still actively used and changing.
140+
:::column-end:::
141+
:::row-end:::
142+
:::row:::
143+
:::column span="1":::
144+
/COPY:copyflag[s]
145+
:::column-end:::
146+
:::column span="1":::
147+
fidelity of the file copy (default is /COPY:DAT), copy flags: D=Data, A=Attributes, T=Timestamps, S=Security=NTFS ACLs, O=Owner info, U=aUditing info
148+
:::column-end:::
149+
:::row-end:::
150+
:::row:::
151+
:::column span="1":::
152+
/COPYALL
153+
:::column-end:::
154+
:::column span="1":::
155+
COPY ALL file info (equivalent to /COPY:DATSOU)
156+
:::column-end:::
157+
:::row-end:::
158+
:::row:::
159+
:::column span="1":::
160+
/DCOPY:copyflag[s]
161+
:::column-end:::
162+
:::column span="1":::
163+
fidelity for the copy of directories (default is /DCOPY:DA), copy flags: D=Data, A=Attributes, T=Timestamps
164+
:::column-end:::
165+
:::row-end:::
166+
167+
# Phase 7: User cut-over
168+
169+
When you run the RoboCopy command for the first time, your users and applications are still accessing files on the NAS and potentially change them. It is possible, that RoboCopy has processed a directory, moves on to the next and then a user on the source location (NAS) adds, changes, or deletes a file that will now not be processed in this current RoboCopy run. That is expected.
170+
171+
The first run is about moving the bulk of the data to your Windows Server and into the cloud via Azure File Sync. This can take a long time, depending on:
172+
173+
* your download bandwidth
174+
* the recall speed of the StorSimple cloud service
175+
* the upload bandwidth
176+
* the number of items (files and folders), that need to be processed
177+
178+
Once the initial run is complete, run the command again.
179+
180+
The second time it will finish faster, because it only needs to transport changes that happened since the last run. During this second run, still, new changes can accumulate.
181+
182+
Repeat this process until you are satisfied that the amount of time it takes to complete a RoboCopy for a specific location is within an acceptable window for downtime.
183+
184+
When you consider the downtime acceptable and you are prepared to take the NAS location offline: In order to take user access offline, you have the option to change ACLs on the share root such that users can no longer access the location or take any other appropriate step that prevents content to change in this folder on your NAS.
185+
186+
Run one last RoboCopy round. This will pick up any changes, that might have been missed.
187+
How long this final step takes, is dependent on the speed of the RoboCopy scan. You can estimate the time (which is equal to your downtime) by measuring how long the previous run took.
188+
189+
Create a share on the Windows Server folder and possibly adjust your DFS-N deployment to point to it. Be sure to set the same share-level permissions as on your NAS SMB share. If you had an enterprise-class domain-joined NAS, then the user SIDs will automatically match as the users exist in Active Directory and RoboCopy copies files and metadata at full fidelity. If you have used local users on your NAS, you need to re-create those as local users on your Windows Server and map the existing SIDs RoboCopy moved over to your Windows Server to the SIDs of your new, Windows Server local users.
190+
191+
You have finished migrating a share / group of shares into a common root or volume. (Depending on your mapping from phase one)
192+
193+
You can try to run a few of these copies in parallel. We recommend processing the scope of one Azure file share at a time.
194+
195+
> [!WARNING]
196+
> Once you have moved all the data from you NAS to the Windows Server, and your migration is complete: Return to ***all*** sync groups in the Azure portal and adjust the cloud tiering volume free space percent value to something better suited for cache utilization, say 20%.
197+
198+
The cloud tiering volume free space policy acts on a volume level with potentially multiple server endpoints syncing from it. If you forget to adjust the free space on even one server endpoint, sync will continue to apply the most restrictive rule and attempt to keep 99% free disk space, making the local cache not performing as you might expect. Unless it is your goal to only have the namespace for a volume that only contains rarely accessed, archival data and you are reserving the rest of the storage space for another scenario.
199+
200+
## Troubleshoot
201+
202+
The most likely issue you can run into, is that the RoboCopy command fails with *"Volume full"* on the Windows Server side. Cloud tiering acts once every hour to evacuate content from the local Windows Server disk, that has synced. It's goal is to reach your 99% free space on the volume.
203+
204+
Let sync progress and cloud tiering free up disk space. You can observe that in File Explorer on your Windows Server.
205+
206+
When your Windows Server has sufficient available capacity, rerunning the command will resolve the problem. Nothing breaks when you get into this situation and you can move forward with confidence. Inconvenience of running the command again is the only consequence.
207+
208+
Check the link in the following section for troubleshooting Azure File Sync issues.
209+
210+
## Relevant links
211+
212+
Azure File Sync content:
213+
214+
* [AFS overview](https://aka.ms/AFS)
215+
* [AFS deployment guide](storage-files-deployment-guide.md)
216+
* [AFS troubleshooting](storage-sync-files-troubleshoot.md)

0 commit comments

Comments
 (0)