migrate the database if possible