使用备份恢复时失败

为了避免数据丢失,在通过脚本完全导入数据之前,我会先备份生产实例,将其下载到本地,然后在本地临时实例中尝试恢复,但失败了。

日志如下:

[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!

您需要在恢复备份之前,将您正在恢复备份的实例更新到最新版本。 :+1:

6 个赞

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