When restoring a backup, the 'disable email' will be set to non-staff from no

version v2.3.0.beta8 +144

destination clean install, restored via shell

Ahh! I think that I’ve seen that but thought it was my imagination.

I can’t tell when the feature got added, but if you don’t want to disable emails, it can be set via an option, but by default it set disable_email to “non-staff”.

https://github.com/discourse/discourse/blob/master/script/discourse#L109

https://github.com/discourse/discourse/blob/master/lib/backup_restore/restorer.rb#L32

This is a fantastic feature. It is pretty rare that I want to restore a backup and have it immediately start spewing mail.

4 Likes

That’s not a bug. It’s a feature that was added a long time ago, but it was broken for as long as I can remember. :slight_smile:

I fixed it two months ago in https://github.com/discourse/discourse/commit/dc961fecb9c28be5e8f161a82616148be6a9facc#diff-f59428cd341969776f9ebf8c157b83c7

You can disabled that behavior when you restore from the command line:

discourse restore --disable_emails=false <filename>
7 Likes

A documented bug is a feature. Everyone knows that.

But a broken feature. . . . Hmm.

I’m very happy that this has been fixed. In addition to nearly every time I restore a backup having to worry that it’ll start spewing email. This is also very handy for staging sites that can now safely restore a backup and not have to worry about mail going out (my previous solution was to just make the mail settings invalid).

:tada: This is fantastic. :tada:

Being able to disable the now un-broken behavior is fine too. :slight_smile:

3 Likes

OP says it is being set to non-staff from no.
So if it was completely disabled, it’s now partially enabled (for staff).
That doesn’t seem desired behavior?

3 Likes

Oh, good catch! I missed that detail in the topic title. :blush:
Well, then it’s a bug. It will be fixed.

6 Likes

disable emails being set to no means: do not disable emails for any user. So it’s completely enabled.

That said, I prefer the existing behaviour of setting disable emails to non-staff regardless of prior setting value as I can be sure that whatever be the case, email will always be enabled for me as staff on site I am restoring.

4 Likes

That’s cool. If it’s a feature.

it could be useful for some people , when you do not want to have mails sent to members while a backup is restored.

For me, I thought when I restore something, the settings should be just exactly same as when I did the backup, that’s why I opened this topic.

There was a bug in there after all. It’s fixed.

https://github.com/discourse/discourse/commit/3aca0703116c5d9b776835c5d00c84c4d6592062

6 Likes