Failed when using backups to restore

To avoid loss of data, before importing data completely by script, I make production instance backup, download it to local, and try to restore it in local temporary instance, however failed.

And logs as below

[2022-12-14 21:58:40] 'm11' has started the restore!
[2022-12-14 21:58:40] Marking restore as running...
[2022-12-14 21:58:40] Making sure /Users/mike/otherprojects/discourse/tmp/restores/default/2022-12-14-135840 exists...
[2022-12-14 21:58:40] Copying archive to tmp directory...
[2022-12-14 21:58:40] Unzipping archive, this may take a while...
[2022-12-14 21:58:40] Extracting dump file...
[2022-12-14 21:58:40] Validating metadata...
[2022-12-14 21:58:40]   Current version: 20221205225450
[2022-12-14 21:58:40]   Restored version: 20221212234948
[2022-12-14 21:58:40] EXCEPTION: You're trying to restore a more recent version of the schema. You should migrate first!
[2022-12-14 21:58:40] /Users/mike/otherprojects/discourse/lib/backup_restore/meta_data_handler.rb:31:in `validate'
/Users/mike/otherprojects/discourse/lib/backup_restore/restorer.rb:112:in `validate_backup_metadata'
/Users/mike/otherprojects/discourse/lib/backup_restore/restorer.rb:43:in `run'
/Users/mike/otherprojects/discourse/script/spawn_backup_restore.rb:23:in `restore'
/Users/mike/otherprojects/discourse/script/spawn_backup_restore.rb:36:in `block in <main>'
/Users/mike/otherprojects/discourse/script/spawn_backup_restore.rb:4:in `fork'
/Users/mike/otherprojects/discourse/script/spawn_backup_restore.rb:4:in `<main>'
[2022-12-14 21:58:40] Trying to rollback...
[2022-12-14 21:58:40] There was no need to rollback
[2022-12-14 21:58:40] Cleaning stuff up...
[2022-12-14 21:58:40] Removing tmp '/Users/mike/otherprojects/discourse/tmp/restores/default/2022-12-14-135840' directory...
[2022-12-14 21:58:40] Marking restore as finished...
[2022-12-14 21:58:40] Notifying 'm11' of the end of the restore...
[2022-12-14 21:58:42] Finished!

You need to update the instance you’re restoring the back-up to to the latest version before doing the restore. :+1:

6 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.