Blog

Migrating user’s files to OneDrive

SharePoint Migration Tool

The “cloud” has become very popular nowadays and the companies trend is move their resources to the cloud, including their user’s files
If you are planing to move your users files to OneDrive for business and you don’t know the tool “SharePoint Migration Tool”, read this before pay a couple of hundreds or thousands of dollars for a third party tool.

SharePoint Migration Tool is a great tool created by Microsoft to help you to migrate local / network fileshares data to OneDrive or SharePoint.
Even, you can migrate data from an On-Prem SharePoint Server to SharePoint Online (I didn’t try).

Scenario

I’m going to show you how to migrate user’s files from a “network fileshare” to OneDrive for business in a couple of steps.

Prerequisites

Before start using the tool, we need to have access to the user’s files (read all) and also we need writes permissions on user’s OneDrive (SharePoint site).
I’m not going to cover how to assign you permissions to others user’s OneDrive, but it is really easy task to do from the “SharePoint Admin Center”, the problem with this method is that you can’t assign you permissions to a bulk of users, you have to add those permissions user by user manually.
I created a PowerShell script that I’m going to share later to assign those permissions to a bulk of users

Hands On

First thing to do (obviously) is download the tool from Microsoft.
You can download the latest version from here: SharePoint Migration Tool
Once you did open the tool, you have to sign in using your own credentials .

Starting a new migration

You have to select the option: “Select new sources and destination” (first time) for start to build your new migration.
Then you have to select your data source (from where you want to move the files to OneDrive).

Migrating from File Share

Once you selected the option: File Shared
You will get the next “window” asking for the source path (network or local folder).

You have to specify where are your files.

The next step is specify the destination point, which is your user’s OneDrive location (SharePoint site)

The next step is click on the button “Add” to create your migration batch.
I’m not going to show you the next “windows” (after click on “Add”) because I want to show you how yo use a JSON file to the migration, which is the best option in real scenarios where you want to migrate a bulk of users.

Migrating from a JSON file

Instead of select “File Share” as source for our migration, we are going to use a JSON file which contains all the information required by the tool to perform the migration.
The cool thing about use the JSON file is that you can add multiple “tasks” at the same time and migrate a bulk of users.

JSON structure

Your JSON file show have the next structure

1
2
3
4
5
6
7
8
9
10
{
    "Tasks":  [
                  {
                      "TargetList":  "Documents",
                      "TargetListRelativePath":  "subfolder",
                      "TargetPath":  "https://yourdomain-my.sharepoint.com/personal/username_domain_com/",
                      "SourcePath":  "network or local path"
                  }
              ]
}

I’m going to explain a little bit this structure and also provide you the link with the Microsoft documentation about it.

First as you can see this JSON file contains an array with the name “Tasks” where you will add “objects” with your task’s definitions.
On this example, my “Tasks” array only have one “task” or “object”, but you can add more separating by “,” every “task” definition.

  • TargetList: Required. Enter the name of the document library with the SharePoint Online site where the files are to be migrated.
  • TargetListRelativePath: Optional . Enter the name of the subfolder in the document library. If this column is left empty then the files will be moved to the root level.
  • TargetPath: Required . Enter the SharePoint Online site URL where the files are to be migrated.
  • SourcePath: Required . Enter either a file share path or an on-premises SharePoint Server site URL.

Selecting JSON as source file

Once you created your JSON file and it is saved in your computer, you have to select that file for create your migration batch.

Once the your JSON file is selected, the tool it is going to do some validations.

Once you clicked on the “Add” button, the next window is going to show you an overview off all your “migration tasks”.
In our case is only one user.

Click on “Migrate” button to start the migration.

Migration progress

You will be able to see the migration progress at any time, even you can pause or stop the migration and you are not going to lose your progress (Amazing)

Be smart and add a descriptive migration batch name

Migration completed

After you migration is completed you will get a prompt asking for save the current migration for future incremental runs.
This is great feature, because if for some reason you have to stop the migration, you can resume the migration without lose all your progress (Yeah baby!!!).

Conclusion

This tool is really really powerful, I didn’t dig in all the options that this tool has, but trust me, you have to try it before buy a third party software to do your migrations.
I’m more than happy with the results, because we were able to migrate hundred of users without much effort.
I did created a script for generate the JSON file from a list of users and also the script for add and remove permissions to a single user on a multiple user’s OneDrive.
Let me know if you want me to share those Scripts.

Regards!


Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: