Upgrading TAS 5.19 to 5.21 – Guide for DevOps
Technical procedure for upgrading a customer instance from 5.19 to 5.21 for DevOps and administrators: preparation, the upgrade procedure, infrastructure changes and rollback.
Summary
The upgrade from 5.19 to 5.21 adds a third backend process (queue), and the database migrations are one-way. The only way back is restoring from a backup. Therefore: backup, a dress rehearsal on a copy of the production DB, and only then production.
What DevOps must always do:
- Add a queue container (or service) with the same image and env as the backend, command
npm run start:queue. - Run the migrations (
npm run mig). - Install the 5.21 versions of the plugins. A plugin for 5.19 will not load.
- After startup, hand the instance over to the consultant, who runs
validation.checkMigration()and fixes the template code.
The other changes are in the Infrastructure changes section. For each one, the Relevant if… column states when it applies to you. If it does not apply to you, skip it.
Before the upgrade
- Plugins: list the installed plugins and their versions (Administration → Plugins). You must have a 5.21 version of each one, and a rebuilt version of each custom plugin. Relevant if the customer has any plugin installed.
- Dress rehearsal on a copy: before production, upgrade a copy of the production DB and measure how long the migrations take. Plan the downtime accordingly. During the dress rehearsal, the consultant runs
validation.checkMigration()and fixes the templates, so on production they only need to check.
Upgrade procedure
From 5.21, three backend processes run from the same image: backend (npm run start), cron (npm run start:cron) and the new queue (npm run start:queue). Without the queue process, service operations, archiving, manager rights synchronization and image processing wait indefinitely.
- Announce the downtime and turn on maintenance mode. Crons now do not run in maintenance mode.
- Stop the backend, cron and frontend.
- Take a full backup of the database and storage (DMS, shared files, plugins). Verify that the backup can be restored.
- Adjust the env according to the Infrastructure changes section. For the migration run, temporarily increase
TAS_DB_REQUEST_TIMEOUT(the default 120 s is not enough for large tables) and, on MSSQL, alsoTAS_DB_LOCK_TIMEOUT. - Add a queue container with the same image, env file and network as the backend, only with the command
npm run start:queue. Docker example (adjust the names to your installation):docker run -d --name tas-backend-queue \
After startup, the container log contains the line
--restart unless-stopped \
--network TAS \
--env-file /opt/tas/config/tas-backend.env \
<backend image>:5.21 \
npm run start:queueBackground process running as queue. - Deploy the 5.21 image and run the migrations:
npm run mig. Wait for the messageMigration tool finished successfully. - If the migration fails, restore the backup. Do not run 5.19 or 5.21 on a partially migrated DB.
- Reset the timeouts to their usual values and start the backend, cron, queue and frontend.
- Install the 5.21 versions of the plugins.
- Perform the manual steps from the Infrastructure changes section that apply to you (e.g. MS Graph).
- Turn off maintenance mode and hand the instance over to the consultant.
Infrastructure changes
The first two rows apply to every installation. For the others, check the Relevant if… column, and skip the item if it does not apply to you.
Processes and runtime
Change | Relevant if… | What to do |
New queue process ( | always | Add a container or service |
Plugins allow version 5.21.x at most | always, if any plugin is installed | Install the 5.21 versions. Plugins with their own REST (apiExtensions, exposeDb, singleSignOn) must have a 5.21 version; older ones do not work. Rebuild custom plugins. |
Plugin configuration keys were renamed ( | you use these plugins | The migration rewrites them automatically; just check the configuration after the upgrade |
CleanupCron runs every hour, the new CommandReconciliationCron every minute | you watch crons in monitoring | Adjust the expectations in monitoring |
Queue endpoints take the names | monitoring or scripts call | Update the calls |
iDoklad was removed | the customer had iDoklad | Deactivate its cron |
ImageMagick 7 ( | Windows installation without Docker | Install ImageMagick 7 |
The Zabbix template changed | you monitor via Zabbix | Re-import |
Environment variables
Variable | Relevant if… | What to do |
| you have | Set |
| the instance has long transactions, or on PostgreSQL queries were waiting for a connection | Keep the defaults. |
| scheduled tasks and XML imports on the instance often end in a deadlock or lock timeout | Keep the defaults. A transaction that loses a deadlock is retried up to 3 times |
Removed: | they are in the env | Delete them |
| always on the frontend | Set the application name for the browser tab |
| the backend cannot reach its public URL and export to CSV or XLSX does not work | Set it to the internal backend address, the same one the frontend uses |
| multiple instances share one Redis | Set a different prefix for each instance |
| it is set | Check that the paths are complete folders |
| you use the SSO plugin and many users log in from a single IP | Increase the limit; the default is 10 attempts |
Custom fonts
Consultants can now upload custom fonts for prints themselves in Administration → Shared files → Fonts. Nothing is required from DevOps.
Mail via MS Graph
Convert the configuration of the old MS Graph crons into a connection in Email processing. The new Email processing cron is not created automatically on an upgraded DB.
Relevant if TAS reads or sends mail via Microsoft 365 (MsGraph* crons).
- In the service console, run
sys.mail.migrateMsGraphToNewEmailStuff(). It prints a preview and changes nothing. - If the preview is correct, run
sys.mail.migrateMsGraphToNewEmailStuff(true). - Create and activate the Email processing cron and delete the old
MsGraph*rows. - Secret values (client secret) must be references to the vault.
- Verify incoming email in Administration → Email ledger.
exposeDb with an external database
Relevant if the exposeDb plugin reads from a database other than the TAS one.
The migration rewrites the knex block in the configuration to externalDb. After the upgrade, check that the plugin configuration contains externalDb and the client mssql or postgresql. If a query returns UNMIGRATED_DB_CONNECTION, fix the configuration manually.
After the upgrade
The technical check takes about 15 minutes and is done right after startup, before handing over to the consultant.
GET /status/livenessresponds on the backend, cron and queue.GET /queue/workflow/get-workersreturns running workers.- Administration → Plugins: no plugin is in an error state ("Incompatible plugin version").
- Administration → Crons: crons are running and none reports "not found in cron container" (old MS Graph crons).
- A test service operation or archiving completes. If it hangs, the queue process is not running.
- Login works through every authority in use (password, LDAP, SAML, Entra ID, SSO).
- Printing to PDF and DOCX conversion succeed (this verifies LibreOffice and Chromium).
- In the migration log, go through the lines
[Migration20260722184302](task forms to review),[Migration20260817182114](skipped parts of the diagram),unresolved dynamic table referencesanddiscontinued custom dynamic lists, and pass them on to the consultant.
Handover to the consultant
The consultant runs validation.checkMigration() in the service console and fixes the template code according to the guide for consultants. Give them the excerpt from the migration log and the list of items from this article that applied to the instance (plugins, MS Graph).
Rollback
down() throws an error for the main ones. The only way back is to restore the backup of both the database and the storage and deploy the 5.19 image. Data created after the upgrade is lost, so the decision to roll back must be made no later than before the instance is opened to users.