This guide is designed to help you upgrade your self-hosted Tines infrastructure and its external components. Before attempting any operations in this guide, we strongly urge you to take backups of your database. We also suggest that you do not upgrade Tines versions while making core infrastructure changes.
Shutdown and Startup of Tines Services
If you are performing maintenance or migrations on the underlying infrastructure hosting Tines, follow the preferred order below to gracefully shut down. Following these steps will cause downtime for your Tines tenant. This order is applicable to Docker Compose, ECS, and Kubernetes. For each step, reduce the number of running instances to zero.
Before starting the shutdown process, review the section "Checking tines-sidekiq queue size." If samples show non-zero values that are not reducing, you should scale the tines-sidekiq service before starting the shutdown.
Scale-down order:
nginx or other proxy service (if applicable)
tines-app
tines-sidekiq (Ensure the queue size reaches near 0 and is not increasing during sampling before proceeding).
tines-command-runner
Redis/Valkey
Postgres
pypi-server
Examples of scaling down by platform:
Docker Compose:
docker compose stop tines-appECS:
aws ecs update-service --cluster tines --service tines-app --desired-count 0Kubernetes:
kubectl scale deployment tines-app --replicas=0Checking tines-sidekiq Queue Size
Run the following Rails command from within a tines-sidekiq container to check the queue size. Run this command multiple times over a 2–5 minute window to ensure the volume is decreasing.
bundle exec rails runner "puts JSON.pretty_generate(Sidekiq::Queue.all.map { |q| { name: q.name, size: q.size, latency: q.latency.round(2), paused: q.paused? } })"Accessing the container:
Docker:
docker exec -it tines-sidekiq /bin/bashKubernetes:
kubectl exec -it <pod-name> -c tines-sidekiq -- /bin/bashECS: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-exec.html
aws ecs execute-command --cluster \
--task \
--container tines-sidekiq \
--interactive \
--command "/bin/bashMigrating to a New Database Instance
Before performing operations on your PostgreSQL instance, ensure you have recent backups and snapshots in place. Migration time varies based on data volume and network speed. Do not run this process from a laptop or any machine that may enter sleep mode.
Prerequisites:
All Tines services shut down except Postgres.
A host with
pg_dumpandpg_restoreinstalled.Network connectivity between source and destination databases.
Adequate local storage for the dump file.
Existing
DATABASE_NAMEandDATABASE_HOSTconfiguration details.
Export
pg_dump -h <existing_db_host> \
-U <username> \
-d <database_name> \
-Fc \
-v \
-f tines_migration_snapshot.dumpImport
pg_restore -h <new_db_host> \
-U <username> \
-d <database_name> \
-v \
tines_migration_snapshot.dumpMigrating to a New Redis/Valkey Instance
Redis/Valkey is an in-memory, transient datastore that does not require manual migrations or backups. To make cluster changes (such as adding nodes), follow the standard shutdown and startup procedure listed above.
Changing DNS for External Services
Changing the DNS for external services (e.g., Redis/Valkey or Postgres) should never be performed while Tines is running.
Update the following values in your configuration:
Docker Compose and ECS (.env):
REDIS_URL=redis://<new_dns_host>:6379/1
DATABASE_HOST=<new_dns_host>Helm (values.yaml):
tinesApp:
databaseConfiguration:
DATABASE_HOST: <new_dns_host>
redisConfiguration:
REDIS_URL: redis://<new_dns_host>:6379/1Note: Before restarting Tines, ensure the new DNS entry has propagated and is accessible from your infrastructure. At a minimum, wait for the duration of the DNS TTL and flush any local DNS caches if necessary.