Skip to main content


Upgraded Pleroma to the newest version. Thanks to its upgrade instructions having been really stable over time, the script I created a while ago made it a breeze.

It's nothing special, just this:

#!/bin/bash

pushd ~pleroma/pleroma \
&& sudo -u pleroma MIX_ENV=prod -s -- eval 'git pull -q && mix deps.get && mix compile' \
&& sudo systemctl stop pleroma \
&& sudo -u pleroma MIX_ENV=prod -s -- eval 'mix ecto.migrate' \
&& sudo systemctl start pleroma \
&& popd

Obviously I back up first, with another script.

in reply to Gidi Kroon

The #pleroma backup script is less universally useful I guess, just for completeness:

#!/bin/bash

export PGHOST=<redacted>
export PGDATABASE=<redacted>
export PGUSER=<redacted>

timestamp=$(date +%F_%H%M) \
&& pg_dump -w --format=custom -f ~admin/backups/pleroma_prod-${timestamp}.pgdump \
&& sudo tar zcvf ~admin/backups/config-pleroma-${timestamp}.tgz \
        --ignore-failed-read \
        /etc/letsencrypt/{live,archive}/pleroma.gidikroon.eu \
        /etc/systemd/system/pleroma.service \
        /etc/nginx/sites-available/pleroma.gidikroon.eu \
        ~pleroma/pleroma/config/prod.secret.exs \
        ~pleroma/pleroma/config/vm.args \
        ~pleroma/pleroma/instance/static \
        ~admin/bin \
&& aws s3 mv ~admin/backups/pleroma_prod-${timestamp}.pgdump s3://<redacted> \
&& aws s3 mv ~admin/backups/config-pleroma-${timestamp}.tgz s3://<redacted>
in reply to Gidi Kroon

Note that this script does not backup uploaded media. This is because media is on s3 and handled there.