Skip to content
CZ App Studio
All guides

All guidesInstallation

Backups and updates

Back up an installation, update Core from the product or the command line, roll back, and recover access when reCAPTCHA blocks login.

Use this page with AI Open in Claude Open in ChatGPT View as Markdown

Backups

Open Settings → Backups as the super administrator of the installation. On a hosted service only the service operator has it; company workspaces do not.

  • Back up now saves the database plus the application folder: uploads kept on the server, .env, installed add-ons and your own files. It leaves out what can be reinstalled or rebuilt: vendor, node_modules, compiled screens, caches, logs and earlier backups.
  • Back up database only saves just the database.
  • Download a backup to keep a copy off the server. A full backup contains .env with the encryption key and database password, plus employee data: treat every backup as confidential.
Settings → Backups: Back up now (1) or Back up database only (2).
Settings → Backups: Back up now (1) or Back up database only (2).

The database is also backed up every night at 02:15 UTC, and before every Core update, as long as the scheduler runs (* * * * * php artisan schedule:run). Old backups are removed at 02:45 UTC: every backup is kept for 7 days, then one a day for 16 days, one a week for 8 weeks, one a month for 4 months and one a year for 2 years. When backups take more than 5,000 MB, the oldest are removed first. From the command line, php artisan backup:run makes a full backup and php artisan backup:run --only-db a database backup.

Database backups use your database's command-line client (mysqldump for MySQL). If a backup reports that mysqldump cannot be found, install the MySQL client package, or set the folder that contains it in .env:

DB_MYSQL_DUMP_PATH=/usr/bin

php artisan doctor reports whether the tool was found and when the last backup was made.

Backups are zip files in storage/app/private/backups on the same server, so they do not survive the loss of that server: download the ones you rely on. They do not include files kept in cloud storage under Settings → File storage; protect those with your storage provider. Set BACKUP_ARCHIVE_PASSWORD in .env to protect new backup archives with a password. Delete a backup with the delete button beside it; it cannot be recovered.

There is no restore button. Restoring means importing the database dump and putting the files back, so test a restore on a separate copy at least once. Do not send production backups to support.

Before you update

Core and add-on updates are offered on Settings → Modules once the installation is activated. The installation checks once a day; Check for updates checks immediately.

  1. Read the release notes shown with the update.
  2. Download a recent full backup. The updater backs up the database itself, but not your files.
  3. Check what an update replaces against any changes you made to the application's files.
  4. Where you can, try the update first on a restored copy of the installation.
  5. Update add-ons first when the page asks for it. A Core update is refused while an enabled add-on does not support the new Core version.

Only one Core or add-on update can run at a time.

Update Core from the product

Activated installations show Open Core HR x.y.z is available on Settings → Modules when an update is released and your updates are current. Read the notes, then choose Update now → Start update. Keep the window open while it:

  1. checks the server (PHP version and extensions, free space, write access), downloads the release and checks it against CZ App Studio's signature;
  2. backs up the database;
  3. shows a maintenance page for a few moments while the Core files are replaced;
  4. applies database changes, clears caches, restarts the queue workers and brings the site back online.

The account running the update must be able to replace files in the application folder. If the web server's PHP account cannot, the update stops, puts back anything it already replaced and names the folder; update from the command line instead.

Afterwards:

  • run php artisan doctor;
  • reinstall the PDF renderer's packages (npm ci --omit=dev and npx playwright install --with-deps chromium), because node_modules is not updated;
  • run php artisan optimize again if you cache configuration;
  • restart Reverb and any other long-running service, and repeat the checklist's smoke checks.

An update is not offered, with the reason shown, when an enabled add-on does not support the new Core version, when the installation is a git checkout, or when demo mode is on.

What an update replaces

A Core update replaces every file and folder the release contains, each one whole.

Files and folders
Never touched .env, storage (uploads, backups, logs), Modules (add-ons and your own modules) and modules_statuses.json
Kept Files you added directly inside public, such as a site-verification file or the storage link; node_modules; and anything of your own at the top of the application folder that the release does not contain
Replaced Everything else, including app, bootstrap, config, database, lang, resources, routes, vendor, the compiled screens, the files the release ships in public and top-level files such as composer.json, package.json, AGENTS.md and CLAUDE.md

Changes you made to a replaced file are lost, and files you added inside a replaced folder are removed, without a warning. The previous copies stay in storage/app/private/updates, in a folder named after the old version, until the next Core update finishes, so a forgotten change can still be recovered by hand.

To keep customizations across updates, make them in Settings or in a module of your own; see Customization and integrations. When your own modules have screens, the updater rebuilds the compiled screens with npm; if npm is not available, the update still finishes and tells you to run npm ci and npm run build.

If an update fails

  • Checking, downloading or backing up fails. Nothing has changed. Correct the problem and start again. If only the database backup fails and you have your own recent backup, tick I have my own recent database backup and want to continue without one and choose Continue without a database backup.
  • Replacing files fails. The previous files are restored and the verified download is kept for a retry. Correct the disk-space or file-access problem first.
  • Applying database changes fails. The new files are in place and the site stays in maintenance mode. Correct the problem and run php artisan core:update --finish, or put the previous version back.
  • Put the previous version back (or php artisan core:update --rollback) restores the previous Core files. If it is interrupted, run it again; it resumes with the remaining files. Database changes are not reversed: restore the database backup if the previous version misbehaves.

If an add-on installation or update fails while copying files, the incomplete copy is removed and the previous add-on is restored.

Update from the command line

From the application folder, as the account that owns the application files:

php artisan core:update --check     # show the version, release notes and anything blocking it
php artisan core:update             # check, download, back up, update
php artisan core:update --finish    # retry the last step after a failure
php artisan core:update --rollback  # put the previous Core files back

Use --without-database-backup only when you have your own backup, and --force to skip the confirmation (for scripts).

Git checkouts and custom deployments

The built-in updater refuses to run when the application folder, or one of the two folders above it, contains a .git folder, so it never overwrites a working copy. Update from your repository instead: merge the new release into your copy, deploy it, then on the server:

php artisan down
composer install --no-dev --prefer-dist --optimize-autoloader
npm ci
npm run build
php artisan migrate --force
php artisan optimize
php artisan queue:restart
php artisan up

Preserve .env, storage and existing keys. Never run migrate:fresh, migrate:refresh, db:wipe or the demo seeders on a live installation: they delete data. Production installations refuse these commands.

Recover access when reCAPTCHA blocks login

If a signed-in administrator still has access, disable reCAPTCHA under Settings → Sign-in protection and save. Otherwise, a server administrator can run this from the application folder:

php artisan recaptcha:disable --no-interaction

This disables enforcement in the same settings store and keeps the saved keys. It does not reset accounts, passwords or application data. Sign in, correct the Google configuration, and complete a new configuration test before enabling protection again.

Inside Open Core HR

Swipe across to explore the screen.

Inside Open Core HR