# mezbauddin/m365_tenant_to_tenant_migration_toolkit architecture

> Architecture diagram of the GitHub repository mezbauddin/m365_tenant_to_tenant_migration_toolkit, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit
- Repository: https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit

## Overview

This is a PowerShell toolkit for migrating a business between Microsoft 365 tenants. Its principal workflow runs from source inventory through destination preparation and a chosen data-copy option, then configuration rebuild, domain cutover, validation, and source decommissioning. The README also documents optional EWS archive readiness, OneDrive copy-list preparation, and device migration. Relationships below are based on the README’s workflow; source excerpts were not available, so script-level calls are not inferred.

Main entry points: [`01-SourceInventory/Invoke-SourceTenantInventory.ps1`](https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/01-SourceInventory/Invoke-SourceTenantInventory.ps1) (Source inventory), [`05-MailConfig/Copy-MailConfig.ps1`](https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/05-MailConfig/Copy-MailConfig.ps1) (Mail configuration), [`copy-options/A-Microsoft-native/New-TargetMailUsers.ps1`](https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/copy-options/A-Microsoft-native/New-TargetMailUsers.ps1) (Microsoft native copy), [`copy-options/B-ShareGate`](https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/tree/main/copy-options/B-ShareGate) (ShareGate copy)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Discover and build"]
  node_inventory["Source inventory"]
  node_mailboxes["Target mailboxes"]
  node_mapping["User mapping"]
  node_onedrives["Target OneDrives"]
end

subgraph group_copy["Data movement"]
  node_ews["EWS archive readiness"]
  node_drive_list["OneDrive copy list"]
  node_native["Microsoft native copy"]
  node_sharegate["ShareGate copy"]
  node_graphcopy["Graph copy option"]
end

subgraph group_rebuild["Rebuild configuration"]
  node_mail_config["Mail configuration"]
  node_collaboration["Groups, Teams, sites"]
end

subgraph group_cutover["Cutover and devices"]
  node_domain["Domain cutover"]
  node_dns_export["Export DNS"]
  node_dns_set["Set DNS records"]
  node_cutover_ready["Cutover readiness"]
  node_devices["Device migration"]
  node_device_inventory["Device inventory"]
  node_bitlocker["BitLocker key export"]
  node_profile["Profile data copy"]
end

subgraph group_assurance["Validate and close"]
  node_validation["Target validation"]
  node_decom_ready["Decommission readiness"]
  node_source_licenses["Remove source licences"]
  node_health["Module health check"]
  node_report["Migration report"]
end

node_operator(("Migration operator"))
node_source_tenant[("Source tenant")]
node_target_tenant[("Target tenant")]

node_operator -->|"runs"| node_inventory
node_inventory -->|"inventories"| node_source_tenant
node_inventory -->|"informs build"| node_mailboxes
node_inventory -->|"supports matching"| node_mapping
node_operator -->|"prepares"| node_onedrives
node_operator -.->|"checks optionally"| node_ews
node_operator -->|"prepares copy list"| node_drive_list
node_operator -->|"chooses copy"| node_native
node_operator -->|"chooses copy"| node_sharegate
node_operator -->|"chooses copy"| node_graphcopy
node_native -->|"then rebuilds"| node_mail_config
node_sharegate -->|"then rebuilds"| node_mail_config
node_graphcopy -->|"then rebuilds"| node_mail_config
node_operator -->|"rebuilds"| node_collaboration
node_operator -->|"cuts over"| node_domain
node_operator -->|"checks go/no-go"| node_cutover_ready
node_operator -->|"exports DNS"| node_dns_export
node_operator -->|"sets DNS"| node_dns_set
node_operator -->|"lists devices"| node_device_inventory
node_operator -->|"exports keys"| node_bitlocker
node_operator -->|"moves devices"| node_devices
node_devices -->|"copies profile"| node_profile
node_operator -->|"validates target"| node_validation
node_operator -->|"checks readiness"| node_decom_ready
node_decom_ready -->|"precedes removal"| node_source_licenses
node_operator -->|"removes licences"| node_source_licenses
node_operator -->|"checks modules"| node_health
node_operator -->|"reviews reports"| node_report

