Funkwhale depends on Postgres for its database container. To upgrade Postgres, you need to export your database and import it into a new container to update the schema.
3. Move the {file}`data/postgres` directory to another location to back it up
```console
$ mv data/postgres data/postgres.bak
```
4. Create a new {file}`data/postgres` directory to house your data
```console
$ mkdir data/postgres
```
5. Edit the {file}`docker-compose.yml` file in an editor of your choice.
```console
$ nano docker-compose.yml
```
6. Update the version number in the `image` section of the `postgres` service to the major version you want to use. In this example, Postgres version `15` is used.
{emphasize-lines="9"}
```yaml
version: "3"
services:
postgres:
restart: unless-stopped
env_file: .env
environment:
- "POSTGRES_HOST_AUTH_METHOD=trust"
image: postgres:15-alpine
volumes:
- ./data/postgres:/var/lib/postgresql/data
```
7. Save the file and close your editor
Once you've updated your Postgres containers, you need to migrate your database. To do this:
You can use the [`postgres-upgrade` container](https://hub.docker.com/r/tianon/postgres-upgrade/) to automate some of the upgrade procedure on **AMD64** Docker deployments.
That's it! Your Funkwhale pod is now running the new version of Postgres. The old database is available in `/srv/funkwhale/data/postgres-old`. You can back this up and remove it from your server once you've confirmed everything is working.