Prepare the folder
- Log in as root
-
cd /home/mastodon
-
mkdir backups
-
cd backups
Making the backup
- Database (two steps)
su - mastodon
pg_dump -U mastodon mastodon_production -F t > DATE_FILENAME.tar
- Settings file (two steps)
exit
cp /home/mastodon/live/.env.production /home/mastodon/backups/DATE_.env.production
- Redis
cp /var/lib/redis/dump.rdb /home/live/backups/DATE_dump.rdb
If you wish to backup your assets like images and stuff (User-uploaded files), backup the folder named “public/system”. Keep in mind that this folder can be rather large. Actually, it can become rather massive.