Effects of rolling back an upgrade in Production

Hi @iesmail

The impact is dependent on which versions are upgraded to and then rolled back to, but the biggest concern is data structure rollback.

All schema changes, whatever they might be, are implemented with migrations. We don’t have documenation about migrations (except for them being mentioned as a development step here: Development Workflow | Community Health Toolkit) but you can take a look at the migrations that exist now: cht-core/api/src/migrations at master · medic/cht-core · GitHub

In short, whenever a change in schema (for one document, one type of document or several types of documents) is necessary, this is achieved with a migration. We try to avoid large migrations (ones that affect a large number of documents), but migrations that affect a reasonable amount of documents might exist between versions.

Migrations don’t have rollback algorithms (we don’t develop them).

There’s no guarantee that the previous version of the app will work as expected with the new schema for affected docs. This is not something that we test or support.

Given the distributed nature of data, even if you rollback to a previous snapshot of the database, if any CHW had downloaded migrated docs, those will be synced back up to the main database and potentially cause the same problems as if the server-side data rollback had not even happened.

I don’t believe we have a comprehensive document or statement about the impact of rollbacks.
Maybe we should. What do you think, @gareth?

1 Like