Skip to main content
You can expect the schemas in your AgentOS database tables to be stable across versions. However, in future versions, we may occasionally update or add new columns or tables. To apply migrations, Agno provides two options:
  • Use the migration endpoints: The easiest option. You just need to make a POST request.
  • Migrate manually using the MigrationManager: If you prefer a more controlled migration experience, you can use the MigrationManager class to upgrade or downgrate your schemas.

Using the Migration Endpoints

There are two available endpoints:
  • POST /databases/all/migrate: to migrate all tables in all databases.
  • POST /databases/{db_id}/migrate: to migrate all tables in the given database.
Both endpoints will by default migrate tables to the latest version. You can also specify the version you want to migrate, by setting the target_version query parameter.
The target_version is the Agno version the schema corresponds to.For example, if you have upgraded to Agno v2.3.0, you will want your target version to be 2.3.0.

Migrate manually using the MigrationManager

All migrations are ultimately handled by the MigrationManager class. You can use it directly to have total control over your migration process, or use one of the supporting scripts we provide. You can read more about this in the Database Migrations page.