File Server Home Directories to OneDrive for Business Migration Guide, Using PowerShell

Introduction

This guide provides the procedures for migrating home directories from Windows File Servers to OneDrive for Business. The personal version of OneDrive that is included with Outlook.com/Hotmail.com is not supported.

Note that OneDrive data may not be accessible for a few days after migration, due to OneDrive's crawling and indexing process. We suggest having your users log in immediately after migration, but warn them that their data may not be available immediately. For this reason, it may be best to complete the migration on a Friday so the indexing can happen over the weekend.

First migration?

We’ve created a guide on scoping, planning, and managing the migration process for your use. If this is your first migration, we recommend reading this guide carefully.

MigrationWiz

MigrationWiz is a migration tool, not a syncing tool. If changes are made at the source after migration, they will not sync to the destination, nor will changes made at the destination sync to the source. We do not have “live” monitoring of changes (as with a sync agent) and we cannot handle scenarios such as conflict resolution without user interaction.

MigrationWiz supports the capability to share migration projects across a Workgroup. When the Project Sharing feature is turned on, all Agents besides those who are Inactive can view all migrations projects. 

We are not able to support migrations with two-factor or multifactor authentication. 

The maximum file size for migration through MigrationWiz varies by migration type and environment, but may never exceed 60GB.

Prepare the Azure Environment

  1. Estimate Azure storage costs. This step is optional but is useful in providing the customer with upfront storage costs ahead of time.
  2. Buy an Azure subscription, or use the free one-month trial ( this option is only viable if you are performing a very small migration).
  3. Create an Azure storage account. We recommend that you create an Azure Storage Account in the same Microsoft data center as the Destination Microsoft 365 tenant. 
    1. Visit ​https://portal.az​ure.com​  
    2. Click Storage accounts
    3. Click Storage Create
    4. Select the subscription in which you want to create the new storage account.
    5. Select your Resource group.​ Create new if one doesn't exist.
    6. Enter a name for your storage account.​
    7. Choose your datacenter Location.
    8. Choose Standard performance
    9. In the Redundancy field, select Locally Redundant Storage (LRS).
    10. Click Review
    11. Click Create
    12. Once the deployment shows as complete, click on Go to resource
    13. Select Access keys under "Security + Networking"
    14. Copy the Storage account name and the key 1.  You will use this when running UploaderWiz and within the migration project.

You do not need to create any Azure containers for this migration. Separate containers are created on a per-home directory basis as they are uploaded. During migration, MigrationWiz will create two separate metadata files (with the extensions: -directory.metadata and -files.metadata), which will be added to each container. These are used during migration by MigrationWiz, to build the folder structure in OneDrive for Business and to migrate the permissions. They should not be deleted until after the migration.

Prepare machine(s) for PowerShell and UploaderWiz

We recommend that you perform these steps from a domain-joined computer when logged in with local admin rights.

  1. Install BitTitan PowerShell by downloading and installing BitTitan SDK.
  2. Create the C:\apps\uploaderwiz directory and then download and extract the UploaderWiz utility into that directory.
  3. Create the C:\scripts directory, download the mw_homedir_powershell_scripts.zip file and extract its contents into that directory. The folder name must be a single word, with no spaces or special characters. The files that are extracted into that folder are Log_Functions.ps1, ProjectImport.ps1, RunSubmission.ps1, and authorizationsettings.csv.
  4. Map a network drive to the home directory root folder on the file server if you are not running this from the machine the files are stored on.

Prepare the Destination Environment

  1. Set up the permissions which will be used for the migration

    1. Ensure you are signed in as a Global Admin.
    2. Go to MigrationWiz-SharePoint-FullControl and consent to the app access when prompted.
    3. Create new Security Group named “MigrationWiz” on the Microsoft 365 Admin Portal.
    4. Add the service account being used for the migration project as a member of this security group

    You will also want to make sure that you create the users within the destination tenant and pre-provision OneDrive for those users.  

Upload Files to Azure

