Blog/Migrations

Moving OneDrive between tenants with the native tool

Trust, identity map, the move itself and the one rule that decides whether a user goes native or to a third-party tool.

MigrationsSharePoint & OneDrive
Applies toSharePoint Online, both tenants
ToolingNative, first party
Run fromSharePoint Online Management Shell
Source during moveRead-only

How it works

SharePoint moves each OneDrive from the source to the target and leaves a redirect behind. Permissions are rewritten using an identity map that the target admin uploads. The target user must exist and must not have a OneDrive yet: anyone who already signed in to the target and got a OneDrive is refused, so check provisioning first and route those users to a third-party tool.

Source tenantTarget tenant1Partner: targetSet relationship2Partner: sourceSet relationship3Verify trustBoth sides4Pre-create usersNo OneDrive yet5Check provisioningRoute the rest6Upload identity mapUsers and groups7Start movesPer user8Monitor to SuccessRedirect left
Steps 1 to 4 happen once. Steps 5 to 8 repeat for every wave.

Before you start

RequirementWhereWhy it matters
Cross-Tenant User Data Migration licenceOne per migrated userRequired for the move.
SharePoint AdministratorBoth tenantsSets the relationship, uploads the map, starts moves.
Latest SharePoint Online Management ShellWindows admin workstationThe cross-tenant cmdlets ship with recent versions only.
Target users created, OneDrive not provisionedTarget tenantA provisioned OneDrive blocks the native move.
Identity map CSVTarget tenantRewrites permissions from source to target identities.

Set up the trust (once)

  1. 1

    Get both host URLs

    Both

    Each tenant has a cross-tenant host URL. Exchange them between the two admins.

    PowerShell · Both
    Connect-SPOService -Url https://kestrel-admin.sharepoint.com
    Get-SPOCrossTenantHostUrl
  2. 2

    Set the relationship on each side

    Both

    In the source, name the target as partner. In the target, name the source as partner. Both use the M&A scenario.

    PowerShell · Both
    # Source tenant
    Set-SPOCrossTenantRelationship -Scenario MnA -PartnerRole Target -PartnerCrossTenantHostUrl $TargetHostUrl
    # Target tenant
    Set-SPOCrossTenantRelationship -Scenario MnA -PartnerRole Source -PartnerCrossTenantHostUrl $SourceHostUrl
  3. 3

    Verify the trust

    Both

    Run the verification on both sides before going further, and check the compatibility status.

    PowerShell · Both
    Verify-SPOCrossTenantRelationship -Scenario MnA -PartnerRole Target -PartnerCrossTenantHostUrl $TargetHostUrl
    Get-SPOCrossTenantCompatibilityStatus -PartnerCrossTenantHostUrl $TargetHostUrl

    Expected result: Both sides report the relationship as compatible.

Run a wave

  1. 1

    Check who is already provisioned

    Target

    List target users who already have a personal site. Route them to the third-party tool and move everyone else natively.

    PowerShell · Target
    Get-SPOSite -IncludePersonalSite $true -Limit All -Filter "Url -like '-my.sharepoint.com/personal/'" |
      Select Url, Owner
  2. 2

    Upload the identity map

    Target

    Include every user in the wave and the groups whose permissions must carry over.

    PowerShell · Target
    Add-SPOTenantIdentityMap -IdentityMapPath "C:\Waves\B07-identitymap.csv"
  3. 3

    Tell users the window

    Both

    The source OneDrive is read-only while it moves. Files saved during the move fail to sync, so send the window in advance.

  4. 4

    Start the moves

    Source

    Start one move per user from the source tenant.

    PowerShell · Source
    Import-Csv .\B07.csv | ForEach-Object {
      Start-SPOCrossTenantUserContentMove -SourceUserPrincipalName $_.SourceUPN `
        -TargetUserPrincipalName $_.TargetUPN -TargetCrossTenantHostUrl $TargetHostUrl }
  5. 5

    Monitor until Success

    Source

    States go Queued, InProgress, then Success or Failed. Check on a schedule rather than by hand.

    PowerShell · Source
    Get-SPOCrossTenantUserContentMoveState -PartnerCrossTenantHostURL $TargetHostUrl -UserPrincipalName [email protected]

    Expected result: State is Success and the source URL redirects to the target.

Watch out. A user who signs in to the target before the move gets a new empty OneDrive and can no longer receive a native move. Block sign-in on target accounts until the cutover.
See Block sign-in on a target userLearn console · Admin center › Active users

Get the next guide by email

The Cutover is a monthly email with new guides and what we learned on recent waves.

Related

GuideMigrationsExchange

Cross-tenant mailbox migration, end to end

The native Exchange Online path from trust setup to cutover, with every step, the PowerShell behind it and the checks that stop a wave failing on the night.

24 Nov 202618 min read
GuideMigrationsIntune

Device migration between tenants: three paths and when to use each

There is no native button to move an Intune device to another tenant. How to choose between a reset, an Autopilot re-registration and a profile move, and the exact steps for each.

10 Nov 202612 min read
GuideEntra IDMigrations

Set up PIM before the migration starts

Engineers need Exchange and SharePoint admin rights in two tenants. Make them eligible, not permanent, and keep a clean audit trail.

3 Nov 20269 min read