Connecting to a different database
This guide walks you through pointing an existing Team assistant instance at a different Microsoft SQL Server database. You will edit the Docker Compose environment file, run the schema upgrade, and restart the services from the tas-manager menu.
Prerequisites
Before connecting a new database, follow these rules — ignoring them can corrupt data:
- The Team assistant version must be newer than the schema version of the existing database, or the database schema must be empty. An older Team assistant must never be connected to a newer schema.
- Only one Team assistant instance may be connected to a given database. Connecting a second instance to the same database will corrupt it.
- If the new database is a clone of another environment, disable the Team assistant crons before connecting the new instance so that the cloned scheduled jobs do not run. Run this SQL command against the database:
UPDATE CRONS SET CRON_STATUS='N'
- If the Team assistant version is newer than the newly connected database, the database schema migration must be run manually (step 5 below).
Procedure
1. Open the system shell
In the main menu, go to:
Management → System → [!] Open system shell (advanced users only)
Confirm the warning dialog. You are now at the shell command line. The Docker Compose environment file you will edit is $TAS_COMPOSE_PATH/.env (default ~/tas-compose/.env).
2. Open the environment file in the nano editor
Open the file in the nano text editor:
nano "$TAS_COMPOSE_PATH/.env"
Working in the nano editor:
- Move around with the arrow keys and type directly to edit.
- Save: press
Ctrl+O, thenEnterto confirm the file name. - Exit: press
Ctrl+X. - Exit without saving: press
Ctrl+X, thenNwhen asked whether to save.
3. Add or edit the database variables
Set the following required variables. If a variable already exists in the file, edit its value in place; otherwise add it on a new line.
Variable | Purpose | Example |
| Database engine (SQL Server) |
|
| Hostname or IP of the database server |
|
| TCP port |
|
| Database name |
|
| Schema name |
|
| Login user |
|
| Login password |
|
The variables below are optional — set them only when the target server requires them. Consult your database administrator or the Team assistant release notes for the exact values.
Variable | Purpose |
| Enable TLS encryption for the connection |
| Trust the server certificate (e.g. self-signed) |
| TLS encryption method |
| Enable Windows/NTLM authentication |
| NTLM authentication domain |
| Maximum connection pool size |
| Maximum number of rows returned per query |
| Query request timeout |
TAS_FRONTEND_IMAGE, TAS_BACKEND_IMAGE, TAS_COMPOSE_DB_BACKUP_PATH).4. Save and return to the menu
Save the file (Ctrl+O, Enter) and exit nano (Ctrl+X). Then type exit to leave the system shell and return to the tas-manager menu.
5. Run the database schema upgrade
In the main menu, go to:
Management → Team assistant → Run database schema upgrade
Confirm the prompt and wait for completion.
6. Restart the Team assistant services
In the main menu, go to:
Management → Team assistant → Manage services → Restart Team assistant
This restarts tas-frontend, tas-backend, and tas-backend-cron. Use Restart all services instead if you want to restart the entire set.
.env change. When in doubt, restart.Troubleshooting
Database unreachable / connection refused
Verify TAS_DB_HOSTNAME and TAS_DB_PORT. Check that the database server is reachable from the shell (network route, firewall) and that SQL Server is accepting TCP connections on that port.
Login failed / incorrect credentials
Re-check TAS_DB_USERNAME, TAS_DB_PASSWORD, and TAS_DB_NAME. Verify that the login exists on the target server and has rights to the database and the TAS_DB_SCHEMA schema.
TLS / certificate errors
Set TAS_DB_ENCRYPTION to match the server's requirement. For a self-signed or untrusted certificate, set TAS_DB_ENCRYPTION_IGNORE_CERTIFICATE.
Schema version mismatch / migration refuses to run
This is rule 1: the Team assistant version must be newer than the schema, or the schema must be empty. Verify the versions and run the schema upgrade (step 5).
Cloned database still runs scheduled jobs
This is rule 3: before starting the instance, run UPDATE CRONS SET CRON_STATUS='N' against the database.
Updated
by Frantisek Brych