# Ao restaurar um backup, a opção 'disable email' será definida como não-staff de no

**URL:** https://meta.discourse.org/t/when-restoring-a-backup-the-disable-email-will-be-set-to-non-staff-from-no/115143
**Category:** Bug
**Created:** [Abril 15, 2019, 6:42pm UTC](https://meta.discourse.org/t/when-restoring-a-backup-the-disable-email-will-be-set-to-non-staff-from-no/115143 "2019-04-15T18:42:06Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![skygunner](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/skygunner/32/138468_2.png) [@skygunner](https://meta.discourse.org/u/skygunner)
#### Post date: [Abril 15, 2019, 6:42pm UTC](https://meta.discourse.org/t/when-restoring-a-backup-the-disable-email-will-be-set-to-non-staff-from-no/115143/1 "2019-04-15T18:42:06Z")

</div>

version v2.3.0.beta8 +144

destination clean install, restored via shell

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [Abril 15, 2019, 7:15pm UTC](https://meta.discourse.org/t/when-restoring-a-backup-the-disable-email-will-be-set-to-non-staff-from-no/115143/2 "2019-04-15T19:15:58Z")

</div>

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/main/script/discourse#L109>

> <https://github.com/discourse/discourse/blob/main/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.

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [Abril 15, 2019, 8:07pm UTC](https://meta.discourse.org/t/when-restoring-a-backup-the-disable-email-will-be-set-to-non-staff-from-no/115143/3 "2019-04-15T20:07:35Z")

</div>

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. 🙂

I fixed it two months ago in [FIX: Outgoing emails were not disabled after restoring backup · discourse/discourse@dc961fe · GitHub](https://github.com/discourse/discourse/commit/dc961fecb9c28be5e8f161a82616148be6a9facc#diff-f59428cd341969776f9ebf8c157b83c7)

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

```plaintext
discourse restore --disable_emails=false <filename>

```

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [Abril 15, 2019, 8:11pm UTC](https://meta.discourse.org/t/when-restoring-a-backup-the-disable-email-will-be-set-to-non-staff-from-no/115143/4 "2019-04-15T20:11:36Z")

</div>

> [@gerhard](#):
>
> It’s a feature that was added a long time ago, but it was broken for as long as I can remember. 🙂

_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).

🎉 This is fantastic. 🎉

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

---

<div class="post-metadata">

### Author: ![michaeld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/michaeld/32/1594_2.png) [@michaeld](https://meta.discourse.org/u/michaeld)
#### Post date: [Abril 15, 2019, 8:20pm UTC](https://meta.discourse.org/t/when-restoring-a-backup-the-disable-email-will-be-set-to-non-staff-from-no/115143/5 "2019-04-15T20:20:12Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [Abril 15, 2019, 8:34pm UTC](https://meta.discourse.org/t/when-restoring-a-backup-the-disable-email-will-be-set-to-non-staff-from-no/115143/6 "2019-04-15T20:34:54Z")

</div>

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

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [Abril 16, 2019, 6:26am UTC](https://meta.discourse.org/t/when-restoring-a-backup-the-disable-email-will-be-set-to-non-staff-from-no/115143/8 "2019-04-16T06:26:47Z")

</div>

> [@michaeld](#):
>
> OP says it is being set to non-staff from no.  
> So if it was completely disabled, it’s now partially enabled (for staff).

`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.

---

<div class="post-metadata">

### Author: ![skygunner](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/skygunner/32/138468_2.png) [@skygunner](https://meta.discourse.org/u/skygunner)
#### Post date: [Abril 16, 2019, 8:00am UTC](https://meta.discourse.org/t/when-restoring-a-backup-the-disable-email-will-be-set-to-non-staff-from-no/115143/9 "2019-04-16T08:00:52Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [Abril 16, 2019, 9:58am UTC](https://meta.discourse.org/t/when-restoring-a-backup-the-disable-email-will-be-set-to-non-staff-from-no/115143/10 "2019-04-16T09:58:22Z")

</div>

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

[https://github.com/discourse/discourse/commit/3aca0703116c5d9b776835c5d00c84c4d6592062](https://github.com/discourse/discourse/commit/3aca0703116c5d9b776835c5d00c84c4d6592062)

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [Abril 16, 2019, 9:58am UTC](https://meta.discourse.org/t/when-restoring-a-backup-the-disable-email-will-be-set-to-non-staff-from-no/115143/11 "2019-04-16T09:58:26Z")

</div>


