# Upgrade container - keeping config and data

**URL:** https://meta.discourse.org/t/upgrade-container-keeping-config-and-data/229968
**Category:** Self-hosting
**Created:** [June 14, 2022, 7:24pm UTC](https://meta.discourse.org/t/upgrade-container-keeping-config-and-data/229968 "2022-06-14T19:24:09Z")
**Posts on this page:** 1
**Showing post:** 6

<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: [June 14, 2022, 8:45pm UTC](https://meta.discourse.org/t/upgrade-container-keeping-config-and-data/229968/6 "2022-06-14T20:45:56Z")

</div>

> [@tschloss](#):
>
> Sorry, I don‘t know what you meant with your question „Did you enter the three commands…“

Did you click the link in the first reply that says “How do I manually update Discourse and docker image to latest”? It includes this:

> [@Manually update Discourse and Docker image to latest](https://meta.discourse.org/t/manually-update-discourse-and-docker-image-to-latest/23325/1):
>
> Every two months we recommend SSH’ing into your web server (using putty or your favorite SSH client) and doing
> 
> ```plaintext
> cd /var/discourse
> git pull
> ./launcher rebuild app
> 
> ```
> 
> Especially if the upgrade page doesn’t show up or you have any issues when trying to upgrade.

So those are the commands that you use to upgrade. You won’t lose anything.

But if it was two years ago, it’s a bit more complicated because the database needs to get upgraded too, so you’ll want to have a look at [PostgreSQL 13 update](https://meta.discourse.org/t/postgresql-13-update/172563). (But usually, you just rebuild twice and it works.)

---

_[View the full topic](https://meta.discourse.org/t/upgrade-container-keeping-config-and-data/229968)._
