migration: move some declarations to migration.h