Cannot upload a downloaded backup

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 ?

1 Like

I maybe wrong, but it may be related to this

From this commit:

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

Thoughts @tgxworld?

Also, I think it would be better to make the test, use ‘test_Site-0123456789.tar.gz’ so that it utilizes all of the characters you are permitting.


@cpradio thanks for the input.

what would I change this backup filename to in order to have it be accepted: ?


You wouldn’t. Core needs to adjust its logic. Then you’d get latest and it will upload just fine.

One thing you can try, and this is purely a guess to get you around the current issue, is replace the ‘-’ (a hyphen) with ‘_’ (an underscore).

I can’t promise that will work, but it “might”.

I’ve got a meeting to get to, and then heading home. If I have time tonight and it is still unresolved, I’ll submit the PR to fix it.


many thanks @cpradio

The short-term answer is to edit app.yml and replace

version: stable


version: f7a335a64e7146166d5fdaedcfee816997f2822d

That’ll put you back to 1.6.1 and you’re good to go!

You’ll need to remember to change it back to tests-passed after it gets bumpted to 1.6.3, however!

Oh! If you were on tests-passed wait for me to edit this. . .,

version: b3c65620f341df95c58043dd5f120f5f43e62e3e

should take you back to beta3.

Thanks @pfaffman, but i tried that and it fails with the following in the logs:

Job exception: undefined method `every' for Jobs::MigrateUploadScheme:Class

/var/www/discourse/lib/scheduler/schedule_info.rb:79:in `schedule!'
/var/www/discourse/lib/scheduler/manager.rb:270:in `schedule_next_job'
/var/www/discourse/lib/scheduler/manager.rb:248:in `block in tick'
/var/www/discourse/lib/scheduler/manager.rb:295:in `block in lock'
/var/www/discourse/lib/distributed_mutex.rb:21:in `synchronize'
/var/www/discourse/lib/scheduler/manager.rb:294:in `lock'
/var/www/discourse/lib/scheduler/manager.rb:247:in `tick'
/var/www/discourse/config/initializers/100-sidekiq.rb:35:in `block (2 levels) in <top (required)>

That’s what you got when you did a ./launcher rebuild app? (I left out that step).

Yes, thats correct …

Well, darn. I’m operating at the edge of my expertise, but the

version: f7a335a64e7146166d5fdaedcfee816997f2822d

worked for me when I did my rebuild on stable

I suppose you could try

version: f63a797e390ed79b643cfad42837a67068549fbf

which is the last checkin before the filename validation one.

1 Like

Much appreciated! i’ll try your last advice and let you know, thanks.

The following worked as a fixed pending the PR merge from @cpradio

1 Like

PR Submitted: (I got out of my meeting early)


Thank you kindly @cpradio