Back in the day, Microsoft handled the tenant-to-tenant migration, but lately, organisations can now manage this. Now, Microsoft undertakes region-to-region migrations, which can be initiated by raising a ticket with Microsoft support.

Disclaimer: These instructions are here to help you understand the process. Before following these steps in a production environment, read and understand the official Microsoft documentation.

In this post, I will share a guide that breaks down the steps to help you migrate your environment from one tenant to another, hosted in the same region.

Before doing anything, bear in mind the following notes:

  • Supported environments for the Tenant-to-Tenant migration process are production and sandbox.
  • Unsupported environments are the default, developer, trial and teams.
  • Unsupported components:
    • Dynamics 365 Customer Voice
    • Omnichannel for Customer Service
    • Component library
    • Dynamics 365 Customer Insights—Journeys
    • Dynamics 365 Customer Insights—Data

Reference: Before starting a tenant-to-tenant migration

 

Prerequisites

Some prerequisites must be completed before starting a tenant-to-tenant migration. I will emphasise some key steps during the process to ensure a smooth and successful migration.

These are:

 

Pre-migration Steps

  • Power Apps: You need to export all Power Apps manually.
  • Power Automate flows: All Power Automate flows that need migration must have their definitions added to Dataverse solutions in the source environment.
  • Power Pages: Export  Power Pages website within a solution and delete.
  • Copilot Studio Agents: You must manually export Copilot Studio agents and reconfigure some of their dependent components during or after the migration.

References: Power Apps, Power Automate Flows, Power Pages, Copilot Studio agents

For User Accounts:

  • Ensure the user accounts from the source are also created in the target tenant
  • The users in the target tenant must have the appropriate licenses assigned
  • Create the CSV file with the users you want to create in the target environment
  • The CSV file must be named usermapping.csv
    • The CSV lettering must be like the one below:user1@source.com,user1@target.com

Before creating the CSV file, export the Administrative and Full Access Users from the environment.

The instructions below will help you to do that.

    1. Open Advanced Find.
    2. Select Users from the “Look for:” drop-down menu, and from the “Use Saved View:” drop-down Administrative Access Users, tap on the Results button.

3. Select Users from the “Look for:” drop-down menu, and from the “Use Saved View:” drop-down Full Access Users, tap the Results button.

Source Tenant

The PowerShell scripts below must be run by the source tenant admin.

#Source Tenant Environment ID: {value}
#Source Tenant ID: {value}
#Source Organization ID: {value}
#--------------------------------------
#Target Tenant Environment ID: {value}
#Target Tenant ID: {value}
#Target Organization ID: {value}

#Step 1
Add-PowerAppsAccount

#Step 2
TenantToTenant-SubmitMigrationRequest –EnvironmentName {Source-EnvironmentId} -TargetTenantID {Target-TenantID}

#Step 3
TenantToTenant-ViewMigrationRequest

Target Tenant

The PowerShell scripts below must be run by the target tenant admin.

#Step 4
Add-PowerAppsAccount

#Step 5
TenantToTenant-ViewApprovalRequest

#Step 6
TenantToTenant-ManageMigrationRequest -MigrationId {Use the Migration ID from the command above to approve or deny the request}

 

Source Tenant

The PowerShell scripts below must be run by the source tenant admin.

#Step 7
GenerateResourceStorage-PowerAppEnvironment –EnvironmentName {Source Environment ID}


#Step 8
#Upload the user mapping file

$SASUri ='https://bapfeblobprodln.blob.core.windows.net/################################################?sv=2018-03-28&sr=c&si=SASpolicy&sig=################################################'
$Uri = [System.Uri] $SASUri

$storageAccountName = $uri.DnsSafeHost.Split(".")[0]
$container = $uri.LocalPath.Substring(1)
$sasToken = $uri.Query
 
# File to upload
# Note that the file name should be usermapping.csv (case sensitive) with comma separated values.
$fileToUpload = 'C:\Files\usermapping.csv'
 
# Create a storage context
$storageContext = New-AzStorageContext -StorageAccountName $storageAccountName -SasToken $sasToken
 
# Upload the file to Azure Blob Storage
Set-AzStorageBlobContent -File $fileToUpload -Container $container -Context $storageContext -Force

#Step 9
TenantToTenant-PrepareMigration 
-MigrationId {Source - MigrationId} 
-TargetTenantId {TargetTenantId} 
-ReadOnlyUserMappingFileContainerUri {SasUri}


#Step 10
TenantToTenant-GetMigrationStatus -MigrationId {Source - MigrationId}

#Step 11
TenantToTenant-MigratePowerAppEnvironment
-MigrationId {Source - MigrationId}
-TargetTenantId {Target - TenantId}

#Step 12
TenantToTenant-GetMigrationStatus -MigrationId {Source - MigrationId}

 

Post-migration Steps

After moving to a new tenant, note the following:

  • The environment URL, organisation ID, and name remain unchanged.
  • The source environment doesn’t include Dataverse.
  • Users not in the mapping file will not be migrated and must be added afterwards.

Post-migration steps for Power Apps

Solution-aware apps

  • Choose the new environment in Power Apps, go to the Solutions page, and click Import.
  • Use the file selector to select your exported packages.
  • After importing, verify the solution contents to ensure that all elements have been transferred successfully.

Not solution-aware apps

  • Choose the option to Import a Canvas app.
  • Upload the file for the app package.
  • Select all necessary import options, then click Import.
  • Repeat this process until all the apps have been successfully imported.

Post-migration steps for Power Automate Flows

After the migration, follow these steps to adjust and activate components:

  • Establish connections for all referenced connections.
  • Start all flows, beginning with child flows and then proceeding to parent flows.
  • For HTTP-triggered flows, get the new URL and update it in any calling apps or flows.

Post-migration steps for Power Pages

Complete the following steps for each website in the environment:

  • Sign in to the website environment.
  • Open the admin centre.
  • Provision the website with the same portal type and language.

After migration, validate the environment in the target tenant. Then, delete the source environment in the Power Platform admin centre.

 

Related content

 

Share This