Exchange: 2007 SP3 to 2013 SP1 migration

This guide is a bit messy, but will prove to be useful as I went through all the fires of Exchange migration:

Install SP3 on the current 2007 Exchange server
Get-ExchangeServer | Format-Table Name, *Version*
Very important to double check that SP3 is in place
if the version does not equal it is not SP3
Perform Health Check of AD and Exchange by running BPA for SBS 2008
Run a full backup overnight on the Exchange server
To be honest with SP1 there was no updates to Exchange at the time I was doing the migration

Upgrade the schema on SBS Server 2008 to support Windows 2012.
Join the new SERVER to domain
Install Exchange 2013 SP1

1.1 create a request with e.g. GoDaddy where new domain is added
(Lesson: Re-key the certificate, created a request on source Exchange server)
1.2 change DZC with a new e.g GoDaddy code to prove the ownership of the domain
1.3 rerun verification process
1.4 install new certificate MMC Certificates (Personal -> Local Computer)
1.5 apply new certificate
1.6 change virtual directories using the script (Jablonski)
disable indexing and enable circualar loggins on the Exchange database, dismount is necessary
Set-MailboxDatabase DB1 -CircularLoggingEnabled $True
Set-MailboxDatabase “Mailbox Database 1382310118″ -IndexEnabled:$True
this helps better performance during the migration, less issues and circular logging will prevent buildup of transaction logs otherwise if you want to do a mailbox migration without single transaction logs cleanup YOU NEED TWICE AS MUCH DISK SPACE ON THE EXCHANGE PARTITION (in my case it was 200GB of migrated database + 230GB of transaction logs – totally unacceptable) circular logging keeps transaction logs = 1MB

1.7 migrate one mailbox
1.14 users should not be affected during the process
1.15 high tolerance of corrupt messages should set prior the migration of large mailboxes (otherwise it will fail at the end and it has to be restarted from scratch which can take even 18h for mailboxes ~20GB)
1.16 if you cancel and delete some mailbox migration batches, you have to restart the source Exchange 2007 server, otherwise people from these batches will not be able to send emails as source Exchange still thinks that there is ongoing migration and the destination server is taking care of the email delivery (you will see lots of authentication errors in the logs on the source server)
1.17 command to migrate large mailboxes with corrupt items:
New-MoveRequest –Identity username –TargetDatabse –BadItemLimit 1000 –AcceptLargeDataLoss –Debug -Verbose
DO NOT USE MIGRATION IN ECP, New-MoveRequest is much faster and less of a headache
monitor the migration by this shell command:
get-moverequeststatistics -identiry “domain\user” | format-list
get-moverequeststatistics -moverequestqueue “db”
during the migration the transaction logs will increase taking up more space than the Exchange database itself
the only way to flush logs is to finish the migration asap, unmount the database and enable circular logging on the destination Exchange database then mount the database
when you mount the database Exchange services will start clearing up space immediately
other solution is to create separate partition for the logs and change its location on the Exchange, then once the migration has completed to move log path to old location, make sure it is migrated than safely delete the partition to reclaim space on the VMware datastore
if you run out of disk space, because you forgot to move the database to a bigger partition use VMware to increase the hard disk then in Windows expand the partition then move the database and logs

Move-DatabasePath “Mailbox Database 1” -EdbFilePath “E:\Mailbox Database 1\Mailbox Database 1.edb” -LogFolderPath “F:\Mailbox Database 1”
It is recommended by Microsoft not to run DC on Exchange for performance reasons
Confirm smart phones working after migration.
Test Outlook from outside the office.
once some mailboxes are migrated test mail flow on them
Have noticed that just after the mailbox is migrated Outlook will ask the user to restart it because of the change, but it will still not sync
Solution: login to OWA, Exchange does the initial configuration of OWA then miraculously Outlook starts updating and emails are coming up on the mobile device

once all the mailboxes are migrated to SERVER.
Migrate DHCP to SERVER and change to point to new DNS server Article:

Activate Exchange 2013
Double check user’s Outlook is pointing to new SERVER.
Migrate Public Folders Article:
Check smart phones connection to new Exchange.

once confirmed that all the mailboxes are migrated disable circular logging and enable indexing on the Exchange database (you do not want to leave circular logging on as this is not safe in production environment, circular logging is a legacy feature and decreases self-healing capabilities in case of a mailbox or database corruption, should be used only temporarily)
Set-MailboxDatabase “DB1” -CircularLoggingEnabled $False
Set-MailboxDatabase “Mailbox Database 1382310118″ -IndexEnabled:$True

Credits to Rudi, Navdeep and Ryan