saving database and migration