Documentation / Getting started
Updates and backups
Update to a new version, back up and restore the database, check the install.
Update
closeyourit update
It first downloads the files of the new version (compose.yml, Caddyfile, the queue settings and the closeyourit command itself): if they do not exist, it stops and nothing changes. Then it makes a backup, downloads the new version, updates the database and restarts. If the images of the new version cannot be downloaded, or it does not answer within 3 minutes, it goes back to the previous version and files by itself and tells you which backup to restore if needed. The backup taken before the update stays in backups/.
Going back changes the version of the app, not the database: changes the new version already made to it stay. If the old version misbehaves after that, restore the backup taken before the update.
To install a specific version: closeyourit update 1.4.0.
What the backup contains
A copy of the main database is made every night at 03:00. The last 7 stay in /opt/closeyourit/backups/, readable by root only; the output of each run goes to /var/log/closeyourit-backup.log.
| Thing | In the backup |
|---|---|
| Projects, tickets, errors, logs, metrics, visits | yes |
The secret keys in /opt/closeyourit/.env | no |
Uploaded files (Docker volume closeyourit_storage) | no |
| Requests waiting in the ingest gateway queue | no |
The two that matter:
- The secret keys. Without the
.envthe install was made with, the encrypted data in a backup cannot be read. Keep a copy of.envoutside the server. - Uploaded files. Attachments and session replays are files, not rows. Either store them on S3 (
AWS_S3_BUCKET, see Settings) or copy the volume yourself.
Back up and restore
closeyourit backup # make a copy now
closeyourit restore <file> # bring the database back to a copy
<file> is the name of a file in /opt/closeyourit/backups/, for example closeyourit-20261003-030000.dump.
restore stops the app, deletes the current database, creates it again from the copy and starts the app. Everything written after that copy is gone. It asks you to type restore before it does anything.
Keep a copy elsewhere
A copy on the same server does not survive the loss of the server. To send each copy to Amazon S3 too, set in /opt/closeyourit/.env:
BACKUP_S3_BUCKET=my-backups
AWS_REGION=eu-central-1
AWS_ACCESS_KEY_ID=...
AWS_SECRET_ACCESS_KEY=...
Each copy goes to s3://<bucket>/closeyourit/. Copies on S3 are not deleted by CloseYourIt: set an expiry rule on the bucket.
Move to another server
- On the old server:
closeyourit backup, then copy the newest file inbackups/and/opt/closeyourit/.envsomewhere safe. - On the new server: install the same version (
CLOSEYOURIT_VERSION=<version>, see Installation). - In the new
.env, replaceSECRET_KEY_BASE, the threeAR_ENCRYPTION_*keys andSECRET_ASSETS_MASTER_KEYwith the values from the old one. LeavePOSTGRES_PASSWORDas the new install wrote it. Copy your own settings across too: email, S3 (AWS_*, without them attachments and replays stored there cannot be opened), GitHub, Telegram. - Put the backup file in
/opt/closeyourit/backups/and runcloseyourit restore <file>. - Copy the uploaded files too, unless they are on S3.
- Point the domain to the new server.
Check the install
closeyourit doctor
| Check | It complains when |
|---|---|
| Disk | less than 10% is free |
| App | it does not answer |
| HTTPS certificate | it expires in less than 14 days, or the address does not answer |
| Backup | there is none, or the last one is older than 26 hours |
| Ingest gateway and queue | the gateway is on and one of them is down or keeps restarting |
| Version | a newer one is available (a note, not a problem) |
Other commands
| Command | Does |
|---|---|
closeyourit status | shows the services and the version |
closeyourit logs | follows the log of the app and the worker |
closeyourit restart | restarts after a settings change |
closeyourit enable ingest | turns on the ingest gateway |
closeyourit disable ingest | turns it off |
Something not working? See Troubleshooting.