Unable to restore backup - No migration with version number

Ok, I figured out what the problem was and got it sorted.

Here’s the post mortem for anyone else who stumbles on the same issue. When I bootstrapped the fresh install the app.yml that gets created by default sets the version at “tests-passed”. So then it built like that. But I wanted to re-create my version of “stable” on the new host, and wanted all the other things the same as my existing forum so I replaced the fresh app.yml with the one on my existing site and then ./launcher rebuild app and it downgraded me to 1.5.1.

BUT… it left all the schema migrations in the database for the tests-passed version. And so when I tried to restore the backup from my current 1.5.1 it was looking for migrations that no longer existed.

The solution for me was to delete the fresh DB, rebuild again with my current app.yml, and then I was able to successfully restore the backup.

Here is what I did on the target host in command-line-ese:

cd /var/discourse/shared/standalone
rm -rf postgres_* state/
./launcher rebuild app
mv /path/backup_name.tar.gz /var/discourse/shared/standalone/backups/default
./launcher restart app

Then I re-signed-up my admin account through the web, turned on the allow restore setting, and successfully restored the backup from my current forum through the web interface.

Mods may want to close this topic.

5 Likes