Updating the Flow Production Tracking Application Container to a New Version
Local installations of Flow Production Tracking are no longer offered. This documentation is intended only for those with existing instances of Flow Production Tracking Enterprise Docker. Click here for a list of our current offerings.
This guide explains how to upgrade Flow Production Tracking to a new version when using the Docker architecture.
It is intended for Flow Production Tracking Administrators.
Glossary
Flow Production Tracking Instance - Refers to your Flow Production Tracking site and all its components, e.g., “Flow Production Tracking.yourstudio.com”.
Flow Production Tracking Container - Container containing the application code, gems, and libraries required by a given release of Flow Production Tracking.
Planning the update
Please refer to Procedure to upgrade Flow Production Tracking to a new version to familiarize yourself with the proposed update procedure.
Updating Flow Production Tracking is an operation that requires downtime. That operation must therefore be planned carefully.
- Find out how much downtime will be required for the production upgrade. See the Planning for downtime section of our update procedure for how to estimate this.
- Plan your staging upgrade. Make sure to have a regression testing pass, stressing out all our important workflows and automation scripts, between staging and production upgrades.
- Highly consider syncing your staging site with a fresh copy of the production database before updating staging. This will allow you to validate that the data migrations are compatible with your data set. This will also allow you to get a precise estimate of the downtime required for the production update.
- Plan for the worst. Make sure you understand what can go wrong, and how to rollback if something goes wrong.
Executing the update operation
- Get latest Flow Production Tracking containers from https://shotgrid.autodesk.com/, and load them in Docker on each server. Learn more about the installation procedure here.
sudo tar -vxf shotgun-docker-se-7.2.3.0.tar.gz -C /opt
sudo chown -R shotgun:shotgun /opt/shotgun
cd /opt/shotgun/se
sudo docker load < shotgun-app.7.2.3.0.tar
- Update the image in the
docker-compose.yml
on each server. You will have to change the version of the app and emailnotifier container on each of your hosts. For example, if the version you are going to is 7.2.3.0:
app:
image: shotgun-app:7.2.3.0
- Pre-migrate the database. Some database operations might take awhile to execute, so before going in maintenance mode, you can apply the changes below while your site is still running. The database modifications in this step are considered low risk and non disruptive, mainly adding additional indexes.
sudo docker-compose run --rm app rake admin:pre_upgrade
If you are planning to continue the update process at a later time, we are strongly suggesting to revert the modifications done in step 2. It will reduce the chances of confusion and will allow containers to be recreated properly.
- Stop all
shotgun-app
containers, on all servers.
i) Shotgun SE Docker v7.3 and earlier
sudo docker-compose stop app emailnotifier
ii) Shotgun SE Docker v7.4 and later and Flow Production Tracking
sudo docker-compose exec app sg_maintenance_page --enable duration "details"
sudo docker-compose stop emailnotifier
The duration (in minute) and details will be displayed on the maintenance page.
- Do a backup of the database. This can be done directly on your database server or using the
dbops
container.
sudo docker-compose run --rm dbops pg_dump -v -Fd -f ./db_backup/db-shotgrid-$(date +%Y%m%d-%H%M%S)
- Migrate the database.
sudo docker-compose run --rm app rake admin:upgrade
- Start the stopped containers on each server.
i) Shotgun SE Docker v7.3 and earlier
sudo docker-compose up -d
ii) Shotgun SE Docker v7.4 and later and Flow Production Tracking
sudo docker-compose up -d
sudo docker-compose exec app sg_maintenance_page --disable
If the update fails, it is most likely because of a failed migration. If this happens:
- Get the Docker logs from the failed container.
- Restart the app containers with the previous version to get your site back online.
- Contact Autodesk Support by providing the failed migration log.
Update failures
As with any infrastructure operation, updating Flow Production Tracking could go wrong under certain circumstances. The database migration could fail, a server could become unreachable, etc.
A Flow Production Tracking update can be split-up in three phases.
Preparation - Everything that happens before the Flow Production Tracking update.
Container update - During this phase, you load the new container in Docker and modify your orchestration to run the new containers, getting it ready to run the migrations.
Data migration - At this stage, a new container with a new version of Flow Production Tracking is ready to be used. The data still needs to be migrated to match the new code. Multiple migrations can happen during an update step. During the migration step, all migrations are wrapped in a single SQL transaction.
What to do following an update failure depends during which step the failure occurs.
Phase | PSQL Transaction Rollback success | PSQL Transaction Rollback failure |
---|---|---|
Preparation | N/A | N/A |
Container update | N/A | Modify your orchestration to start the old version of Flow Production Tracking again. |
Data migration | The update task will attempt to automatically rollback the single SQL transaction. Your site is left in a functional state, with the data at the version from which the update was attempted. You can continue to use it. | If for any reason the transaction couldn't be rolled back, it is hard to guarantee that the system is in a consistent state. In this case, it is preferable to manually restore the backup taken before the tentative update. First, modify your orchestration to start the old version of Flow Production Tracking again. |
FAQ
Is it possible to downgrade to a previous version?
Flow Production Tracking cannot be downgraded to a previous version after an update. The update Flow Production Tracking operation usually modifies the database schema and data. There is no guarantee that a previous version of Flow Production Tracking will work with a database that has been updated to a prior version.
The only way to downgrade to a previous version is by restoring a database backup that was given for the same version at which you want to restore to.