Migrate to SharePoint Online

There are many options to consider if you want to migrate to SharePoint Online from an on premises SharePoint farm. Some of the options are more simple, but have restrictions and don’t copy across the meta data, document version history, and properties such as the document author or created date.

The options to migrate from SharePoint On-Premises to SharePoint Online include:

  • Drag and Drop documents from Windows Explorer to the Document Library
  • Click Upload within a document library to upload multiple files
  • Save Site As Template
  • Using OneDrive for Business to synchronize the document library
  • Use a migration tool
  • Use the Office 365 Migration API.

This article is going to explain how to migrate to SharePoint Online using the Office 365 Migration API. However, first let’s discuss some of the options and why using the Office 365 Migration API makes sense.

Migrate to SharePoint Online Using Drag and Drop

Migrating documents to SharePoint Online can be as easy as dragging and dropping a selection of documents into the library. Whilst this is a simple method and could perhaps be used for a handful of documents, there are limitations to it. Firstly the Created Date, and Created By meta data is not retained. The author of the document shows as the user dragging the content, and the timestamps are shown as the time the documents were uploaded. Version history is not included with this method, and it is also susceptible to CSOM throttling and file limits. Folders are also not included within a drag/drop.

Migrate to SharePoint Online Using Drag and Drop

Migrate to SharePoint Online Using Save Site as Template

It is possible to use the Save Site As Template or Save List As Template and include content. When creating a new list or site from the template in Office 365 SharePoint Online, your content will be present along with the Site Settings and List/Library Settings. The issue with this are mainly the save as migrating to SharePoint Online using Drag and Drop. The Author and Timestamps are set to the user who created the new site or list, versions are not included, and there is also a 50MB size limit which can be increased to 524MB.

Migrate to SharePoint Online Using Upload

Migrate to SharePoint Online Using Upload

You can click upload from within an Office 365 document library. The advantage this has over the Drag and Drop method, is that folders and their contents can be uploaded to the SharePoint Online Document Library. The same restrictions as the above methods also exist with regards to date time stamps and author information.

Migrate to SharePoint Online Using Upload

Migrate to SharePoint Online Using One Drive For Business

One Drive for Business can be used to sync documents with a document library in Office 365 SharePoint Online. This will include Folders and Files in one go, and there is a limit to 5000 items.

Migrate to SharePoint Online Using One Drive

Migrate to SharePoint Online Using The Office 365 Migration API

Perhaps the most complex method is to migrate to SharePoint Online using the Office 365 Migration API. This method is not particularly well documented. However, if you don’t have a budget for a migration tool, it is perhaps the fastest way of migrating all of your content along with metadata, timestamps and author information along with folders as well. Microsoft also throttle CSOM requests for the other methods above which is overcome using the Office 365 Migration API.

This method involves the following steps:

  1. The first step is to create an Azure Storage Account which will temporarily store the content you are migrating as a blob. The advantage this method has is that once your content is uploaded to the Azure Storage, a local copy at data centre level is used to get your content into the Office 365 SharePoint Online Document Library. The steps to creating an Azure Storage Account can be found here: https://azure.microsoft.com/en-gb/documentation/articles/storage-create-storage-account/
  2. If you haven’t already, you will need to install the SharePoint Online Management Shell. There are some gotchas here if migrating from SharePoint 2010 which I have covered in this blog post. To install the SharePoint Online Management Shell, follow these steps: https://www.microsoft.com/en-gb/download/details.aspx?id=35588
  3. Create a Migration Package. To do this, you will open the SharePoint On-Premises Management Shell and run it as Administrator. Using the Export-SPWeb command, you will export the document library or list that you wish to migrate to SharePoint Online. The command is as per below:
    1. Export-SPWeb -Identity http://OnPremURL/sites/subsite -ItemUrl “/sites/subsite/shared%20documents” -Path “C:\SPOnPremExport” -NoFileCompression -IncludeVersions 4
  4. Copy  the contents of c:\SPOnPremExport to a new folder path: c:\migrationpackages\SPOTemp
  5. Open the SharePoint Online Management Shell ISE and run the following commands to convert the package, upload the package to azure and submit your azure job:
    1. Connect to the SharePoint Online Tenant: Connect-SPOService -Url https://tenantname-admin.sharepoint.com
    2. Store the credentials in a variable to avoid an unauthorised error.
      1. $cred = Get-Credential
      2. Convert the Exported list or library to a migration package:
        1. ConvertTo-SPOMigrationTargetedPackage -SourceFilesPath “C:\MigrationPackages\SPOTEMP” -SourcePackagePath “C:\MigrationPackages\SPOTEMP” -TargetDocumentLibraryPath “/shared%20documents” -TargetWebUrl https://tenant.sharepoint.com/ -OutputPackagePath c:\migrationpackages\SPOTEMP -Credentials $cred
      3. Upload the package to your Azure Storage as a Blob:
        1. $azurelocations = Set-SPOMigrationPackageAzureSource -SourceFilesPath “C:\MigrationPackages\SPOTEMP” -SourcePackagePath “C:\MigrationPackages\SPOTEMP” -FileContainerName migration-files -PackageContainerName migration-package -AccountName “nameofyourstorage” -AccountKey “Wg3s3rF6yst6xg7Ee0R9+E9C/hkjfhdkjhfksdhkjfhsdkjfhksdjhff/wlBPdE1S4m3QvPbE3YyA==” -AzureQueueName “test”
      4. Submit the Job to be copied:
        1. Submit-SPOMigrationJob -TargetWebUrl https://tenant.sharepoint.com/ -MigrationPackageAzureLocations $azurelocations -Credentials $cred
  6. Your content will now be migrated pretty quickly and will include meta data/folders/version history etc. The method can be scripted to include all lists and libraries that you wish to migrate.

One issue with this method is that you will need to create the sites, lists and libraries and any custom columns before migrating. The advantage of using a migration tool is that the architecture of the sites/lists and libraries are also created. Nonetheless, this Office 365 migration api method is a huge timesaver.


Related Posts