---
title: "Migrate Database"
method: POST
path: "/databases/{db_id}/migrate"
tags: ["Database"]
---

# Migrate Database

`POST /databases/{db_id}/migrate`

Migrate the given database schema to the given target version. If a target version is not provided, the database will be migrated to the latest version.

## Path parameters

- `db_id` string, required

## Query parameters

- `target_version` string, nullable

## Response `200`

Database migrated successfully

- unknown

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `404` — Database not found
- `422` — Validation Error
- `500` — Failed to migrate database

---

[API](https://skmtc.net/agno/apis/agno-api-reference.md) · [All operations](https://skmtc.net/agno/apis/agno-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/agno/agno-api-reference/revisions/5f6149d395d0/schema)
