4FreeForumsFree forum softwareStart a forum

Federated Database Snapshots and Media Backups: Admin Q&A

By 4FreeForums Editors · Published October 29, 2026 · Sources linked below

Federated Database Snapshots and Media Backups: Admin Q&A
Photo: "Wikimedia Foundation Servers-8055 01" by Victorgrigas, CC BY-SA 3.0, via Wikimedia Commons (cropped).

Maintaining disaster recovery plans for federated social networks and modern discussion platforms requires understanding how different layers of infrastructure depend on each other. When orchestrating snapshots across relational databases, caching tiers, and external media storage archives, administrators must follow a distinct sequence to safeguard user accounts, authentication keys, and server stability. This guide answers key architectural questions regarding sequential backup procedures.

In what order should federated server data be backed up?

When creating backups, components must be prioritized based on how vital they are to instance survival. According to the Mastodon documentation on backing up your server, data must be backed up in the following order of importance:

  1. PostgreSQL database
  2. Application secrets from the .env.production file or equivalent configuration
  3. User-uploaded files
  4. Redis database

Establishing this snapshot hierarchy guarantees that the primary system records are secured before secondary media archives or transient cache states are copied. For broader backup fundamentals across other platforms, see our guide on how to back up your forum.

Why does the relational database hold the highest snapshot priority?

The core PostgreSQL database houses all critical information for the instance. The loss of PostgreSQL results in the complete failure of the server, destroying all accounts, posts, and follower graphs. Relational storage is susceptible to hardware failure and data corruption arising from power cuts, hard disk drive failure, and botched database schema migrations.

To capture PostgreSQL states, administrators can occasionally generate dumps using pg_dump or pg_dumpall. For high-availability deployments seeking continuous protection, administrators can implement hot streaming replication. This approach maintains a secondary PostgreSQL server with continually up-to-date data, allowing for immediate switchover if the primary database node goes down.

What happens if application secrets are lost?

Application secrets stored within .env.production represent the easiest target in your backup schedule because they never change. Protecting them simply requires storing a copy of the configuration in a safe location. However, losing these secrets creates severe operational issues. If the secrets file is destroyed or lost, active users will be logged out, two-factor authentication becomes completely unavailable, Web Push API subscriptions cease working, and multiple platform features will stop functioning entirely.

Do external media storage archives require regular local snapshots?

How you treat media attachments depends on where your files physically live. If you host media locally on the server file system, administrators must regularly copy the sizeable public/system directory where uploaded items reside by default. Losing these files means avatars, headers, and post attachments are lost, though the server will still function moving forward.

Conversely, if an instance uses external object storage providers such as Amazon S3, Google Cloud, or Wasabi, administrators do not need to execute manual backup snapshots for those files. The third-party storage providers assume responsibility for guarding against underlying hardware failures.

How should the Redis caching tier be handled during backup routines?

Backing up Redis is straightforward because the database regularly writes its state to a single file located at /var/lib/redis/dump.rdb. Copying this single file is all that is required for a complete Redis snapshot.

Furthermore, losing Redis entirely is almost harmless to server continuity. The only irrecoverable records inside Redis are the contents of Sidekiq task queues and scheduled retries of earlier failed jobs. While home feeds and list feeds are housed within Redis, administrators can regenerate both feeds directly using the tootctl command-line utility. If you are configuring your environment from scratch, reviewing the steps for installing Mastodon from source on Ubuntu will help clarify where these components sit.

Why are off-site snapshot procedures necessary for hardware protection?

The backup documentation emphasizes guarding against hardware failure, such as data corruption occurring on a physical disk. The most dependable archives are off-site backups that are stored entirely away from the machine running the instance. As the Mastodon backup documentation warns, if the hosting server catches fire or the local hard disk drive explodes, any snapshots stored on that same physical hard drive will be destroyed alongside the live environment.

Sources

Published October 29, 2026. No affiliate links on this page. Facts come from the sources linked above; check them for updates.