This is a Step-by-Step tutorial to Migrate Files from File Share to SharePoint Online using the new Office 365 Import Service. Office 365 Import Service was launched by Microsoft initially to migrate PST files to Office 365 Exchange mailboxes. Recently, Microsoft extended the Import Service so users on On-premises can Import data into SharePoint Online and OneDrive for Business.
Note : Office 365 Import service (which is currently in Preview) will require a License to use in future. This is NOT a Free to use service. You can use the alternative method of using Azure Storage where an Azure Subscription would be required to create the storage space for import. See the detailed post on Step-by-Step: Migrate Files to SharePoint Online using Azure Storage
In this post, lets discuss the high-level step :
1. To begin with, you would need SharePoint Online Management Shell to connect to Office 365 and Azure services. Check out my post Connect to Office 365 using PowerShell to connect to your Office 365 site using PowerShell.
After connecting to Office 365, my window will look like below.
2. Now before you begin, make sure you have the Content ready that you need to upload. I have created a Shared folder “SharePointFileShare” with few files in my local machine’s C: drive.This folder needs to be shared so Azure tool can access it.
3. Next, Navigate to Office 365 admin center and then select IMPORT .
4. On Import Page, choose plus (+) then select Upload data over network.
In the Wizard, click on Show Secure Key & Show URL and then Copy the key & URL.
Copy the Key & URL and minimize the wizard window for now.
5. Next lets create a Package to Upload. A “package” comprises of content (binaries such as documents, images, attachments) and manifest xml files.
The basic process is as follows :
First, we will use New-SPOMigrationPackage cmdlet with parameters to create a package from fileshare.
Source : Source is a Shared fileshare on your machine where you have the files to upload or on On-prem SharePoint.
For e.g. C:\SharePointFileShare is Source in our case.
Output or Package path: Once you run the New-SPOMigrationPackage command you would create a SharePoint Online Package as an Output.
Parameter : IncludeFileSharePermissions is need if you want the permissions on the files to be reapplied automatically when they reach the cloud.
Run the following in SharePoint Online Management Shell to create the package.
New-SPOMigrationPackage -SourceFilesPath \\IshaPC\SharePointFileShare -OutputPackagePath C:\SPO_Package -IncludeFileSharePermissions -TargetWebUrl “YourSharePointSiteURL” -TargetDocumentLibraryPath “Documents” -NoAdLookup
Check the Package folder at C:\SPO_Package or whatever your location was.
Note : If you are getting an error like “The LDAP server is unavailable.” error see here
6. Next, lets use the ConvertTo-SPOMigrationTargetedPackage to Convert the package we created in last step into the format that SPO will support for the job.
To do this, Run the following :
ConvertTo-SPOMigrationTargetedPackage -SourceFilesPath \\IshaPC\SharePointFileShare -SourcePackagePath C:\SPO_Package -OutputPackagePath C:\SPO_Package\targetedPackage -TargetWebUrl https://learningwayinstitute.sharepoint.com -TargetDocumentLibraryPath “Documents”
Enter the SharePoint Online Credentials.
Check the Target Package once created.
7. So once you have the package ready, lets use the Set-SPOMigrationPackageAzureSource to specify the Azure Source & key (copied in step #4) and upload the Azure Storage source to temporarily keep the files.
$azurelocations = Set-SPOMigrationPackageAzureSource -SourceFilesPath \\IshaPC\SharePointFileShare -SourcePackagePath C:\SPO_Package -AccountName AccountName -AccountKey “SecureKey” -PackageContainerName package
If successful, Verify that the files have been uploaded in Azure Storage.
8. You can check the files that are uploaded in Azure using Azure Storage Explorer. Go to the link and download the Azure Storage Explorer.
Note : Do not edit/delete/modify any tables/containers/blobs using Azure Storage Explorer or any other tool. Doing so may cause job failures that will be impossible to recover from.
9.Finally, now that the files have been uploaded, let’s just Create a job for Office 365 to import these files into the SharePoint Online library.
Now before proceeding, prepare a SharePoint Online Mapping file. Download the SPO Mapping file to fill-up your own entries.
Upload the file in next screen of your wizard when ready.
Finally, verify in the Office 365 admin center to see the status of the job.
If you do not want to use Office 365 Import for some reasons check out this very similar method that required Azure Strogae (can be created using your Azure Subscription). See the details @ Step-by-Step: Migrate Files to SharePoint Online using Azure Storage