I recently made lots of improvements to the restore process and a couple more are planned. The pull request contains a high level description of the changes.
https://github.com/discourse/discourse/pull/8625
I’m closing this bug report as fixed. Please create a new bug report when you encounter an error during a restore and you are using the tests-passed version of Discourse.