When you’re moving from a homedirectories / fileshares (mapped to driveletters) based environment to a situation where you want your users to work in Onedrive for Business and Sharepoint Online, the best way to do so is to remove the homedirectories and shares and give your users access to Onedrive for Business and Sharepoint Online. One choice enforces adoption.

Of course, you also need to make the data compliant first, and upload it to Office 365. You can either let your users do this, or you can use my free tool!

O365Migrator will provision, authorize, clean up and upload. Everything you need to move from homedirectories or fileshares to Onedrive for Business and Sharepoint Online in one simple free tool.



How to use for homedirectories

  1. Make sure your users exist in Office 365 and are licensed, several days before you migrate
  2. Ensure your admin/migration user has a license (E3/E1) or provisioning will fail
  3. Use the pre-provisioning and authorization options of O365Migrator to ensure their Onedrive storage space is created (this won’t overwrite any existing data)
  4. Ensure their onedrives have been provisioned (log in as a few of them or browse their unique url)
  5. identify the login names of the user you wish to migrate in UPN format (office 365 login name)
  6. identify the paths to their home directories (UNC or local)
  7. Create a CSV file with two columns. The header of the first colum should be ‘username’, the second column should be ‘path’. Then add your users to it.
  8. Verify the homedirectories
  9. Upload them

