Self-hosted memex
Back up and restore
Where a self-hosted memex keeps its daily backups, how to copy them off the machine, and how to restore one.
Once a day memex writes a copy of its database files and a Markdown export of your notes to /data/backups, and keeps the last seven. They are on the same volume as everything else, so copy them off the machine:
docker cp memex:/data/backups ./memex-backups
Settings › Notes › Export downloads the Markdown export at any time.
Restore everything from a backup folder
YYYYMMDD-HHMMSS stands for the one you choose:
docker stop memex
docker run --rm -v memex:/data -v "$PWD/memex-backups/YYYYMMDD-HHMMSS:/backup:ro" --entrypoint sh ghcr.io/artem-kolesnikov/memex -c 'test -f /backup/directory.sqlite && test -d /backup/vaults && old=/data/before-restore-$(date +%s) && mkdir "$old" && mv /data/directory.sqlite* /data/vaults "$old"/ && cp /backup/directory.sqlite /data/ && cp -r /backup/vaults /data/ && echo restored'
docker start memex
Nothing is touched unless the folder holds a backup, and what was there before is moved to /data/before-restore-… rather than deleted. Put secret.env back the same way if the volume was lost.
Restore notes only, from a Markdown export
On a new memex, Settings › Notes › Import takes the ZIP. Each note arrives with its tags, description and dates; history, connections and settings stay behind. An export from memex.tools imports the same way, and back. See Import notes.