/opt/pleroma
)sudo -Hu postgres pg_dump -d <pleroma_db> --format=custom -f </path/to/backup_location/pleroma.pgdump>
(make sure the postgres user has write access to the destination file)pleroma.pgdump
, config/prod.secret.exs
and the uploads
folder to your backup destination. If you have other modifications, copy those changes too./opt/pleroma
)sudo -Hu postgres psql -c 'DROP DATABASE <pleroma_db>;';
sudo -Hu postgres psql -c 'CREATE DATABASE <pleroma_db>;';
sudo -Hu postgres pg_restore -d <pleroma_db> -v -1 </path/to/backup_location/pleroma.pgdump>
mix ecto.migrate
1. This task performs database migrations, if there were any.sudo -Hu postgres vacuumdb --all --analyze-in-stages
. This will quickly generate the statistics so that postgres can properly plan queries.systemctl stop pleroma
systemctl disable pleroma
systemctl reload nginx
sudo -Hu postgres psql -c 'DROP DATABASE <pleroma_db>;';
sudo -Hu postgres psql -c 'DROP USER <pleroma_db>;';
userdel pleroma
Prefix with MIX_ENV=prod
to run it using the production config file. ↩︎