Sharkord

Data Directory

Where Sharkord keeps the database, uploads, config and plugins, and how to back it up or move it.

Everything Sharkord owns lives in one directory: the database, uploaded files, logs, config, and plugins. Back up that directory and you have backed up your server.

Location

PlatformPath
Linux~/.config/sharkord
macOS~/Library/Application Support/sharkord
Windows%APPDATA%\sharkord
Docker/home/bun/.config/sharkord

On Linux, XDG_CONFIG_HOME is respected if you set it. In Docker, mount that path to a directory on the host, otherwise your server disappears with the container.

To put the data somewhere else entirely, set SHARKORD_DATA_PATH:

SHARKORD_DATA_PATH=/srv/sharkord ./sharkord

What's Inside

EntryContents
config.iniServer configuration
db.sqliteThe database: users, roles, channels, messages, settings
backups/Snapshots taken automatically before migrations
uploads/Files being uploaded, before they are confirmed
public/Stored attachments, avatars, banners, and emojis. See Storage and Uploads
tmp/Scratch space for in-flight operations
logs/Server logs
plugins/Installed plugins, one folder each
plugin-data/What each plugin wrote. Survives plugin updates, one folder each
interface/The web client for the running version
mediasoup/The media worker binary
drizzle/Database migration state

Only config.ini is meant to be edited by hand. Do not edit db.sqlite while the server is running.

Backups

Stop the server, copy the directory, start it again. Copying db.sqlite while the server is writing to it can produce a backup that will not open.

Back up before every update. Sharkord is in alpha and migrations only move forward.

Sharkord also snapshots the database into backups/ on its own whenever an update has schema changes to apply, unless you turn server.backupDatabase off. That covers the database only, never your uploaded files, and the snapshots are never pruned. See Database Migrations.

Migrating to Another Machine

  1. Stop the server.
  2. Copy the whole data directory to the new machine, into the location for that platform.
  3. Start the same Sharkord version there.

Settings, users, messages, files, and plugins all come along. If the server's public address changed, update webRtc.announcedAddress in config.ini.

Resetting the Server

Deleting the data directory wipes everything, including your account, the owner access token, and every uploaded file. The next start creates a fresh server and prints a new token.

On this page