Failed restore - You should migrate first?

Im trying to move from one server to a new server.

The are having the same edition of discourse:

I get this error

> [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.'

Why the migration error? Why two different versions? They should use the same…

The new server

The old server

You should upgrade the recipient system before upgrading

2 Likes

How?

As shown per images it should be the same version

They are on different commits of beta10 (check the blue text below the installed version)

Just rebuild the recipient instance and then the migration should work.

The old server: Welcome to Ubuntu 18.04.6 LTS (GNU/Linux 4.15.0-194-generic x86_64)

The new server: Welcome to Ubuntu 22.04.1 LTS (GNU/Linux 5.15.0-50-generic x86_64)

Could it be related to that?

I try to rebuild the new server by

cd /var/discourse
./launcher rebuild app

No, host system doesn’t matter.

Yes, that should be enough

2 Likes

It wasnt enough

Im getting the same error :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...

You should install the discourse-chat plugin on your new server before restoring.
That migration belongs to chat, not to discourse core.

5 Likes