Refactor migratePass1.php to be a maintenance script.

Change-Id: I3b8f39022d1abc481685b72d609a866e114026e7
Merge "Refactor migratePass1.php to be a maintenance script."