Operations and backup
Useful commands, backup and restore, the self-extracting archive and resetting.
Useful commands
docker compose exec -u www-data php vendor/bin/typo3 list # TYPO3 CLI
docker compose exec -u www-data php vendor/bin/typo3 cache:flush
docker compose exec -u www-data php vendor/bin/typo3 search:index # sync the search index
docker compose exec db mariadb -u typo3 -p typo3 # database shell
docker compose logs -f web php
Creating a backup
./BACKUP.sh # → backups/typo3-appliance-backup-<date>.tar.gz
./BACKUP.sh --with-env # including .env (passwords, OIDC client secret!)The archive contains the project directory (without .git and backups/), an SQL dump of the database (sessions as structure only) and the volumes typo3-config, typo3-fileadmin and typo3-var (without cache and logs). typo3temp and the search index are regenerated, and the restore rebuilds the images. composer.lock ensures identical package versions.
Without --with-env, no .env is included. Pass on the client secret and passwords separately and confidentially.
Restoring
./RESTORE.sh typo3-appliance-backup-<date>.tar.gz [target directory] # default: ./typo3-appliance
# or: tar xzf <archive>; cd typo3-appliance-backup-<date>; ./RESTORE.sh [target directory]RESTORE.sh creates the project, builds the images, fills the volumes, imports the dump and starts everything. If .env is missing, .env.example is used. Then enter TYPO3_OIDC_CLIENT_SECRET and run docker compose up -d.
The script aborts if the target directory is not empty or the Compose project typo3 already has volumes. --force deletes and replaces them. To run alongside an existing instance:
COMPOSE_PROJECT_NAME=typo3test HTTP_PORT=8089 ./RESTORE.sh …
Self-extracting shell archive
./CREATE_SHELL_ARCHIVE_BACKUP.sh [--with-env] # → backups/typo3-v14-oidc-appliance-YYYYMMDD.shThe result is a single file with the backup and RESTORE.sh that the recipient only has to run:
./typo3-v14-oidc-appliance-YYYYMMDD.sh # creates ./typo3-appliance + volumes and starts
./typo3-v14-oidc-appliance-YYYYMMDD.sh ./target # different target directory
./typo3-v14-oidc-appliance-YYYYMMDD.sh --list # show contents
./typo3-v14-oidc-appliance-YYYYMMDD.sh --extract d # extract onlyAfter restoring, adjust as needed: host name and port, the Keycloak client (redirect and back-channel URL) and docker-compose.override.yml.
Resetting completely
docker compose down -v # deletes ALL data including the database