click node_inventory "https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/01-SourceInventory/Invoke-SourceTenantInventory.ps1"
click node_mailboxes "https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/tree/main/02-TargetMailboxes"
click node_mapping "https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/02b-UserMapping/New-UserMapping.ps1"
click node_onedrives "https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/04-TargetOneDrives/Request-TargetOneDrives.ps1"
click node_ews "https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/03-EwsArchiveReadiness/Test-EwsArchiveReadiness.ps1"
click node_drive_list "https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/copy-options/New-DriveCopyList.ps1"
click node_native "https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/copy-options/A-Microsoft-native/New-TargetMailUsers.ps1"
click node_sharegate "https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/tree/main/copy-options/B-ShareGate"
click node_graphcopy "https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/tree/main/copy-options/C-No-budget"
click node_mail_config "https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/05-MailConfig/Copy-MailConfig.ps1"
click node_collaboration "https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/06-GroupsTeamsSites/Copy-CollaborationMap.ps1"
click node_domain "https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/tree/main/07-DomainCutover"
click node_dns_export "https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/07-DomainCutover/Export-DomainDns.ps1"
click node_dns_set "https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/07-DomainCutover/Set-DomainDnsRecords.ps1"
click node_cutover_ready "https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/07-DomainCutover/Test-CutoverReadiness.ps1"
click node_devices "https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/08-Devices/Move-TenantDevices.ps1"
click node_device_inventory "https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/08-Devices/Get-DeviceInventory.ps1"
click node_bitlocker "https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/08-Devices/Export-BitLockerKeys.ps1"
click node_profile "https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/08-Devices/Copy-ProfileData.ps1"
click node_validation "https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/09-Validation/Test-TargetTenant.ps1"
click node_decom_ready "https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/10-Decommission/Get-DecommissionReadiness.ps1"
click node_source_licenses "https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/10-Decommission/Remove-SourceLicences.ps1"
click node_health "https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/tools/Test-ModuleHealth.ps1"
click node_report "https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/tools/Get-MigrationReport.ps1"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_inventory,node_mailboxes,node_mapping,node_onedrives toneBlue
class node_ews,node_drive_list,node_native,node_sharegate,node_graphcopy,node_source_tenant,node_target_tenant toneAmber
class node_mail_config,node_collaboration toneMint
class node_domain,node_dns_export,node_dns_set,node_cutover_ready,node_devices,node_device_inventory,node_bitlocker,node_profile toneRose
class node_validation,node_decom_ready,node_source_licenses,node_health,node_report,node_operator toneIndigo
```

## Components

### Discover and build

- [Source inventory](https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/01-SourceInventory/Invoke-SourceTenantInventory.ps1): `01-SourceInventory/Invoke-SourceTenantInventory.ps1`
- [Target mailboxes](https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/tree/main/02-TargetMailboxes): `02-TargetMailboxes`
- [User mapping](https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/02b-UserMapping/New-UserMapping.ps1): `02b-UserMapping/New-UserMapping.ps1`
- [Target OneDrives](https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/04-TargetOneDrives/Request-TargetOneDrives.ps1): `04-TargetOneDrives/Request-TargetOneDrives.ps1`

### Data movement

- [EWS archive readiness](https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/03-EwsArchiveReadiness/Test-EwsArchiveReadiness.ps1): `03-EwsArchiveReadiness/Test-EwsArchiveReadiness.ps1`
- [OneDrive copy list](https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/copy-options/New-DriveCopyList.ps1): `copy-options/New-DriveCopyList.ps1`
- [Microsoft native copy](https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/copy-options/A-Microsoft-native/New-TargetMailUsers.ps1): `copy-options/A-Microsoft-native/New-TargetMailUsers.ps1`
- [ShareGate copy](https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/tree/main/copy-options/B-ShareGate): `copy-options/B-ShareGate`
- [Graph copy option](https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/tree/main/copy-options/C-No-budget): `copy-options/C-No-budget`

### Rebuild configuration

- [Mail configuration](https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/05-MailConfig/Copy-MailConfig.ps1): `05-MailConfig/Copy-MailConfig.ps1`
- [Groups, Teams, sites](https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/06-GroupsTeamsSites/Copy-CollaborationMap.ps1): `06-GroupsTeamsSites/Copy-CollaborationMap.ps1`

### Cutover and devices

- [Domain cutover](https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/tree/main/07-DomainCutover): `07-DomainCutover`
- [Export DNS](https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/07-DomainCutover/Export-DomainDns.ps1): `07-DomainCutover/Export-DomainDns.ps1`
- [Set DNS records](https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/07-DomainCutover/Set-DomainDnsRecords.ps1): `07-DomainCutover/Set-DomainDnsRecords.ps1`
- [Cutover readiness](https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/07-DomainCutover/Test-CutoverReadiness.ps1): `07-DomainCutover/Test-CutoverReadiness.ps1`
- [Device migration](https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/08-Devices/Move-TenantDevices.ps1): `08-Devices/Move-TenantDevices.ps1`
- [Device inventory](https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/08-Devices/Get-DeviceInventory.ps1): `08-Devices/Get-DeviceInventory.ps1`
- [BitLocker key export](https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/08-Devices/Export-BitLockerKeys.ps1): `08-Devices/Export-BitLockerKeys.ps1`
- [Profile data copy](https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/08-Devices/Copy-ProfileData.ps1): `08-Devices/Copy-ProfileData.ps1`

### Validate and close

- [Target validation](https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/09-Validation/Test-TargetTenant.ps1): `09-Validation/Test-TargetTenant.ps1`
- [Decommission readiness](https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/10-Decommission/Get-DecommissionReadiness.ps1): `10-Decommission/Get-DecommissionReadiness.ps1`
- [Remove source licences](https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/10-Decommission/Remove-SourceLicences.ps1): `10-Decommission/Remove-SourceLicences.ps1`
- [Module health check](https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/tools/Test-ModuleHealth.ps1): `tools/Test-ModuleHealth.ps1`
- [Migration report](https://github.com/mezbauddin/m365_tenant_to_tenant_migration_toolkit/blob/main/tools/Get-MigrationReport.ps1): `tools/Get-MigrationReport.ps1`

### Other components

- **Migration operator**
- **Source tenant**
- **Target tenant**

## Connections

- Migration operator → Source inventory: runs (evidence: `README.md`)
- Source inventory → Source tenant: inventories (evidence: `README.md`)
- Source inventory → Target mailboxes: informs build (evidence: `README.md`)
- Source inventory → User mapping: supports matching (evidence: `README.md`)
- Migration operator → Target OneDrives: prepares (evidence: `README.md`)
- Migration operator → EWS archive readiness: checks optionally (evidence: `README.md`)
- Migration operator → OneDrive copy list: prepares copy list (evidence: `README.md`)
- Migration operator → Microsoft native copy: chooses copy (evidence: `README.md`)
- Migration operator → ShareGate copy: chooses copy (evidence: `README.md`)
- Migration operator → Graph copy option: chooses copy (evidence: `README.md`)
- Microsoft native copy → Mail configuration: then rebuilds (evidence: `README.md`)
- ShareGate copy → Mail configuration: then rebuilds (evidence: `README.md`)
- Graph copy option → Mail configuration: then rebuilds (evidence: `README.md`)
- Migration operator → Groups, Teams, sites: rebuilds (evidence: `README.md`)
- Migration operator → Domain cutover: cuts over (evidence: `README.md`)
- Migration operator → Cutover readiness: checks go/no-go (evidence: `README.md`)
- Migration operator → Export DNS: exports DNS (evidence: `README.md`)
- Migration operator → Set DNS records: sets DNS (evidence: `README.md`)
- Migration operator → Device inventory: lists devices (evidence: `README.md`)
- Migration operator → BitLocker key export: exports keys (evidence: `README.md`)
- Migration operator → Device migration: moves devices (evidence: `README.md`)
- Device migration → Profile data copy: copies profile (evidence: `README.md`)
- Migration operator → Target validation: validates target (evidence: `README.md`)
- Migration operator → Decommission readiness: checks readiness (evidence: `README.md`)
- Decommission readiness → Remove source licences: precedes removal (evidence: `README.md`)
- Migration operator → Remove source licences: removes licences (evidence: `README.md`)
- Migration operator → Module health check: checks modules (evidence: `README.md`)
- Migration operator → Migration report: reviews reports (evidence: `README.md`)
