The script we finally used to do the actual migration