Data and backups¶
The server keeps all data in the folder from CUHLUMN_DATA.
With Docker Compose, this folder is /data in the volume cuhlumn-data.
data/
cuhlumn.db SQLite database
cuhlumn.db-wal SQLite write-ahead log
cuhlumn.db-shm SQLite shared memory
media/
blog.example.com/
ba7816bf8f01cfea414140de5dae2223.png
fonts/ Fonts from the font library
Database¶
| Table | Contents |
|---|---|
sites |
One row for each site, with the settings and the appearance |
site_aliases |
One row for each alias domain |
posts |
Posts and pages with their Markdown bodies |
media |
One record for each uploaded image |
sessions |
Hashed console sessions |
settings |
One row with the token digest, the console domain, and the scheme |
fonts |
One record for each font file in the font library |
- The database uses WAL mode, foreign keys, and a busy timeout of 5 seconds.
- Deleting a site deletes its aliases, posts, and media records.
- Rendered pages are not stored. The server renders them again after a restart.
Migrations¶
The database stores its schema version in PRAGMA user_version.
At startup the server applies each newer migration in its own transaction.
Do not open the database with an older server version after a migration.
Backups¶
Back up the database, the media folder, and the fonts folder together.
- Copy the database with the SQLite online backup, for example
sqlite3 data/cuhlumn.db ".backup backup.db". - Copy the
mediafolder and thefontsfolder.
A plain file copy of cuhlumn.db while the server runs can miss data in the WAL file.
Stop the server first if you copy the files directly.
Restore¶
- Stop the server.
- Put the database file, the
mediafolder, and thefontsfolder in the data folder. - Start the server.