Upgrading Mastodon



My notes for upgrading a dockerised mastodon instance

Backup database

docker exec mastodon-db-1 pg_dump -Fc -U postgres postgres > ~/backup/2022-12-14-Mastodon.dump

Change the docker-compose.yml to link to the new image

  web:
    image: tootsuite/mastodon:v4.1.1

Pull the new image

docker compose pull

Restart the docker image

docker compose down && docker compose up -d && docker compose logs --follow

Clear the cache

docker exec -it mastodon-web-1 tootctl cache clear

Run any migration scripts

docker exec -it mastodon-web-1 rails db:migrate