Posted in Migration, O365

TEAMS MIGRATION FROM ONE TENANT TO ANOTHER TENANT MANUALLY

SOURCE ENVIRONMENTTARGET ENVIRONMENT
Domainesupportcorp.comcloudsharp.co
Teamtestdeployingsitetestdeployingsite

Introduction :

Migrating Microsoft teams data to another tenant manually involves multiple steps, technically there is no-way. But we can move few underlying components like;

  • Files / Folders stored on corresponding SharePoint site
  • Group chats
  • Channel conversation history stored in exchange mailbox

Procedure :

To migrate teams from one tenant to another tenant manually (This method does not involve any third party tool)

Step 1 : Re-create the teams that wanted to migrate at the destination

Step 2 : Add all the users and permissions to each team

Step 3 : Download the contents of the associated SharePoint team sites and upload at the destination

Step 4 : Export conversations from the team’s Exchange mailbox, then import them at the destination as a document.

Step 1 :

  • Login to the source tenant teams using owner credentials.
  • Identify the teams that needed to be migrated in the source tenant.
  • Login to the target tenant teams and create same team manually.
  • Join or Create a team > Create Team > From Scratch > Private/ Public/ Org - wide (Depending on source team). Dive to teams admin portal of source tenant and check the privacy state of the migration team.
  • Skip adding members temporarily.
  • Also create same channels in the target tenant teams.

Step 2 :

  • Add all the users accordingly to the target O365 tenant.
  • The usernames should match that of source tenant.
  • To install Microsoft Teams module in the powershell session, run the following powershell script.
Install-Module -Name MicrosoftTeams
  • Run the following powershell command to extract the users from the source tenant to a CSV file.
$exportLocation = "C:\users\Shaun.Wilkinson\Desktop\export.csv"




Connect-MicrosoftTeams


# Get all of the team Groups IDs
$AllTeamsInOrg = (Get-Team).GroupID
$TeamReport = @()


# Will hold a basic count of user types and teams
$unavailableTeamCount = 0
$knownOwnersCount = 0
$knownMemberCount = 0
$knownGuestCount = 0


# Loop through all Group IDs
$currentIndex = 1
ForEach($Team in $AllTeamsInOrg) {
    # Show a nice progress bar as this can take a while
    Write-Progress -Id 0 -Activity "Building report from Microsoft Teams" -Status "$currentIndex of $($allTeamsInOrg.Count)" -PercentComplete (($currentIndex / $allTeamsInOrg.Count) * 100)


    # Get properties of the team
    $team = Get-Team -GroupId $Team


    # Attempt to get team users, throw error message if no access
    try {
        # Get team members
        $users = Get-TeamUser -GroupId $team.groupID


        # foreach user create a line in the report
        ForEach($user in $users) {
            # Maintain a count of user types
            switch($user.Role) {
                "owner" { $knownOwnersCount++ }
                "member" { $knownMemberCount++ }
                "guest" { $knownGuestCount++ }
            }


            # Create an object to hold all values
            $teamReportObject = New-Object PSObject -Property @{
                TeamName = $team.DisplayName
                Description = $team.Description
                Archived = $team.Archived
                Visibility = $team.Visibility
                User = $user.Name
                Email = $user.User
                Role = $user.Role
            }


            # Add to the report
            $TeamReport += $teamReportObject
        }
    } catch [Microsoft.TeamsCmdlets.PowerShell.Custom.ErrorHandling.ApiException] {
        Write-Host -ForegroundColor Yellow "No access to $($team.DisplayName) team, cannot generate report"
        $unavailableTeamCount++
    }


   
    $currentIndex++
}
Write-Progress -Id 0 -Activity " " -Status " " -Completed


# Disconnect from the teams service
Disconnect-MicrosoftTeams


# Provide some nice output
Write-Host -ForegroundColor Green "============================================================"
Write-Host -ForegroundColor Green "                Microsoft Teams User Report                 "
Write-Host -ForegroundColor Green ""
Write-Host -ForegroundColor Green "  Count of All Teams - $($AllTeamsInOrg.Count)                "
Write-Host -ForegroundColor Green "  Count of Inaccesible Teams - $($unavailableTeamCount)         "
Write-Host -ForegroundColor Green ""
Write-Host -ForegroundColor Green "  Count of Known Users - $($AllTeamsInOrg.Count)                "
Write-Host -ForegroundColor Green "  Count of Known Owners - $($knownOwnersCount)                "
Write-Host -ForegroundColor Green "  Count of Known Members - $($knownMemberCount)                "
Write-Host -ForegroundColor Green "  Count of Known Guests - $($knownGuestCount)                "




$TeamReport | Export-CSV $exportLocation -NoTypeInformation
Write-Host -ForegroundColor Green "Exported report to $($exportLocation)"
  • Change the export location accordingly in the above powershell script.
  • Log in to the source tenant with administrator credentials to export the users list along side with the teams properties to a csv file.
  • A csv file is created as following, Add a filter to TeamName column to shortlist desired team accordingly.
  • Sort out Desired Email values accordingly to a new sheet and change the domain values to the new tenant accordingly (esupportcorp.com—————-cloudsharp.co)
  • Revert back to the destination tenant to add users that are generated from the previous step using following powershell script by changing the path of csv file accordingly.
  • Connect to the target tenant using administrator credentials.
Connect-MicrosoftTeams
  • Get the team details using following command and note the group id accordingly.
Get-Team
  • Import the csv file to add new users accordingly by changing the desired values
Import-Csv -Path "C:\Users\rakhi\OneDrive\Desktop" | foreach{Add-TeamUser -GroupId 1dc5ff0c-0e7e-46c5-afd4-a1d17c3bf7b6 -user $_.email}
  • Go to Teams admin portal to check the status of the migrated team.
  • Manually compare the roles of each team member with the source team and change accordingly.

Step 3 :

  • Every team in a Microsoft teams will be associated with a SharePoint site in background automatically.
  • Open the source team > Click on ellipse > Open in SharePoint > Sign-in with valid credentials (Owner is recommended) > Download all the files and folders.
  • Open the target team > Click on ellipse > Open in SharePoint > Sign-in with valid credentials (Owner is recommended) > upload all the files and folders that has been downloaded earlier.

Step 4 :

  • Dive back to the O365 Admin center > Security Admin center > Search > Content search > Guided search.
  • Populate the fields as followed, Follow onscreen commands accordingly and select specific location > Choose users, groups or teams > search for the migration team > Choose > Done > Next > Add Condition > Type (Equals any of) > Check E-mail messages, Instant messages > Save and run
  • Click on more > Export report > select the desired output options > Generate report
  • Open Exports tab as shown below and select the report to download.
  • Upload the downloaded report as a document in the target SharePoint general documents.