还原失败 - 您应该先迁移吗?

我正尝试从一个服务器迁移到新服务器。

他们拥有相同版本的 Discourse:

我遇到了这个错误

> [2022-10-15 06:12:50] [STARTED]
> [2022-10-15 06:12:50] 'frold' has started the restore!
> [2022-10-15 06:12:50] Marking restore as running...
> [2022-10-15 06:12:50] Making sure /var/www/discourse/tmp/restores/default/2022-10-15-061250 exists...
> [2022-10-15 06:12:50] Copying archive to tmp directory...
> [2022-10-15 06:12:52] Unzipping archive, this may take a while...
> [2022-10-15 06:13:00] Extracting dump file...
> [2022-10-15 06:13:08] Validating metadata...
> [2022-10-15 06:13:08]   Current version: 20221004122343
> [2022-10-15 06:13:08]   Restored version: 20221014005208
> [2022-10-15 06:13:08] EXCEPTION: You're trying to restore a more recent version of the schema. You should migrate first!
> [2022-10-15 06:13:08] /var/www/discourse/lib/backup_restore/meta_data_handler.rb:31:in `validate'
> /var/www/discourse/lib/backup_restore/restorer.rb:112:in `validate_backup_metadata'
> /var/www/discourse/lib/backup_restore/restorer.rb:43:in `run'
> /var/www/discourse/script/spawn_backup_restore.rb:23:in `restore'
> /var/www/discourse/script/spawn_backup_restore.rb:36:in `block in <main>'
> /var/www/discourse/script/spawn_backup_restore.rb:4:in `fork'
> /var/www/discourse/script/spawn_backup_restore.rb:4:in `<main>'
> [2022-10-15 06:13:08] Trying to rollback...
> [2022-10-15 06:13:08] There was no need to rollback
> [2022-10-15 06:13:08] Cleaning stuff up...
> [2022-10-15 06:13:08] Removing tmp '/var/www/discourse/tmp/restores/default/2022-10-15-061250' directory...
> [2022-10-15 06:13:09] Marking restore as finished...
> [2022-10-15 06:13:09] Notifying 'frold' of the end of the restore.'

为什么会出现迁移错误?为什么版本不同?它们应该使用相同的版本……

新服务器

旧服务器

您应该先升级接收方系统,然后再进行升级。

2 个赞

如何?

如图所示,版本应该相同。

它们位于 beta10 的不同提交上(请查看已安装版本下方的蓝色文本)

只需重新构建接收方实例,然后迁移应该就可以正常工作。

旧服务器:Welcome to Ubuntu 18.04.6 LTS (GNU/Linux 4.15.0-194-generic x86_64)

新服务器:Welcome to Ubuntu 22.04.1 LTS (GNU/Linux 5.15.0-50-generic x86_64)

这会是原因吗?

我尝试重建新服务器

cd /var/discourse
./launcher rebuild app

不,宿主系统无关紧要。

是的,这应该足够了。

2 个赞

不够。

我遇到了同样的错误 :frowning:

[2022-10-15 06:59:36] [STARTED]
[2022-10-15 06:59:36] 'frold' has started the restore!
[2022-10-15 06:59:36] Marking restore as running...
[2022-10-15 06:59:36] Making sure /var/www/discourse/tmp/restores/default/2022-10-15-065936 exists...
[2022-10-15 06:59:36] Copying archive to tmp directory...
[2022-10-15 06:59:38] Unzipping archive, this may take a while...
[2022-10-15 06:59:46] Extracting dump file...
[2022-10-15 06:59:53] Validating metadata...
[2022-10-15 06:59:53]   Current version: 20221004122343
[2022-10-15 06:59:53]   Restored version: 20221014005208
[2022-10-15 06:59:53] EXCEPTION: You're trying to restore a more recent version of the schema. You should migrate first!
[2022-10-15 06:59:53] /var/www/discourse/lib/backup_restore/meta_data_handler.rb:31:in `validate'
/var/www/discourse/lib/backup_restore/restorer.rb:112:in `validate_backup_metadata'
/var/www/discourse/lib/backup_restore/restorer.rb:43:in `run'
/var/www/discourse/script/spawn_backup_restore.rb:23:in `restore'
/var/www/discourse/script/spawn_backup_restore.rb:36:in `block in <main>'
/var/www/discourse/script/spawn_backup_restore.rb:4:in `fork'
/var/www/discourse/script/spawn_backup_restore.rb:4:in `<main>'
[2022-10-15 06:59:53] Trying to rollback...
[2022-10-15 06:59:53] There was no need to rollback
[2022-10-15 06:59:53] Cleaning stuff up...
[2022-10-15 06:59:53] Removing tmp '/var/www/discourse/tmp/restores/default/2022-10-15-065936' directory...
[2022-10-15 06:59:54] Marking restore as finished...
[2022-10-15 06:59:54] Notifying 'frold' of the end of the restore...

在恢复之前,您应该在新的服务器上安装 discourse-chat 插件。
该迁移属于 chat,不属于 discourse core。

5 个赞