Skip to content
CloseYourItdocsPages

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.

ThingIn the backup
Projects, tickets, errors, logs, metrics, visitsyes
The secret keys in /opt/closeyourit/.envno
Uploaded files (Docker volume closeyourit_storage)no
Requests waiting in the ingest gateway queueno

The two that matter:

  • The secret keys. Without the .env the install was made with, the encrypted data in a backup cannot be read. Keep a copy of .env outside 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

  1. On the old server: closeyourit backup, then copy the newest file in backups/ and /opt/closeyourit/.env somewhere safe.
  2. On the new server: install the same version (CLOSEYOURIT_VERSION=<version>, see Installation).
  3. In the new .env, replace SECRET_KEY_BASE, the three AR_ENCRYPTION_* keys and SECRET_ASSETS_MASTER_KEY with the values from the old one. Leave POSTGRES_PASSWORD as 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.
  4. Put the backup file in /opt/closeyourit/backups/ and run closeyourit restore <file>.
  5. Copy the uploaded files too, unless they are on S3.
  6. Point the domain to the new server.

Check the install

closeyourit doctor
CheckIt complains when
Diskless than 10% is free
Appit does not answer
HTTPS certificateit expires in less than 14 days, or the address does not answer
Backupthere is none, or the last one is older than 26 hours
Ingest gateway and queuethe gateway is on and one of them is down or keeps restarting
Versiona newer one is available (a note, not a problem)

Other commands

CommandDoes
closeyourit statusshows the services and the version
closeyourit logsfollows the log of the app and the worker
closeyourit restartrestarts after a settings change
closeyourit enable ingestturns on the ingest gateway
closeyourit disable ingestturns it off

Something not working? See Troubleshooting.