---
search:
  tags:
    - database-services
    - POST
seo:
  description: >-
    Removes the files of the earlier… Reference for the POST
    /api/v1/database-services/{id}/major-upgrade/cleanup endpoint in the
    TimescaleDB Enterprise API.
  noindex: true
sidebar:
  label: Clean up a major upgrade
  badge: POST
title: Clean up a major upgrade
type: openapi-operation
---
Removes the files of the earlier major after a major upgrade (ADR 2026-10-22 P4): the old data directory (in Link mode the two directories share the data files, so this frees only the old catalog and WAL; in Copy mode the full data directory; in Swap mode the files that pg_upgrade left), the old configuration, the tsdbe files and the packages of the old major, and its entry in the Debian minor pin. The service keeps running. The workflow is upgrade_major_cleanup. 409 until a full backup of the new major succeeds, and when the servers have no files of an earlier major.

`POST /api/v1/database-services/{id}/major-upgrade/cleanup`

**Responses**

- `202` — Accepted
- `default` — Error

Response example, 202:

```json
{
  "workflow_id": "string"
}
```
