> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify-poc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrate continuous aggregates

> Migrate your continuous aggregates to the new format introduced in TimescaleDB 2.7

export const CAGG = 'continuous aggregate';

export const TIMESCALE_DB = 'TimescaleDB';

In {TIMESCALE_DB} v2.7 and later, {CAGG}s use a new format that improves performance and makes them
compatible with more SQL queries. {CAGG}s created in older versions of {TIMESCALE_DB}, or created in a new
version with the option `timescaledb.finalized` set to `false`, use the old format.

To migrate a {CAGG} from the old format to the new format, you can use this procedure. It automatically
copies over your data and policies. You can continue to use the {CAGG} while the migration is happening.

Connect to your database and run:

```sql theme={"dark"}
CALL cagg_migrate('<CONTINUOUS_AGGREGATE_NAME>');
```

<Warning>
  There are known issues with `cagg_migrate()` in version 2.8.0. Upgrade to version 2.8.1 or later before
  using it.
</Warning>

## Configure continuous aggregate migration

The migration procedure provides two boolean configuration parameters, `override` and `drop_old`. By
default, the name of your new {CAGG} is the name of your old {CAGG}, with the suffix `_new`.

Set `override` to true to rename your new {CAGG} with the original name. The old {CAGG} is renamed with
the suffix `_old`.

To both rename and drop the old {CAGG} entirely, set both parameters to true. Note that `drop_old` must be
used together with `override`.

## Check on continuous aggregate migration status

To check the progress of the {CAGG} migration, query the migration planning table:

```sql theme={"dark"}
SELECT * FROM _timescaledb_catalog.continuous_agg_migrate_plan_step;
```
