General purpose migration (upgrades, downgrades) framework