Before you start
- Schedule a maintenance period. Stop all Chartbrew API instances and background workers before the final backup and migration.
- Record the current application version or Docker image tag.
- Back up the Chartbrew MySQL or PostgreSQL database. Check that you can restore it.
- Save your
.envfile, deployment settings, and any persistent files or volumes used for uploads. - Keep the encryption key and legacy secret that your database currently uses. If these are stored as
CB_ENCRYPTION_KEY_DEVandCB_SECRET_DEV, move their exact values toCB_ENCRYPTION_KEYandCB_SECRET. Do not replace your.envfile with.env-template. - Keep the existing database, Redis, public URL, email, and integration settings.
Requirements and changes
The environment variables reference explains the main connection and deployment settings.
Update environment variables
All installations must check their environment variables before the v6 upgrade. v6 uses the original variable names in every environment. Variables with the_DEV suffix are no longer supported. NODE_ENV still controls runtime behavior, but it does not select a different set of variable names.
- Back up your environment files and deployment settings.
- For each environment, keep the values that the installation currently uses. If it uses
_DEVvariables, move those values to the names without_DEV, then remove the old entries. If both names exist, replace the original value with the value used by that environment. Do not keep duplicate entries. - Check
.env,client/.envif present, service-manager settings, Docker settings, hosting secrets, CI configuration, and shell exports. Use separate values for development, test, and production. - Check the database, Redis, encryption keys, public URLs, mail, Google, and OpenAI settings. Installations that already use only the original names can keep their values.
Apply the same rule to every other
_DEV variable. Compare the result with the v6 .env-template.
For source installations, also update client/src/config/settings.js. This generated file is not replaced by npm run setup when it already exists. Back it up and compare it with client/src/config/settings.template.js from v6. Remove old variable names and preserve any required local changes. If you have no custom settings, replace it with the v6 template:
VITE_APP_* values. Restart all API instances and workers after the upgrade so that they read the new configuration.
Upgrade from source
Run the following commands from your Chartbrew checkout. ReplaceYOUR_V6_TAG with the exact tag of the v6 release you want to install.
1. Select the release
Save any local code changes before you change versions. Select a release tag from the Chartbrew releases.2. Install dependencies and build the client
Keep your existing.env file in the project root. Set the production VITE_APP_* values before you build the client.
3. Apply database migrations
With all application instances stopped, run the migration once against the production database:Production startup also applies pending migrations. The separate command lets you check the result before you start the application. Development startup does not apply migrations automatically. For a development database, use
NODE_ENV=development npm --prefix server run db:migrate.4. Start the application
Restart the API and client through your existing service manager. Serve the newclient/dist build. If you start the API directly, run:
Upgrade with Docker
Keep your existing database volumes, environment variables, ports, networks, and file mounts. Do not replace your deployment configuration with the release example without checking the differences.Docker Compose with a local build
If your Compose service usesbuild: ., select the v6 source release as shown above. With the application stopped and the backup complete, run these commands from the directory that contains your Compose file. These examples use the service name chartbrew.
Docker Compose with a published image
If your service usesimage:, set it to the exact v6 image tag you want to deploy. Check the available tag in the Chartbrew image repository. Then run:
docker run, create the replacement container with the selected v6 image and the same settings and mounts. Start only one instance until its automatic migrations complete. See Run on Docker for the container settings.
Check the upgraded installation
Before you end the maintenance period:- Check the server logs for database migration errors and chart migration warnings. A server that starts can still have charts that need attention.
- Sign in with an existing account. Check team access and dashboard permissions.
- Open representative charts. Check values, dates, time zones, labels, legends, and horizontal bars against v5.
- Test a data refresh for each connection type you use, including private-network connections.
- Check dashboard filters, layouts, public reports, password-protected reports, and embedded charts.
- Test API calls with existing API keys. Check any scripts that read or write chart configuration.
- Generate a chart image and check a scheduled report. Confirm that background jobs complete through Redis.
Older v5 share links and private connections
Depending on your v5 version, your installation can also have pending migrations for share tokens and private API connections.- If an old share link fails, create a new share token and update the link or embed.
CB_ALLOW_LEGACY_SHARE_TOKENS=1temporarily permits tokens signed withCB_SECRET. Use it only while you replace old links, then remove it or set it to0. - If an API connection to a private host fails, check its private-host permission and your private-network configuration. A pending migration can reset the saved permission. Permit access only to hosts that the connection needs.
Retention settings
v6 includes automatic cleanup for update history and observation data. The defaults keep successful update history for 30 days, failed update history for 90 days, and metric snapshots for 90 days. Review theDATA RETENTION section in the release’s .env-template before startup if you need different periods. A value of 0 disables cleanup for that category.
If you tested an early build with observation monitors, the migration set includes a reset of those monitors and their linked observations. Keep a backup and recreate the monitors after the upgrade.
Return to v5 if the upgrade fails
- Stop all v6 API instances and workers.
- Save the failure logs. Keep a separate copy of the current database if you need to investigate it.
- Restore the database backup made before the upgrade. Restore the matching configuration and uploaded files.
- Deploy the recorded v5 source release or Docker image.
- Start v5 and check sign-in, connections, dashboards, and scheduled jobs.