---
title: "Operations"
manual: "adsum by web-vision"
version: "main"
permalink: "https://docs.typo3.org/permalink/web-vision/adsum-monorepo:installation-operations@main"
source: "Installation/Operations.rst"
rendered: "2026-11-07T02:01:32+00:00"
---

# Operations {#installation-operations}

An installation runs a web server with PHP, a database, a Messenger worker and a Mercure hub.

## Database migrations {#database-migrations}

After installing a package or updating, run the migrations. The command is safe to repeat:

```bash
bin/console doctrine:migrations:migrate --no-interaction
```

## Cache {#cache}

After installing a package or updating, rebuild the cache in two steps. Without the second, the first requests take
several seconds each:

```bash
bin/console cache:clear --no-warmup
bin/console cache:warmup
```

## Messenger worker {#messenger-worker}

The worker processes background and recurring jobs:

```bash
bin/console messenger:consume scheduler_default async_high async_low
```

-   `scheduler_default`: recurring jobs such as reminders, daily digests, purges, automatic clock-out and closing
    attendance days
-   `async_high`: the consequences of every change, such as recalculations, notifications and live updates
-   `async_low`: bulk work such as exports, report subscriptions and large recalculations

Without a running worker, changes are saved but their consequences wait in the queues. A missed recurring run is
made up once when the worker is back.

Messages that still fail after five retries move to the transport `failed`:

```bash
bin/console messenger:failed:show
bin/console messenger:failed:retry
bin/console messenger:failed:remove <id>
```

Start the worker with the application, restart it when it stops, and on every deploy run
`bin/console messenger:stop-workers`. An example for systemd:

```ini
[Unit]
Description=adsum Messenger worker
After=network.target

[Service]
Type=simple
User=www-data
WorkingDirectory=/var/www/adsum
ExecStart=/usr/bin/php bin/console messenger:consume scheduler_default async_high async_low --time-limit=3600
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target
```

## Mercure hub {#mercure-hub}

Both keys of the hub equal `MERCURE_JWT_SECRET`:

```bash
docker run -d --name mercure \
  -e SERVER_NAME=':80' \
  -e MERCURE_PUBLISHER_JWT_KEY='the-value-of-MERCURE_JWT_SECRET' \
  -e MERCURE_SUBSCRIBER_JWT_KEY='the-value-of-MERCURE_JWT_SECRET' \
  -e MERCURE_EXTRA_DIRECTIVES=$'anonymous 0\ncors_origins https://adsum.company.com' \
  dunglas/mercure:v0.19
```

The reverse proxy forwards `/.well-known/mercure` to the hub without buffering:

```nginx
location /.well-known/mercure {
    proxy_pass http://mercure;
    proxy_http_version 1.1;
    proxy_buffering off;
    proxy_cache off;
    proxy_read_timeout 24h;
    proxy_set_header Connection '';
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Proto $scheme;
}
```

In `.env.local`:

```bash
MERCURE_URL=http://mercure/.well-known/mercure
MERCURE_PUBLIC_URL=https://adsum.company.com/.well-known/mercure
MERCURE_JWT_SECRET=<the secret>
```

## Mail delivery {#mail-delivery}

Set `MAILER_DSN` (see [Configuration](https://docs.typo3.org/permalink/web-vision/adsum-monorepo:installation-configuration@main)). `smtp://` and `sendmail://` work out of the box; for
a provider such as Amazon SES or Mailgun, install its Symfony Mailer bridge with Composer.

## File storage {#file-storage}

Uploaded and generated files lie in the file storage (see [ADSUM_FILE_BACKEND](https://docs.typo3.org/permalink/web-vision/adsum-monorepo:confval-env-adsum-file-backend@main)). Files that the
application kept before it, such as leave attachments, photos, logos and exports, are moved into it once after the
update:

```bash
bin/console adsum:files:adopt-legacy --dry-run      # list the files that would move
bin/console adsum:files:adopt-legacy
```

The command checks every copy by its checksum and leaves the old files where they are, so it is safe to repeat; files
that are gone or changed on the way are listed and stay where they were. Remove the old directories once the list is
empty. To move the storage from the server's directory into a bucket, copy `var/storage/files` into the bucket
with the same paths and switch [ADSUM_FILE_BACKEND](https://docs.typo3.org/permalink/web-vision/adsum-monorepo:confval-env-adsum-file-backend@main).

## Change history protection {#change-history-protection}

Optionally, protect the change history (table `audit_entry`) in the database: revoke `UPDATE` and `DELETE` from
the application's database user and give a second user `DELETE` for the retention purge. The purge job then runs
with the `DATABASE_URL` of that second user.

PostgreSQL:

```sql
REVOKE UPDATE, DELETE ON audit_entry FROM adsum_app;
GRANT SELECT, DELETE ON audit_entry TO adsum_purge;
```

MariaDB, with table-level grants instead of a database-wide `UPDATE` and `DELETE`:

```sql
GRANT SELECT, INSERT ON adsum.audit_entry TO 'adsum_app'@'%';
GRANT SELECT, DELETE ON adsum.audit_entry TO 'adsum_purge'@'%';
```

Run the migrations with a user that may still change the table.

## Backups {#backups}

Back up the database, the file storage (`var/storage/files` or the bucket) and the directories
`app.photo_directory` and `app.file_storage_directory` (see [Composer](https://docs.typo3.org/permalink/web-vision/adsum-monorepo:installation-composer@main)).

## The login company {#the-login-company}

The login and password pages show the branding of one company. With one company, that is the one; with several,
choose it. Without a choice, the pages show the adsum mark:

```bash
bin/console app:branding:login-company                      # show the login company
bin/console app:branding:login-company --company=<company ID>
bin/console app:branding:login-company --clear
```

## Logs {#logs}

Check `var/log/prod.log` after a deploy and when users report errors (see [Configuration](https://docs.typo3.org/permalink/web-vision/adsum-monorepo:installation-configuration@main)).

## Monitoring {#monitoring}

-   Web server and PHP: response times, error rate
-   Database: connections, disk usage
-   Worker: that it runs, and the transport `failed`
-   Mercure hub: that `/.well-known/mercure` answers
-   Mail server: delivery failures

## Importing punches {#importing-punches}

To take over the punches of a previous system:

```bash
bin/console app:attendance:import-punches punches.csv
```

The CSV file has the columns `employeeId`, `type` (`clockIn`, `clockOut`, `breakStart`, `breakEnd`) and
`instant` (ISO 8601 with offset), in chronological order. A line that does not fit the punches before it is
reported and skipped. Imported punches skip the checks of live punches and notify nobody.

## Muting violation notices of one employee {#muting-violation-notices-of-one-employee}

Stop the notices about working-time violations of one employee:

```bash
bin/console adsum:attendance:mute-violation-notices <employee ID> on
bin/console adsum:attendance:mute-violation-notices <employee ID> off
```

The violations are still recorded and shown; the change history records every switch.

## Importing the starter FAQ {#importing-the-starter-faq}

Take the starter entries of the help-desk FAQ into a company, in English and German; HR and administrators can do the
same on the FAQ page:

```bash
bin/console adsum:helpdesk:import-starter-faqs <company ID>
bin/console adsum:helpdesk:import-starter-faqs <company ID> --entry=requestLeave --entry=raiseTicket
```

Entries whose English question the company has already are skipped, so the command can run again.
