Don't try to restore a diff discourse version by just renaming the backup file

I was trying to restore a backup to another instance of discourse, when I faced this error while restoring:

You’re trying to restore a more recent version of the schema. You should migrate first!

So, I went straight to meta and found this solution that, “I should (perhaps) rename the backup file to some lower/or same version as showing on target website”. This was even the ‘chosen solution’.
So, without wasting any moments, I went to my installation, renamed the ‘backup-file’ 1 point lower than what the target website installation was showing and restored thru Web UI. In the end of the restore operation, the site was broken (with the error msg told below). And I didn’t see/find any failed/successful msg (but I did see the ‘restore was successful’ msg in my email later on).

And then I found that my database of target website has gone corrupt to the level of unrecoverable (at least at my level).

The error msg on the front end I get is:

Oops
The software powering this discussion forum encountered an unexpected problem. We apologize for the inconvenience.
Detailed information about the error was logged, and an automatic notification generated. We'll take a look at it.
No further action is necessary. However, if the error condition persists, you can provide additional detail, including steps to reproduce the error, by posting a discussion topic in the site's feedback category.

Then

  1. I’ve tried to rebuild the container. Failed.
  2. I’ve tried to restore that backup, which was generated with this very new, ok working, website, on which I tried to restore, thru backend (discourse restore filename) command. But it too ‘Failed’.
  3. I then even deleted the whole ‘data’ folder of my two container discourse setup and tried to rebuild the ‘data’ container. But again, same.
  4. Then I rebuilt (even after deleting the web_only folder), but still the same.
  5. In the end, I had to erase full ‘discourse’ folder, delete both containers, and build from start.

But thank to my luck that it/the target website was a new installation with a few posts. So no worries there.

I wanted to share my experience under that very topic, but unfortunately that was closed to new replies.

Yes, that topic was referring to one very specific case, where an incorrect version number was stored into the backups. It was written in July 2020 and the backup was supposed to be from October 2020.

It might be a good idea to remove or edit that topic.

In your specific case, you should probably just make sure that the instance you’re trying to restore into, is at latest (i.e. tests-passed). If that does not work, can you please post the two version numbers here?

2 Likes