3.7 KiB
Upgrade your Docker Funkwhale installation
If you installed Funkwhale following the Docker guide, follow these steps to upgrade.
Upgrade Funkwhale
-
SSH into your server
-
Log in as your
funkwhaleuser.su funkwhale -
Navigate to your Funkwhale directory.
cd /srv/funkwhale -
Export the Funkwhale version you want to update to. You'll use this in the rest of the commands in this guide.
export FUNKWHALE_VERSION={sub-ref}`version` -
Change the version number in your
.envfile. Update this to the same version number you exported in step 4.nano .env -
Log in as
suto load the configuration from your.envfile.sudo su source .env -
Pull the updated containers.
docker compose pull -
Apply the database migrations.
docker compose run --rm api funkwhale-manage migrate -
Relaunch your containers.
docker compose up -d -
Exit the root shell.
exit
That’s it! You’ve updated your Funkwhale pod. You should now see the new version running in your web browser.
Update your reverse proxy configuration
To ensure your reverse proxy is up-to-date with changes, you should regenerate your Nginx configuration with each upgrade. To do this:
:::{include} /administrator/installation/docker.md :start-after: Nginx update instructions :end-before: Instructions end :::
Once you've updated your configuration, reload Nginx.
# systemctl reload nginx
Upgrade the Postgres container
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.
To update your Postgres container, follow these steps:
-
Stop all Funkwhale services
# docker compose down -
Create a backup of your Funkwhale database. We will import this into the new postgres container later.
# docker compose exec -i postgres pg_dump -U postgres postgres > db_dump.sql -
Move the {file}
data/postgresdirectory to another location to back it up$ mv data/postgres data/postgres.bak -
Create a new {file}
data/postgresdirectory to house your data$ mkdir data/postgres -
Edit the {file}
docker-compose.ymlfile in an editor of your choice.$ nano docker-compose.yml -
Update the version number in the
imagesection of thepostgresservice to the major version you want to use. In this example, Postgres version15is used.{emphasize-lines="9"}
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 -
Save the file and close your editor
Once you've updated your Postgres containers, you need to migrate your database. To do this:
:::{include} /administrator/migration.md :start-line: 112 :end-line: 129 :::
:::{seealso}
You can use the postgres-upgrade container 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.