Migrate UserProfiles from FileServer to OneDrive

I would like to share my migration method for moving UserProfiles from a FileServer to OneDrive in Office 365. The migrationtool ShareGate is used for this migration. ShareGate is really powerful tool to move your data from a FileServer (Shared data & User Profiles) to Office 365 (SharePoint Online/Onedrive).

There are 6 steps involved in this migration.

Step 1: Create an overview of the profiles that you want to migrate. Which sources do you use? Which folders in the UserProfiles do you want to exclude? (configuration folder for example)

Step 2: Make sure that you assign a license to every user you want to migrate. Unlike Exchange Online you can’t synchronise files if you don’t have a license assigned.

Step 3: When you have assigned the licenses in Office 365 for OneDrive the OneDrive folders aren’t created automatically. The user needs to sign in to create the OneDrive folder. You can force this action using Powershell. There are 2 steps involved:

Create a CSV file in the following format:

If you are done creating your CSV file run this script:

This script will create a provisioning request for each user. This means that the OneDrive folder isn’t created instantly. It can take up to an hour for all OneDrive folders to be created.

Step 4: When all the OneDrive folders are created you need assign the migration account administrative permissions to each OneDrive folder. You can do this in ShareGate and the report function. It’s best if you use a generic admin account so users are not alarmed when they see that an admin has permissions to their OneDrive Folder.

Step 5: Its now time to populate a CSV File containing the source folder for the homefolder and the destination, the OneDrive Folder. You need to use the following format:

To help populate this CSV you can use this script to populate the “DIRECTORY” column:

To populate the second column you can export all the users from the Office 365 Admin Panel to a CSV.


Replace @domain.com with _domain_com/ so that you get the format username_domain_com/

Then insert https://tenantname-my.sharepoint.com/personal/ before username_domain_com/ so that you will end up with:

Then add the 2 columns so the output is:

The last step is the migration script. Run this script to upload your profiles to OneDrive:

If you have any questions about this migration method feel free to contact me.



Related Posts

Leave a Reply