• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to secondary sidebar
OpenTechTips

OpenTechTips

Comprehensive IT Guides for Pros and Enthusiasts

MENUMENU
  • HOME
  • ALL TOPICS
    • Exchange
    • InfoSec
    • Linux
    • Networking
    • Scripting
      • PowerShell
    • SSL
    • Tools
    • Virtualization
    • Web
    • Windows
  • ABOUT
  • SUBSCRIBE
Home » Office365 to Office365 Migration for FREE – Step by Step » Page 3

Office365 to Office365 Migration for FREE – Step by Step

March 21, 2020 - by Zsolt Agoston - last edited on January 17, 2021

Cut opentechtips.com dirsync (can take up to 72 hours to complete), or…

In this step we convert accounts to purely cloud account while keeping their original password

Before:

Office365 to Office365 Migration for FREE – Step by Step
Set-MsolDirSyncEnabled -EnableDirSync:$false 

Check if the process has run:

(Get-MSOLCompanyInformation).DirectorySynchronizationEnabled 

Note, if the process takes very long there’s another way: simply move the user accounts to an OU that is not synced to the cloud, and wait for or force a sync cycle. That will soft delete the cloud accounts, after which they can be restored using the following command (the cloud system will restore them as cloud accounts, preserving the original passwords, permission settings as well):

Get-MsolUser -ReturnDeletedUsers | Restore-MsolUser 
Office365 to Office365 Migration for FREE – Step by Step

After which:

Office365 to Office365 Migration for FREE – Step by Step

Now we check the permissions on the shared mailboxes to make sure they are not lost just like after a license unassign-reassign scenario. As seen below the permission structure is preserved post-cloudization 🙂

Office365 to Office365 Migration for FREE – Step by Step

Create jd0e.com users in the agzsolt.com local AD in a non-synced OU

First, we add the opentechtips.com domain using the Active Directory Domains and Trusts applet temporarily to make the transition simpler for the users. This way they will be able to log in with the help of the underlying kerberos ticketing system – meaning no password prompts (at least while the mailboxes are sitting on the on-prem server) 🙂

Office365 to Office365 Migration for FREE – Step by Step

We run the following script to create the users, which will be created from users.csv

users.csv
FirstNameLastName
RossGeller
JoeyTribbiani
MonicaGeller
RachelGreen
ChandlerBing
PhoebeBuffay
JaniceHosenstein
CentralPerk

Script:

New-ADOrganizationalUnit -Name "jd0e.com" -Path "OU=My Business,DC=agzsolt,DC=com" -Verbose 
import-csv users.csv | foreach {
 $fn=$_.FirstName
 $ln=$_.LastName
 New-ADUser -Name "$fn $ln" -DisplayName "$fn $ln" -GivenName "$fn" -Surname "$ln" -UserPrincipalName $fn@jd0e.com -Path "OU=jd0e,OU=My Business,DC=agzsolt,DC=com" -Enabled:$true -EmailAddress "$fn@opentechtips.com" -AccountPassword(ConvertTo-SecureString "Password12345!" -AsPlainText -Force)
 Enable-RemoteMailbox -Identity $fn@opentechtips.com -RemoteRoutingAddress $fn@jd0e.onmicrosoft.com
 Set-RemoteMailbox -Identity $fn@jd0e.com -EmailAddressPolicyEnabled:$false
 } 

After the commands being run we check the results on the agzsolt.com server:

Office365 to Office365 Migration for FREE – Step by Step

Configure the cross-forest hybrid environment

To make the servers able to move jd0e.com mailboxes to the agzsolt.com server we need to create a migration endpoint in the jd0e.com cloud server. It is done in recipients/migration/migration endpoints, as the new endpoint’s type we use is “exchange remote"

Office365 to Office365 Migration for FREE – Step by Step

It will fail because the server tries to determine the destination FQDN using autodiscover which points to the wrong location of course. We put the right server manually:

Office365 to Office365 Migration for FREE – Step by Step
Office365 to Office365 Migration for FREE – Step by Step

In our example we will call the connector “agzsolt”

Pages: Page 1 Page 2 Page 3 Page 4 Page 5

Primary Sidebar

Tools

Secondary Sidebar

CONTENTS

  • The starting scenario
  • Mailbox situation:
  • Prepare the destination on-prem server
  • Change the jd0e.com MX record to point to the agzsolt.com on-prem server
  • Disable Federation
  • Cut opentechtips.com dirsync (can take up to 72 hours to complete), or…
  • Create jd0e.com users in the agzsolt.com local AD in a non-synced OU
  • users.csv
  • Configure the cross-forest hybrid environment
  • Sync the MSOL attributes into the agzsolt.com local AD accounts
  • Migrate users to agzsolt.com on-prem
  • Strip down the old tenant
  • Sorting the post-migration tasks: permissions check, distribution lists and contacts creation
  • MIGRATE BACK TO THE CLOUD
  • UpToTheCloud.csv
  • Script:
  • Start the migration
  • Now it’s time to complete the migration batch
  • Tidying up

  • Terms of Use
  • Disclaimer
  • Privacy Policy
Manage your privacy

To provide the best experiences, we and our partners use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us and our partners to process personal data such as browsing behavior or unique IDs on this site and show (non-) personalized ads. Not consenting or withdrawing consent, may adversely affect certain features and functions.

Click below to consent to the above or make granular choices. Your choices will be applied to this site only. You can change your settings at any time, including withdrawing your consent, by using the toggles on the Cookie Policy, or by clicking on the manage consent button at the bottom of the screen.

Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Statistics

Marketing

Features
Always active

Always active
Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
Manage options
{title} {title} {title}
Manage your privacy
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Statistics

Marketing

Features
Always active

Always active
Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
Manage options
{title} {title} {title}