Skip to content

Management commands

atfinity supports a range of management commands to make administrating your installation easier.

They are executed via ./atfinity.sh COMMAND [OPTIONS].

Many commands accept a tenant id via -t TENANT_ID (or --tenant-id). When it is optional and omitted, the command usually applies to all tenants — check the description of the individual command below.

Version & status

Read-only commands to inspect the state of your installation.

display_version

Display the current version of the software.

  • -c TENANT_ID — additionally display the current version of that tenant's configuration.

display_changes

Display a table with the number of configuration changes for all tenants.

  • -t TENANT_ID — restrict the output to a single tenant.

case_overview

Display an overview of past and present cases, grouped by process. For clients with a fee based on the number of completed cases, we will ask you to send us the output of this command.

show_tenants

List all tenants in the system with their ids, titles and subdomains.

Users & access

Manage users, groups and roles. These commands share a common structure: the operation is selected with one of --list, --create, --update or --delete. They also accept:

  • -t TENANT_ID — scope the operation to a single tenant.
  • -f {text,json,csv} — output format (default text).

users

Display and manage users.

  • users --list [--group GROUP] [--role ROLE] [--level LEVEL] — list all users, optionally filtered by group, role or level.
  • users --create --email EMAIL --password PASSWORD --first-name FIRST_NAME --last-name LAST_NAME --initials INITIALS --level LEVEL [--add-groups GROUP] [--add-roles ROLE] — create a new user.
  • users --update ... — update an existing user (same fields as create).
  • users --delete --email EMAIL — remove a user.

groups

Display and manage user groups.

  • groups --list [-t TENANT_ID] — list groups.
  • groups --create NAME -t TENANT_ID — create a group.
  • groups --delete NAME -t TENANT_ID — delete a group.

roles

Display and manage user roles.

  • roles --list [-t TENANT_ID] — list roles.
  • roles --create NAME -t TENANT_ID — create a role.
  • roles --delete NAME -t TENANT_ID — delete a role.

Tenant lifecycle

Create, copy and delete tenants and their initial users.

create_tenant

Create a new tenant.

  • -s TENANT_SUBDOMAIN — subdomain for the new tenant (required).
  • -t TENANT_TITLE — display title for the tenant.

create_tenant_and_user

Create a new tenant together with an attached meta admin user.

  • -s TENANT_SUBDOMAIN — subdomain for the new tenant (required).
  • -u USER_EMAIL — email (username) of the meta admin user.
  • -p PASSWORD — password for the meta admin user.
  • -t TENANT_TITLE — display title for the tenant.

create_user (deprecated)

Create a new meta admin user within the given tenant. If the user already exists, their password is reset and their meta admin status is updated. Prefer users --create for new installations.

  • -u USER_EMAIL — email (username) of the user (required).
  • -p PASSWORD — password (required).
  • -t TENANT_ID — tenant the user belongs to (required).
  • --meta_admin — grant meta admin rights.

copy_tenant

Create a copy of an existing tenant, including its configuration, under a new title and subdomain.

  • -t TENANT_ID — id of the tenant to copy (required).
  • -n TITLE — title of the new tenant (required).
  • -s SUBDOMAIN — subdomain of the new tenant (required).

delete_tenant

Delete the tenants with the given ids. Accepts one or more ids.

  • TENANT_ID1 [TENANT_ID2 ... TENANT_IDN] — ids of the tenants to delete.

Configuration

Export and import a tenant's configuration as an .atc file. Use these to move a configuration between environments (for example from a staging to a production installation).

export_configuration

Export the configuration of a single tenant as an .atc file.

  • -o OUTPUT_PATH — target path for the export (default conf_export.atc).
  • -t TENANT_ID — tenant to export (default 1).

import_configuration

Import an .atc configuration file into a tenant.

  • INPUT_PATH — path to the .atc file to import (required).
  • -t TENANT_ID — target tenant (default 1).

Backup (data & files)

Export and import the full database and files as a .zip. Unlike the configuration commands, these cover all data — cases, instances and files — and are meant for backups and full-installation transfers.

zip_export

Export all current data and files to a .zip. The archive appears in the /import folder.

  • -o /import/data_and_files_export.zip — target path for the archive.
  • --no_files — export data only, without files.

zip_import

Clear the current database and import a .zip containing data and files. The archive is first copied into a shared folder with the docker container and then imported.

  • ZIP_FILE_TO_IMPORT — path to the archive to import (required).

Search & reindexing

Rebuild or clear the search indices. Run these after bulk data changes, after an import, or when search results look stale.

reindex

Reindex configuration, cases and instances for the whole installation.

reindex_cases

Reindex all cases.

  • -t TENANT_ID — restrict to a single tenant (default: all tenants).

reindex_instances

Reindex all instances.

  • -t TENANT_ID — restrict to a single tenant (default: all tenants).

reindex_cases_and_instances

Reindex cases and instances.

  • -t TENANT_ID — restrict to a single tenant (default: all tenants).
  • --delete_conf_indices — also delete the configuration indices before reindexing.

delete_indicies

Delete the case and instance search indices.

  • -t TENANT_ID — restrict to a single tenant (default: all tenants).

Case & data maintenance

Recalculate, invalidate or delete case and instance data.

Warning

The delete commands in this section are destructive and cannot be reverted. Make sure you have a backup (see Backup) before running them.

invalidate_cases

Invalidate all cases for all tenants. This forces the rule engine to recalculate every case and its results the next time the case is opened.

recalculate_case

Recalculate a single case immediately.

  • -c CASE_ID — id of the case to recalculate (required).

delete_all_cases_and_instances

Delete all cases and instances for a specific tenant. Configuration is not affected.

  • -t TENANT_ID — tenant whose case and instance data is deleted (required).

delete_all_data

Delete all case and instance data for all tenants in the database.

clear_admin_logs

Delete all admin logs from the database for the given tenant. This cannot be reverted.

  • -t TENANT_ID — tenant whose logs are cleared.

File & task cleanup

Remove stale tasks and files. We recommend running the cleanup commands periodically.

remove_old_tasks

Delete celery tasks (and their attachments) older than a week. We recommend running this periodically.

mark_unused_files

Mark all unused files with the prefix unused_ so they can be reviewed before deletion.

  • -t TENANT_ID — restrict to a single tenant.
  • -a — apply to all tenants.

delete_unused_files

Delete all files that are not referenced by any data. Typically run after mark_unused_files.

  • -t TENANT_ID — restrict to a single tenant.
  • -a — apply to all tenants.
  • -d DAYS_AGO — only delete files that were marked more than DAYS_AGO days ago.

remove_pdfs_without_files

Delete all PDFs that do not have a file attached.

Notifications

disable_all_notifications

Disable all notifications for the given tenant.

  • -t TENANT_ID — tenant whose notifications are disabled (required).