# Updates and recovery ## Before an update 1. Read the release notes and confirm the required PHP and database versions. 2. Back up the database, private uploaded files, and application key to protected storage. 3. Record the current release identifier and confirm that the backup can be restored in a separate environment. 4. Schedule a maintenance window and pause traffic if the update includes database changes. ## Manual update 1. Place the new application files in the release directory. Preserve `.env` and persistent private storage. 2. Install the locked PHP packages with `composer install --no-dev --prefer-dist --optimize-autoloader`. 3. Install frontend packages with `npm ci` and build assets with `npm run build`. 4. Run `php artisan down` if the deployment uses Laravel maintenance mode. 5. Apply migrations with `php artisan migrate --force`. 6. Restart web workers, queue workers, and the scheduler so they load the new code. 7. Check sign-in, the workspace, a read-only provider validation, queue health, and scheduled task health. 8. Run `php artisan up` when checks pass. ## Docker Compose update Back up the MySQL volume and private upload storage. Pull or place the intended source revision, then run `docker compose build` and `docker compose up -d`. The web container applies migrations when it starts. Confirm that web, worker, and scheduler containers are running and review their logs. ## Rollback Do not assume a code rollback can reverse a database migration. Check the release notes for compatibility and migration details. Restore the matching database and file backup together in a controlled maintenance window if the newer schema or data cannot be used by the old release. Restore the matching application key; encrypted credentials cannot be read with a different key. ## After the update Confirm the public URL, TLS, queue worker, scheduler, backups, outgoing connections, and login security. Keep the previous release and backup protected until the new deployment has been stable for the operator's chosen retention period.