> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getcollate.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Upgrade prerequisites

## Prerequisites

Everytime that you plan on upgrading Collate to a newer version, make sure to go over all these steps:

### Backup your Metadata

Before upgrading your Collate version we strongly recommend backing up the metadata.

The source of truth is stored in the underlying database (MySQL and Postgres supported). During each version upgrade there
is a database migration process that needs to run. It will directly attack your database and update the shape of the
data to the newest Collate release.

It is important that we backup the data because if we face any unexpected issues during the upgrade process,
you will be able to get back to the previous version without any loss.

> [!TIP]
>
> **Tip**: You can learn more about how the migration process works [here](https://docs.getcollate.io/deployment/upgrade/how-does-it-work).
>
> **During the upgrade, please note that the backup is only for safety and should not be used to restore data to a higher version**.

Since version 1.4.0, **Collate encourages using the builtin-tools for creating logical backups of the metadata**:

* [mysqldump](https://dev.mysql.com/doc/refman/8.0/en/mysqldump.html) for MySQL
* [pg\_dump](https://www.postgresql.org/docs/current/app-pgdump.html) for Postgres

For PROD deployment we recommend users to rely on cloud services for their databases, be it [AWS RDS](https://docs.aws.amazon.com/rds/),
[Azure SQL](https://azure.microsoft.com/en-in/products/azure-sql/database) or [GCP Cloud SQL](https://cloud.google.com/sql/).

If you're a user of these services, you can leverage their backup capabilities directly:

* [Creating a DB snapshot in AWS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CreateSnapshot.html)
* [Backup and restore in Azure MySQL](https://learn.microsoft.com/en-us/azure/mysql/single-server/concepts-backup)
* [About GCP Cloud SQL backup](https://cloud.google.com/sql/docs/mysql/backup-recovery/backups)

You can refer to the following guide to get more details about the backup and restore:

> [card] [Backup Metadata](https://docs.getcollate.io/deployment/backup-restore-metadata)
>
> Learn how to back up MySQL or Postgres data.

### Understanding the "Running" State in Collate

In Collate, the **"Running"** state indicates that the Collate server has received a response from Airflow confirming that a workflow is in progress. However, if Airflow unexpectedly stops or crashes before it can send a failure status update through the **Failure Callback**, Collate remains unaware of the workflow’s actual state. As a result, the workflow may appear to be stuck in **"Running"** even though it is no longer executing.

This situation can also occur during a Collate upgrade. If an ingestion pipeline was running at the time of the upgrade and the process caused Airflow to shut down, Collate would not receive any further updates from Airflow. Consequently, the pipeline status remains **"Running"** indefinitely.

![Running State in Collate](https://mintcdn.com/collatedocs/wwtXdk45pV9o-D6V/public/images/deployment/upgrade/running-state-in-openmetadata.png?fit=max\&auto=format\&n=wwtXdk45pV9o-D6V\&q=85\&s=7a2665d61139f9023f674f6426471512)

### Expected Steps to Resolve

To resolve this issue:

* Ensure that Airflow is restarted properly after an unexpected shutdown.
* Manually update the pipeline status if necessary.
* Check Airflow logs to verify if the DAG execution was interrupted.

#### Update `sort_buffer_size` (MySQL) or `work_mem` (Postgres)

Before running the migrations, it is important to update these parameters to ensure there are no runtime errors.
A safe value would be setting them to 20MB.

**If using MySQL**

You can update it via SQL (note that it will reset after the server restarts):

```sql theme={null}
SET GLOBAL sort_buffer_size = 20971520
```

To make the configuration persistent, you'd need to navigate to your MySQL Server install directory and update the
`my.ini` or `my.cnf` [files](https://dev.mysql.com/doc/refman/8.0/en/option-files.html) with `sort_buffer_size = 20971520`.

If using RDS, you will need to update your instance's [Parameter Group](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithParamGroups.html)
to include the above change.

**If using Postgres**

You can update it via SQL (not that it will reset after the server restarts):

```sql theme={null}
SET work_mem = '20MB';
```

To make the configuration persistent, you'll need to update the `postgresql.conf` [file](https://www.postgresql.org/docs/9.3/config-setting.html)
with `work_mem = 20MB`.

If using RDS, you will need to update your instance's [Parameter Group](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithParamGroups.html)
to include the above change.

Note that this value would depend on the size of your `query_entity` table. If you still see `Out of Sort Memory Error`s
during the migration after bumping this value, you can increase them further.

After the migration is finished, you can revert this changes.

## Backward Incompatible Changes

### 2.1.0

#### MySQL Database and Flowable Tables Convert to utf8mb4

When you upgrade a MySQL deployment, the migration sets the Collate database character set to `utf8mb4` with the `utf8mb4_0900_ai_ci` collation. It also converts the Flowable workflow tables (the `ACT_*` tables) that use a different character set or collation. Tables that already match aren't changed. The migration temporarily turns off foreign key checks for its session while it converts tables, and then restores the original setting.

Before you upgrade, check the following:

* **MySQL version**: The `utf8mb4_0900_ai_ci` collation is available in MySQL 8.0 and later.
* **Database user**: The user that runs the migration needs privileges to alter the database and its tables.
* **Duration**: Converting large Flowable tables can lengthen the upgrade.

This applies to MySQL only. Postgres deployments aren't affected.

#### Metadata That 2.0.x Ingestion Removed Is Restored

If you upgrade from a release earlier than 2.0.5, the migration restores descriptions, display names, table constraints, retention periods, and tags (including Tier tags) that 2.0.x ingestion removed. Each restore creates a new version of the entity, so the version history of affected assets grows. The migration logs and skips any entity it can't restore, so a failure doesn't stop the upgrade.

### 2.0.0

#### Great Expectations requires version 1.3 or later

The validation action now requires **Great Expectations 1.3 or later**. Collate 2.0 drops support for the 0.18 line, and
`openmetadata-ingestion[great-expectations]` now installs `great-expectations~=1.3`. The separate `great-expectations-1xx`
extra no longer exists.

If you adopted the interim GX 1.x module, rename it in your checkpoint. `metadata.great_expectations.action1xx` and
`OpenMetadataValidationAction1xx` have been removed:

```python theme={null}
# Before
from metadata.great_expectations.action1xx import OpenMetadataValidationAction1xx

# After
from metadata.great_expectations.action import OpenMetadataValidationAction
```

Checkpoints that already reference `metadata.great_expectations.action` and `OpenMetadataValidationAction` keep those
names. The surrounding checkpoint definition still has to move to the GX 1.x API. Pass actions as objects to
`Checkpoint(actions=[...])` rather than as an `action_list` of dictionaries, and call `checkpoint.run()` instead of
`great_expectations checkpoint run`. See the [Great Expectations](https://docs.getcollate.io/ai-2-0/how-to-guides/guide-for-data-users/ingestion/great-expectations.md) guide for
the updated configuration.

#### Great Expectations test results report counts instead of percentages

Test case results now report row counts only: `unexpected_count`, `missing_count`, `element_count`, and
`observed_value`. The percentage values (`unexpected_percent`, `unexpected_percent_total`, `missing_percent`, and
`success_rate`) are no longer sent, because Collate charts every result value of a test case on a single axis and
percentages plotted next to row counts were flattened into the baseline. Percentages remain derivable as
`unexpected_count / element_count`.

Existing test cases keep their historical percentage series until those data points age out of the chart window.

### 1.9.0

#### Strong validation of test case parameters

`parameterValues` name of a testCase will be strongly validated against the name of the `parameterDefinition` in the testDefinition.
If both parameter names do not match an error will be thrown on testCase creation

#### Multi-domain Support

**All entities now support multi-domains**. Their `domain` field is now renamed to `domains` and modelled as a list of domains instead of a single domain.

If you're using the API or the SDK, you will need to update your code to use the new `domains` field instead of `domain`.
We have also updated the `patch_domain` implementation, which now has a new signature to support the new `domains` field.

> [!TIP]
>
> **Tip**: While the schema and APIs are all updated, the Multi-domain support is not enabled by default.
>
> If you want to allow your assets to belong to multiple domains, you need to go to **Settings** > **Preferences** > **Data Asset Rules** and disable the `Multiple Domains are not allowed` rule.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.