Migration from Connect Sync
This quickstart covers migrating from Connect Sync to Cloud Sync. It includes the recommended OU-based pilot approach (manual), the programmatic approach via MS Graph API, and post-migration validation.
Pre-Migration Assessment
Before starting migration, confirm that Cloud Sync covers your scenario:
- Review parity gaps. Check the Connect Sync vs Cloud Sync comparison. If you depend on device writeback, advanced sync rules, cross-forest references, or other Connect Sync-only features, you cannot fully migrate yet.
- Check object counts. Cloud Sync supports up to 150,000 objects per domain and groups up to 50,000 members. Run
Get-ADUser -Filter * | Measure-ObjectandGet-ADGroup -Filter * | Measure-Objectto check. - Verify prerequisites. Ensure your environment meets the Cloud Sync prerequisites.
- Back up Connect Sync configuration. Export your Connect Sync configuration before making any changes. Use the import/export feature in the Connect Sync wizard.
If parity gaps affect your environment, you can still do a partial migration using coexistence (see below). Migrate the OUs that only need basic sync, and leave the rest on Connect Sync until Cloud Sync closes the gaps.
OU-Based Pilot Migration
This is the recommended Microsoft approach. You migrate users OU by OU, so both engines coexist safely during the transition.
flowchart TD
A[Back up Connect Sync config] --> B[Create or identify pilot OU]
B --> C[Create Connect Sync exclusion rules]
C --> D[Install Cloud Sync provisioning agent]
D --> E[Configure Cloud Sync scoped to pilot OU]
E --> F[Verify pilot users sync correctly]
F --> G{All users migrated?}
G -->|No| H[Move next OU batch to Cloud Sync]
H --> C
G -->|Yes| I[Disable Connect Sync scheduler]
I --> J[Decommission Connect Sync server]
Step 1: Create or Identify a Pilot OU
Choose an OU with test users, or create a new one and move a handful of users into it.
# Count users in the pilot OU
Get-ADUser -Filter * -SearchBase "OU=CloudSyncPilot,DC=contoso,DC=com" | Measure-Object
Step 2: Exclude the Pilot OU from Connect Sync
You need two custom sync rules in Connect Sync to prevent it from syncing the pilot OU objects.
Stop the scheduler first:
Set-ADSyncScheduler -SyncCycleEnabled $false
Create the inbound exclusion rule:
- Open the Synchronization Rules Editor.
- Create a new Inbound rule with a precedence below 100 (e.g., 50).
- Set the connector to your AD connector.
- Scoping filter:
dn CONTAINS OU=CloudSyncPilot(adjust to match your OU). - Link type: Join.
- Add a transformation: Constant, target attribute =
cloudNoFlow, value =True.
Create the outbound exclusion rule:
- Create a new Outbound rule.
- Scoping filter:
cloudNoFlow EQUAL True. - Link type: JoinNoFlow (this prevents provisioning to Entra ID).
Re-enable the scheduler:
Set-ADSyncScheduler -SyncCycleEnabled $true
Wait for a sync cycle to complete. The pilot OU users should no longer be exported by Connect Sync.
Step 3: Install the Provisioning Agent
If you have not already installed the Cloud Sync agent, follow the configuration quickstart steps 1-2. If you already have an agent installed, skip to step 4.
Step 4: Configure Cloud Sync for the Pilot OU
- In the Entra admin center, go to Cloud sync > New configuration.
- Select AD to Microsoft Entra ID sync.
- Under scoping filters, select Selected organizational units.
- Enter the DN of your pilot OU:
OU=CloudSyncPilot,DC=contoso,DC=com. - Configure attribute mappings (the defaults are usually fine for a pilot).
- Test with on-demand provisioning on a specific user.
- Enable the configuration.
Step 5: Verify Pilot Users
After enabling, check that pilot users sync correctly:
- Provisioning logs. Verify successful sync events for pilot users.
- Entra ID user properties. Confirm attributes match on-premises values.
- Password hash sync. If enabled, verify users can sign in with cloud authentication.
You can use this PowerShell script to count users synced from the pilot OU:
Connect-MgGraph -Scopes "User.Read.All"
$users = Get-MgUser -All -Filter "onPremisesSyncEnabled eq true"
$pilotOU = "OU=CloudSyncPilot"
$count = ($users | Where-Object {
$_.OnPremisesDistinguishedName -match $pilotOU
}).Count
Write-Host "Pilot users synced: $count"
Step 6: Expand and Decommission
Once the pilot succeeds:
- Gradually expand. Move more OUs from Connect Sync to Cloud Sync by repeating steps 2-5 for each OU.
- Disable Connect Sync. When all users are managed by Cloud Sync, stop the Connect Sync scheduler and leave the server in a disabled state for a verification period.
- Decommission. After verifying everything works, uninstall Connect Sync.
Rollback
The OU-based approach is inherently safe for rollback:
- Disable the Cloud Sync configuration.
- Remove the exclusion sync rules from Connect Sync.
- Run a full sync cycle on Connect Sync.
Users will be picked back up by Connect Sync on the next cycle.
Programmatic Migration via MS Graph API
For automated or large-scale migrations, you can configure Cloud Sync entirely through the MS Graph Synchronization API.
Create the Service Principal
The AD2AAD application template ID is 1a4721b3-e57f-4451-ae87-ef078703ec94. Instantiate it to create the service principal:
POST https://graph.microsoft.com/beta/applicationTemplates/1a4721b3-e57f-4451-ae87-ef078703ec94/instantiate
Content-Type: application/json
{
"displayName": "contoso.com - Cloud Sync"
}
Note the objectId of the service principal in the response.
Create Sync Jobs
Create two jobs: one for user/group provisioning and one for password hash sync.
POST https://graph.microsoft.com/beta/servicePrincipals/{servicePrincipalId}/synchronization/jobs
Content-Type: application/json
{
"templateId": "AD2AADProvisioning"
}
POST https://graph.microsoft.com/beta/servicePrincipals/{servicePrincipalId}/synchronization/jobs
Content-Type: application/json
{
"templateId": "AD2AADPasswordHash"
}
Configure Domain Targeting
Set the target domain for the service principal:
PUT https://graph.microsoft.com/beta/servicePrincipals/{servicePrincipalId}/synchronization/secrets
{
"value": [
{
"key": "Domain",
"value": "{\"domain\":\"contoso.com\"}"
}
]
}
Configure Attribute Mappings (Optional)
To customize attribute mappings, retrieve the current schema, modify it, and push it back:
GET https://graph.microsoft.com/beta/servicePrincipals/{servicePrincipalId}/synchronization/jobs/{jobId}/schema
Modify the attributeMappings array in the response, then:
PUT https://graph.microsoft.com/beta/servicePrincipals/{servicePrincipalId}/synchronization/jobs/{jobId}/schema
Start the Sync Job
POST https://graph.microsoft.com/beta/servicePrincipals/{servicePrincipalId}/synchronization/jobs/{jobId}/start
Monitor Status
GET https://graph.microsoft.com/beta/servicePrincipals/{servicePrincipalId}/synchronization/jobs/
Check the status section in the response for sync progress, errors, and quarantine state.
Exchange Hybrid Writeback
If your environment uses Exchange hybrid, you can enable Exchange hybrid writeback as an additional sync job:
POST https://graph.microsoft.com/beta/servicePrincipals/{servicePrincipalId}/synchronization/jobs
Content-Type: application/json
{
"templateId": "AAD2ADExchangeHybridWriteback"
}
Before creating this job, verify the Exchange schema is present in your AD by using schema discovery:
POST https://graph.microsoft.com/beta/servicePrincipals/{servicePrincipalId}/synchronization/jobs/{jobId}/schema/directories/{directoryId}/discover
Check that the mailNickName attribute is present in the response.
Post-Migration Validation
After migration, verify these areas:
| Area | What to Check |
|---|---|
| User attributes | displayName, mail, UPN, proxyAddresses match on-premises values |
| Group memberships | Groups synced correctly with expected members |
| Password hash sync | Users can authenticate via cloud if PHS is enabled |
| Writeback scenarios | Password writeback and group writeback (if configured) function correctly |
| Provisioning logs | No persistent errors or quarantine states |
| Agent health | All agents show Active status |
Important: Keep the Connect Sync server in a disabled (not decommissioned) state for at least a week after full migration. This gives you a quick rollback path if issues surface.
Further Reading
For a higher-level overview of migration planning, pre-migration checklists, and rollback considerations, see the migration notes.