Migrate Microsoft Teams from One Tenant to Another – Why is it Such a Challenge?
Before we begin the process to Migrate Microsoft Teams from One Tenant to Another, we will discuss the main source of the issue. It is that the majority of Teams data is really stored in these other sites rather than in Teams itself:
- SharePoint team site: Documents and folders exchanged in a channel or kept in the team document library; external emails forwarded to the team; the team wiki page; and OneNote assets specific to each channel.
- Exchange team mailbox: contacts, team mail, and conversation history from group and channel chats. Individual user exchange
- Mailboxes: voicemails, scheduled meetings, and the history of private 1:1 chat conversations.
- Individual users’ OneDrive for Business accounts: Files exchanged during private chat sessions, meetings, or phone calls are uploaded and saved in the OneDrive account of the sharing user.
- Organisational document library on OneDrive: Individual OneNote of users.
- Azure (using Blob storage): Media and images shared in conversations, excluding GIFs.
- Stream: Recordings from meetings.
- Third-party storage provider: Data that users are able to store on a third-party storage provider through tabs or other partner apps is stored directly in the partner’s system if your business permits users to do so.
Because Microsoft does not provide publicly accessible APIs, it is not viable to automatically transfer Teams using Microsoft’s out-of-the-box solutions.
How to Manually Migrate?
Users must perform numerous procedures and a great deal of difficult work in order to migrate Microsoft Teams data to a different tenant manually.
Technically, moving Microsoft Teams between Microsoft 365 tenants is not possible with a simple, built-in solution. However, some of the fundamental elements are transferable, like the files on the corresponding team SharePoint site and the group chat and channel conversation history kept in the team Exchange mailbox.
There are several approaches you may take to accomplish this, but we’ll take you through one of the easiest ones that doesn’t require any outside software.
In order to migrate your Microsoft Teams from one tenant to another manually, you need to do the following:
- Re-create the Teams that you want at the destination.
- Ensure that all the permissions and users are configured to your requirements.
- The contents of the related SharePoint team sites should be downloaded and uploaded to the desired location.
- Conversations can be exported from the group’s Exchange mailbox and then imported as a document at the destination.
Re-create the Teams that you want at the destination –
In order for your files to have a destination, you must first create your new Teams environment before copying any Teams content.
This means that you have to re-create the structure of your source Teams including all the channels and tabs within each Teams.
Add all the correct users and permissions to all the Teams.
Once you have set up the Teams Environment, you are required to populate it with all your files and data from your source Teams. This means adding all the users and permissions to each Team.
Now, you should have already added all the users at the destination Azure Active Directory which means that you are inviting users to join the same Teams that they were a member of in the old environment.
In order to invite bulk users to Microsoft Teams, you need to do the following:
- Insert all the permissions and users in a CSV file.
- Modify all the domains that are in association with each other.
- Now, you can add all the users from the CSV file to the destination team.
- Modify the permissions as per your requirements.
How to Extract Permissions and Users to a CSV File?
You need to first generate a list of details about your existing teams. To export all the details about your teams, you will need to run this script:
function Export- INSERT YOUR TEAM LIST HERE
{
param (
$ExportPath
)
process{
Connect-PnPOnline -Scopes “Group.Read.All”,”User.ReadBasic.All”
$accesstoken =Get-PnPAccessToken
$MTeams = Invoke-RestMethod -Headers @{Authorization = “Bearer $accesstoken”} -Uri “https://graph.microsoft.com/beta/groups?`$filter=resourceProvisioningOptions/any(c:c+eq+`’Team`’)” -Method Get
$TeamsList = @()
$i=1
do
{
foreach($value in $MTeams.value)
{
$id= $value.id
Try
{
$team = Invoke-RestMethod -Headers @{Authorization = “Bearer $accesstoken”} -Uri https://graph.microsoft.com/beta/teams/$id/channels -Method Get
}
Catch
{
}
$Owner = Invoke-RestMethod -Headers @{Authorization = “Bearer $accesstoken”} -Uri https://graph.microsoft.com/v1.0/Groups/$id/owners -Method Get
$Members = Invoke-RestMethod -Headers @{Authorization = “Bearer $accesstoken”} -Uri https://graph.microsoft.com/v1.0/Groups/$id/Members -Method Get
$Teams = “” | Select “TeamsName”,”TeamType”,”Channelcount”,”ChannelName”,”Owners”,”MembersCount”,”Members”
$Teams.TeamsName = $value.displayname
$Teams.TeamType = $value.visibility
$Teams.ChannelCount = $team.value.id.count
$Teams.ChannelName = $team.value.displayName -join “;”
$Teams.Owners = $Owner.value.userPrincipalName -join “;”
$Teams.MembersCount = $Members.value.userPrincipalName.count
$Teams.Members = $Members.value.userPrincipalName -join “;”
$TeamsList+= $Teams
$teamaccesstype=$null
$errorMessage =$null
$Teams=$null
$team =$null
$i++
}
if ($MTeams.’@odata.nextLink’ -eq $null )
{
break
}
else
{
$MTeams = Invoke-RestMethod -Headers @{Authorization = “INSERT Bearer $accesstoken”} -Uri $MTeams.’@odata.nextLink’ -Method Get
}
}while($true);
$TeamsList.count
$TeamsList
$TeamsList | Export-csv $ExportPath -NoTypeInformation
}
}
Export-TeamsList -ExportPath “C:\temp\teamswithmembers.csv”
The CSV file that is the output of this script will give you the following information:
- Your Team name.
- The type of Team you have.
- Number of channels in your Team.
- The name and owner of the Team.
- Number of members in a Team.
Modify the Domains Connected with all the Users.
To map the existing Team membership at the destination, you would have to change the old name of the domain to the new domain name in the CSV file. Change the older domain name to the destination domain name.
After modifying the CSV file, you will need to upload the users to the destination Team.
You can connect your Microsoft Teams by running this command:
Sign in with your account details and once you are connected, you can run the following command to get a list of your teams.
This method will allow you to add users in bulk to the CSV file. Now, go to your CVS file and do the following:
- Copy the emails of the user for a Team.
- Create a CSV file and put all the emails of the users in a column. Save it as a CSV file.
- Repeat this process for all the Teams.
Now you can run the following command to get all of the users to join the new Team:
When this script has run correctly, you will be able to see all the users added to their corresponding teams. You can now promote the appropriate members of the Team as the owner.
How to Download and Upload SharePoint Team Sites to the Desired Location?
The next step is to copy the contents of the teams to your destination. All of the content stored is in the SharePoint of the team.
Since we are performing a migration between tenants, the built-in feature of Copying and Moving in SharePoint would not work as it only works with files that need to be moved between teams in the same tenant.
In order to shift your data from one tenant to the other, you would have to download them from the source and then upload them to the destination.
Since the general folder stores all the contents of the files tab, at the very least you can download and upload it to get the users started in the new tenant.
To do this simply select the contents of the general folder and click on the download option.
Once the files are downloaded, you can go to the general folder in the new Teams and upload the files there.
Conclusion
Migrating Microsoft Teams from one tenant to another is a complex process. While Microsoft does not offer an out-of-the-box solution for this migration, understanding the complexities involved and following a detailed manual can help ensure a smooth transition. In this article, we have discussed the manual method you need to follow to easily carry out the migration process.