Migrations to migrate from 1.2 to latest dev

These are the migrations I have been using to migrate our instance from 1.2 to latest dev.
As far as I can see they are working well, though they would need some more tests.