Steps are performed from a file server, or a computer joined to the domain, when logged in with the domain admin account, with local admin rights to the machine. This process utilizes UploaderWiz. Our guides contain information on running, configuring, and troubleshooting UploaderWiz. 

  1. (Optional, but recommended) Set the file share migration batch to read-only access by user and inform the users that a migration is occurring and that their file shares are now read-only. This will prevent the user from adding files to these file shares during the migration.
  2. You can restrict users to read-only access to their Home Directories through the Active Directory Users and Computers console on the AD controller, or via PowerShell. Prerequisites:
      1. Create a CSV file containing all the usernames (SAMAccountName).
      2. Install the required AD module on the machine that you're running the script from.
      3. Example script: 

    Import-Module 'ActiveDirectory'
    import-csv E:\usersname.csv | foreach-object{
    $homeDrive = (Get-ADUser -Identity $_.name -Properties homedirectory).homedirectory #Query AD for the HomeDirectory attribute
    $ACL = Get-Acl $homeDrive
    $ACL.setAccessRule((New-Object System.Security.AccessControl.FileSystemAccessRule($_.name, "Read", "ContainerInherit,ObjectInherit", "none", "allow")))
    Set-Acl $homeDrive $ACL
    }

  3. From the command prompt, running as administrator, from the directory that UploaderWiz was extracted into, run the following command (replace the x's with your own information):
    UploaderWiz.exe -accesskey "xxxxxxxx" -secretkey "xxxxxxxxxxxxxxxxxxxxxxx" -type azureblobs -rootpath "xxxxxxxx" -homedrive true   Note: if you are performing these steps from a domain-joined computer, a network drive needs to be mapped from the domain-joined computer to the file server (e.g. x;\File Server).
      • The AccessKey will be the name of the storage account
      • The SecretKey will be the access key for the storage account
      • The RootPath will be the path to the files that you want to migrate 

The parameter -homedrive true creates separate blob containers for each file share, under your top-level Azure blob container.  For example, if you have folders called User1 and User2 under C:\Users and you set the rootpath parameter to "c:\Users" then a container named "User1" and another named "User2" would be created in the Azure storage account and the files within those folders uploaded to each.

 

Migration Steps

Once all the Homedrives have been uploaded, you will need to create a project for each container that was created.  These steps will allow you to use PowerShell to create those.  These steps are performed from the machine that was prepared for PowerShell and UploaderWiz

  1. Fill in all columns in the authorizationsettings.csv file for the user home directories that will be migrated in the migration batch.
    • The recommended directory, specified in the Prepare Machine(s) for PowerShell and UploaderWiz section above, was C:\scripts.
    • These are the BitTitan data centers that can be set: Canada, NorthEurope, NorthAmerica, WesternEurope, AsiaPacific, Australia, Japan, SouthAmerica. 
    • Once you have completed the first entry row, copy the entries for AccessKey, SecretKey, ODFBAdmin, ODFBPwd, BitTitanDatacenter and CustomerName into each subsequent row.
  2. Launch Windows PowerShell, and run the following command: Set-ExecutionPolicy Unrestricted
    This allows scripts that are not digitally signed to run in your PowerShell window.
  3. Run the projectimport.ps1 script. This sets up the projects. Upon completion, it will run a verify credentials against every MigrationWiz project that was created by the script.
    • This script will set all the necessary Advanced Options. These include:
      • Licensing/Maximum licenses = 5. Only one User Migration Bundle will be needed per user, however, the script does currently require this to be set. 
      • ShrinkFoldersMaxLength=300 
      • RenameConflictingFiles=1  
      • InitializationTimeout=8  
      • Preferred BitTitan Data Center. This will reflect the entry from the AuthorizationSettings.csv file, under the BitTitanDataCenter column.
    • Run the script, using the Windows PowerShell. Change to the directory that you extracted the scripts into, e.g., C:\scripts:> .\projectimport.ps1
    • When prompted for credentials, enter your BitTitan credentials.
    • All projects will be created with a name set to destinationemailaddress_ps. The '_ps' is used by the Full migration pass script (RunSubmission.ps1) so that it only starts migrations for those projects matching this name criterion.
  4. Run the RunSubmission.ps1 script (e.g., c:\scripts:> .\RunSubmission.ps1). This performs a Full migration pass.
    • When prompted for credentials, enter your BitTitan credentials. You can set your BitTitan account credentials within this script (but these could then be seen by others who have access to the script). This will avoid being prompted to enter your BitTitan account credentials.
    • Once the script completes, log into MigrationWiz and enter one of your projects. You can then monitor the progress of the migration.

Post-Migration Steps

  1. Remove access to the Source home directories.
  2. Provide training on OneDrive For Business.
  3. Delete directories from the staging directory; this is the directory that home directories were copied to prior to uploading them to Azure. Once all home directory batches have been completed, and all file shares and other data have been migrated, the Source file server can be decommissioned.
  4. Delete all the Azure blob containers that were created during the upload to Azure. This will prevent incurring post-migration Azure costs for these containers. Be careful to only delete the containers created by UploaderWiz; these will be names that match the home directories and have a create date from the date of the upload.

 

Was this article helpful?
2 out of 2 found this helpful