User kuyashi reported a bug preventing the restoration of a downloaded backup to a new Discourse instance. The system initially rejected the filename due to “invalid characters,” and after renaming, it failed with an error stating the “Migration version is missing.” User cpradio identified the issue as a flawed regular expression in the backup controller that incorrectly interpreted hyphens as character ranges. They suggested that the core logic requires adjustment and proposed a temporary workaround of replacing hyphens with underscores. User pfaffman offered an alternative short-term solution: downgrading the Discourse version in app.yml to a specific commit prior to the validation change. kuyashi initially encountered a scheduler error when attempting this downgrade but, after pfaffman clarified the need for a rebuild, successfully restored the instance by reverting to commit f63a797e390ed79b643cfad42837a67068549fbfkuyashi. Meanwhile, cpradio submitted a pull request to permanently fix the filename validation logic, which kuyashi acknowledged with gratitude.
I want to move my discourse instance to a new server, however when I download a backup form current server and try to upload to new server, I get the following:
There has been an error while uploading ‘cs-uni-2016-09-16-155132-v20160905092148.tar.gz’: The backup filename contains invalid characters. Valid characters are a-z 0-9 . - _.
So I changed the backup filename to something that was accepted, is that why I am getting:
EXCEPTION: Migration version is missing from the filename.
Why doesn’t discourse accept uploads for restore ?
And the fact that - may need to be escaped like . is. Alternatively, if you list - at the very end, it should work too but being between two characters, it thinks it is trying to define a range.
So either /^[a-zA-Z0-9\.\-_]+$/ or /^[a-zA-Z0-9\._-]+$/ should work