Migrates databases with version 1 to version 2