Rewrote port opening and migration to work around mongo txn not being able to create and alter a document in the same transaction.