Add migration script

First pass at a migration script. this is intended to be run by the packaging in a tmpdir, and resulting files copied back to correct locations. Comments @witlessbird @domcleal?