How to use for fileshares

  1. Identify the URL to your site (usually in the form of https://tenant.sharepoint.com/siteXXX
  2. Identify the document library’s title (the ‘name’ field in the library properties)
  3. Select the folder you wish to upload
  4. Verify it first with the left button
  5. Upload it with the right one

How to use for both of the above

  1. Install the required components on your migration machine:
    1. Sharepoint Online Client SDK MSI
    2. Sharepoint Online Management Module
    3. Powershell 4 / .NET 4.5
    4. Office 365 Online Module (only step 1 is required)
  2. Run ‘Set-ExecutionPolicy Unrestricted’ in an elevated Powershell window, sign the script, or run the script in ByPass mode
  3. Download (O365Migrator_v0.98) or O365Migrator_v0.9 and unzip it locally
  4. Right click all files and unblock them if necessary
  5. Run O365Migrator.ps1 from the cmdline, NOT from ISE! (leave the other files in the same folder!)
  6. The csv file in the zip is an example file for homedirect migration
  7. Log files will be in %APPDATA%
  8. Specifying a subfolder is optional, this will create a subfolder in the destination and upload there instead of to the root
  9. Make sure you don’t set the document library property that enforces checkout/checking

Retrying failed items

By default, O365Migrator writes a .retry file to %Appdata% for any objects that have failed. You can load this file on the Folder Migration tab before pressing upload to only retry failed items. It will look for the original path to the file so don’t change names unless you know how to edit the .retry file with import-clixml.

If you’re fixing errors in homedirectories, you’ll have to treat the homedirectory as a Folder Migration, there is no automated retry for multiple homedirectories yet.

Important disclaimer

I’m not a real programmer, I do not guarantee this product will work in your setup, and I offer no dedicated support, I try to help everyone on a best-effort basis but also have to work for a living.

Leave a Reply

64 Comments on "O365Migrator"

Notify of
Sort by:   newest | oldest | most voted

Thank you for writing and sharing this for free guys! It’s worked perfectly for me to provision one drive for my domain users and move their files from file server to the cloud. Smaller batches have been done for testing , the rest are transferring now I’m confident enough, I couldnt believe how hassle free this tool was.

Top job guys , thanks for saving me a lot of time with this great tool.


Jos! Do you wear a cape? You should, because you are a hero! Where Microsoft epicly fails to provide tools and support to migrate from a fileshare to sharepoint/onedrive and other companies jump in with overpriced and overfunctional software you come up with this to save the day!

I almost gave up on moving a 200gb file share to sharepoint and tell the client to use other online storage.

Keep up the good work! Is there a donate button somewhere?

Hi Jos, first of all – thank you in advance for a potentially great tool! Having a problem with Folder Migration function. After all fields been filled in I am clicking in Scan & Fix (or Scan only – the result is the same) and then Upload. First pop up windows comes with the general Warning about upload and second one said: “You need to verify the folder before uploading it”. Then it is not doing anything. I guess that valid for v0.9 of the tool as here is no “Verify” button at all in 0.98 (your instructions above are… Read more »

Btw – 0.9 version works! The only question I have – is it possible to use nested folder in Subfolder name field? I mean I want to copy the data to Folder 3 which is located at Folder1/Folder2/Folder3?
Thanks again!


Are there any known limits on file sizes? I thought OneDrive supported 10GB but I get the following for files over 500mb:
Exception calling “SaveBinaryDirect” with “4” argument(s): “The remote server returned an error: (404) Not Found.”


Just wondering if others can post what sort of upload speed they’re getting? And if there is any way to speed it up?
I’m currently uploading 40GB with 400Mbps of bandwidth and an estimated time for 10hours.
It’s currently afterhours where I am, so I should have pretty much the full 400Mbps available to me. Obviously there are limitations with Microsoft’s end as well.


[…] O365Migrator […]

Hi Jos, Great work on the script but I’ve run into a few issues with the Data Cleaner side. I firstly tried to use 0.97. When I run Scan and Fix, it displays “Method invocation failed because [Alphaleonis.Win32.Filesystem.FileInfo] does not contain a method named ‘new'” in the CleanerResults for any files that it tries to rename, i.e. long file names or files with incorrect characters. I then tried to use 0.9. I had more success with this, as it truncated long file and folder names, however, it was unable to change files with the following characters in the name ,… Read more »

[…] O365Migrator […]


After a amout of time the tool seems to hang. Is there a solution for this problem?
I uploaded 3 GB of data but then it stops uploading.

Hey Jos, Once again, thanks for another tool which is helping your fellow professionals around the world!! Does the latest O365Migrator or any possible future iterations have the ability to re-import data prior to a particular timestamp? For example in my dilemma I used your tool to import data to Sharepoint but the ‘date modified’ for folders and files show as the date that I migrated the data. Would be really cool if the tool allowed us to import data before a certain time so that we can reimport data to fix the modified data of files and folders without… Read more »

Hi, thanks for putting together a great script. I was just wondering if it is possible to avoid having a O4BMoved folder and the MovedFilesAndFoldersReport.html written to each users OneDrive?


I keep getting errors for the .retry files, here is what I see when trying to add a retry file:

: Retry file specified: C:Users…O365MigratorFailedUploadObjectsForRetry….retry
: This only has effect on the Folder Migration Tab. If you wish to use a retry file for a homedirectory, process each homedirectory individually on this tab.

: To unload the retry file and run normally, restart O365Migrator

I have tried restarting the process many times with no success. Should I be doing this differently?


[…] O365Migrator […]


I get the error CSV file invalid.. you need to insert a valid CSV first. But i used the example, with a change to my users. Whats going wrong?

Phil warren

Really great tool for migrating users files, would be really interested in the permissions tool if it becomes available


Hi Jos,
Really loved it.. Can the tool migrate the permissions as well ?


Hi Jos, thanks for the effort – very cool!

My scenario is: do a first pass, then, a week later do a second “delta” pass.

It may be that files are changed and maybe deleted between the first and second pass.

Can the tool detect and handle deletions in this scenario?

Many thanks.


I did not found any activities in log that when sync is started and when sync is completed. Is this possible?


Since running this application the account used has been given full ownership of all files and folders across 365 tenant. Do you have a method to remove this functionality once data migrations have been completed?

Super Tool, I Use it a lot. I encounter the following things in migrating to SharePoint with this tool. 1. The forbidden character “~” is also not allowed on SharePoint this character isn’t scanned by the O365Datacleaner. 2. Could you also make a button “Scan Only” instead of “Scan and Fix” this wil allow us to make corrections in case the file is nested to deep and moved to O4BMoved, if many files are nested to deep from a lot of differtent folders it is much work to place them again in the right place. You have to work through… Read more »
The delta sync seems very slow, which seems to be because it compares file by file and then skips if it is identical, so does not save much time over a full sync. Could you not extract a file list attribute set from O365 and compare to the local home directory and generate a sync delta of changed files or similar to help speed up the process? Ideally you want to do an initial pass to load the files, and then a final sync a few days later when the user is ready to cut over, but this should be… Read more »

I’m getting constant throttling errors (429) when combining your script with other software, is there a way to avoid this?


Hi, thanks for a great tool. It works flawless for homedirs which reside on the same server as the O365 migratot, However when I have homedirectories on another server I keep getting the error that the homedirectories can not be accessed. Any ideas on how to work around this?


[…] O365Migrator will provision, authorize, clean up and upload. Everything you need to move from homedirectories or fileshares to Onedrive for Business and Sharepoint Online in one simple free tool. http://www.lieben.nu/liebensraum/o365migrator […]

Richard Parry

There are a few folder I’d like to exclude from migration – favorites (it’s redirected) and anything in Recycle.bin

I can see references to folderIgnoreList and the folderignore array but I can’t find the list of excluded folders to add these folders to the list.

Richard Parry

Never mind, found it – 365Migrator.ps1


Has there been anything done about the changes to the URL of the OD4B sites from March 2017. You can no longer use .onmicrosoft.com to connect to a site. It now uses a different format (basically just your domain name).