# Does web based updates replace rebuilding the container?

**URL:** https://meta.discourse.org/t/does-web-based-updates-replace-rebuilding-the-container/102090
**Category:** Self-hosting
**Created:** [November 15, 2018, 6:47am UTC](https://meta.discourse.org/t/does-web-based-updates-replace-rebuilding-the-container/102090 "2018-11-15T06:47:22Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![vitorl](https://avatars.discourse-cdn.com/v4/letter/v/57b2e6/32.png) [@vitorl](https://meta.discourse.org/u/vitorl)
#### Post date: [November 15, 2018, 6:47am UTC](https://meta.discourse.org/t/does-web-based-updates-replace-rebuilding-the-container/102090/1 "2018-11-15T06:47:22Z")

</div>

I have been doing web based upgrades at `admin/upgrade` and since I tend to have very high up times, does this replace replace the updates that are done when rebuilding the container with `./launcher rebuild`?

Also, when I reboot does the container auto-update itself?

Thanks!

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [November 15, 2018, 6:54am UTC](https://meta.discourse.org/t/does-web-based-updates-replace-rebuilding-the-container/102090/2 "2018-11-15T06:54:48Z")

</div>

Majority of your updates can be done via the web, once in a few months you need to rebuild to get updates to the base image. If we deem it critical we will force it upon you.

---

<div class="post-metadata">

### Author: ![vitorl](https://avatars.discourse-cdn.com/v4/letter/v/57b2e6/32.png) [@vitorl](https://meta.discourse.org/u/vitorl)
#### Post date: [November 15, 2018, 6:56am UTC](https://meta.discourse.org/t/does-web-based-updates-replace-rebuilding-the-container/102090/3 "2018-11-15T06:56:48Z")

</div>

I was just upgrading stuff, and what a timing! I got a error

```plaintext
Discourse requires Ruby 2.5.2 or up
Docker Manager: FAILED TO UPGRADE
#<RuntimeError: RuntimeError>

```

So I guess I’ll stick to rebuilding every week or so. The downtime is bad, but I don’t need to be up 99,9% of the time.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [November 15, 2018, 7:02am UTC](https://meta.discourse.org/t/does-web-based-updates-replace-rebuilding-the-container/102090/4 "2018-11-15T07:02:59Z")

</div>

> [@vitorl](#):
>
> I was just upgrading stuff, and what a timing! I got a error

Oh … we got to force a rebuild here I just fixed that so others do not see this issue.

---

<div class="post-metadata">

### Author: ![vitorl](https://avatars.discourse-cdn.com/v4/letter/v/57b2e6/32.png) [@vitorl](https://meta.discourse.org/u/vitorl)
#### Post date: [November 15, 2018, 8:19am UTC](https://meta.discourse.org/t/does-web-based-updates-replace-rebuilding-the-container/102090/5 "2018-11-15T08:19:21Z")

</div>

I don’t know if I’m doing something wrong, but I tried to do a rebuild via terminal and I’m getting this:

```plaintext
error: Your local changes to the following files would be overwritten by merge:
        templates/import/mbox.template.yml
        templates/web.ssl.template.yml

```

But I don’t use those templates, and I do not interact with templates files. I delete them and can proceed, but any idea why this could be happening?

And I’m not sure if you were being sarcastic, I have no reason to lie or anything…

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [November 15, 2018, 10:17am UTC](https://meta.discourse.org/t/does-web-based-updates-replace-rebuilding-the-container/102090/6 "2018-11-15T10:17:19Z")

</div>

```plaintext
cd /var/discourse
git reset --hard
git pull
./launcher rebuild app

```

---

<div class="post-metadata">

### Author: ![vitorl](https://avatars.discourse-cdn.com/v4/letter/v/57b2e6/32.png) [@vitorl](https://meta.discourse.org/u/vitorl)
#### Post date: [November 15, 2018, 10:59am UTC](https://meta.discourse.org/t/does-web-based-updates-replace-rebuilding-the-container/102090/7 "2018-11-15T10:59:28Z")

</div>

Ok I’m trying to automate this, with a cronjob to rebuild the container after every reboot.

`@reboot sleep 300 && /opt/discourse/launcher rebuild app > /root/discord-update.log`

It seems to be working, but for some reason the log file get cut after `Removing old container`.

Is there some kind of recommended way to get automatic updates working?

I had to wait 300 seconds for the docker daemon to start. With this settings it should take 10 min after reboot to be back on air. Rebuilding takes 5 min with a SSD and 2 vCPU.

---

<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: [November 17, 2018, 1:49pm UTC](https://meta.discourse.org/t/does-web-based-updates-replace-rebuilding-the-container/102090/8 "2018-11-17T13:49:37Z")

</div>

If you’re concerned about uptime, you should switch to a two container install.

---

<div class="post-metadata">

### Author: ![vitorl](https://avatars.discourse-cdn.com/v4/letter/v/57b2e6/32.png) [@vitorl](https://meta.discourse.org/u/vitorl)
#### Post date: [December 10, 2018, 4:44pm UTC](https://meta.discourse.org/t/does-web-based-updates-replace-rebuilding-the-container/102090/9 "2018-12-10T16:44:04Z")

</div>

For some reason the output of my script stops redirecting to the file… is there a guide on this two container install?

5 min of downtime every month is still like 99,5% uptime so unless the two container install is easy to do/manage it doesn’t worth it…

---

<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: [December 10, 2018, 4:53pm UTC](https://meta.discourse.org/t/does-web-based-updates-replace-rebuilding-the-container/102090/10 "2018-12-10T16:53:36Z")

</div>

For a description see: [Move from standalone container to separate web and data containers](https://meta.discourse.org/t/how-to-move-from-standalone-container-to-separate-web-and-data-containers/29413).

For a normal rebuild/upgrade It’s pretty much the same as a single container install. Rather than

```
./launcher rebuild app

```

you do

```
./launcher bootstrap web_only && ./launcher destroy web_only && ./launcher start web_only

```

---

<div class="post-metadata">

### Author: ![dfriestedt](https://avatars.discourse-cdn.com/v4/letter/d/a698b9/32.png) [@dfriestedt](https://meta.discourse.org/u/dfriestedt)
#### Post date: [November 3, 2019, 9:49pm UTC](https://meta.discourse.org/t/does-web-based-updates-replace-rebuilding-the-container/102090/12 "2019-11-03T21:49:30Z")

</div>

I’m getting ready to migrate to separate data containers as described above.

When upgrading, do I ever need to update the data container? If so, when?

Also, can I assume the web container upgrade process will make necessary changes to the data tables, etc?

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [July 23, 2023, 5:40am UTC](https://meta.discourse.org/t/does-web-based-updates-replace-rebuilding-the-container/102090/13 "2023-07-23T05:40:23Z")

</div>



---

<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: [July 23, 2023, 6:15am UTC](https://meta.discourse.org/t/does-web-based-updates-replace-rebuilding-the-container/102090/14 "2023-07-23T06:15:31Z")

</div>

> [@dfriestedt](#):
>
> When upgrading, do I ever need to update the data container? If so, when?

When there is a change to postgres or redis. Knowing when this has happened is a matter of keeping track of things and is the reason that many people think that the two container setup is too hard. I have scripts that check postgres and redis versions and upgrade the data container if a change has been made. Those changed happen every year or two, though sub-base upgrades happen a bit more often. Generally if you don’t upgrade from 13.1 to 13.5 it won’t matter much.

> [@dfriestedt](#):
>
> Also, can I assume the web container upgrade process will make necessary changes to the data tables, etc?

Yes.

---

<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: [August 7, 2023, 1:00pm UTC](https://meta.discourse.org/t/does-web-based-updates-replace-rebuilding-the-container/102090/15 "2023-08-07T13:00:30Z")

</div>

This topic was automatically closed after 15 days. New replies are no longer allowed.
