<@U04S8PLJWMT> i'm using airbyte version 0.44.5 im...
# ask-ai
h
@kapa.ai i'm using airbyte version 0.44.5 im migrating souces using API and treating it as a incremental sync but i'm unabke to copy the state to treat it as a incremental
k
Based on the knowledge sources, I can see that you're facing a challenge with migrating sources and preserving incremental sync state when using the Airbyte API. According to a [forum discussion about migrating Airbyte config](https://discuss.airbyte.io/t/370), there are limitations when using the API for migration: > "You'd lose your state for incremental streams/have to re-backfill those (as I'm not seeing a way to update connection state via the API)" However, the knowledge sources do indicate that there is a way to handle this. For Airbyte version 0.44.5 and similar versions, you can: 1. Export and Import Configuration: The recommended approach is to export the complete configuration from one instance to another, which includes the state. As mentioned in the forum post, "you can export → import the complete configuration from one instance to another. The only requirement is both instance must have the same version." 2. Manual State Editing (with caution): The knowledge sources show that you can [manually edit connection state](https://docs.airbyte.com/platform/cloud/managing-airbyte-cloud/manage-connection-state) through the UI: - Navigate to Connections → select your connection → Settings tab → Advanced dropdown - The Connection State will be displayed and can be edited However, the documentation includes an important warning: > "Updates to connection state should be handled with extreme care. Updates may break your syncs, requiring a full historical sync of your data to fix. Make changes only as directed by the Airbyte team." Unfortunately, the knowledge sources don't provide specific API endpoints or methods to programmatically update connection state during migration for version 0.44.5. The API limitation mentioned in the forum suggests this functionality may not have been available through the API at that time. For your migration scenario, I recommend using the export/import functionality if both instances are on the same version, as this will preserve the state automatically.
h
@kapa.ai i'm unable to edit the connection state in the 0.44.5 version
k
A message from kapa.ai
Based on the knowledge sources, I can see that the ability to edit connection state through the UI is documented in the [Airbyte documentation](https://docs.airbyte.com/platform/cloud/managing-airbyte-cloud/manage-connection-state), but the knowledge sources don't explicitly mention when this feature was introduced or confirm its availability in version 0.44.5 specifically. Given that you're unable to edit the connection state in version 0.44.5, here are alternative approaches mentioned in the knowledge sources: 1. Using the API (for version 0.40.6+): According to a [forum discussion](https://discuss.airbyte.io/t/2698), you can update the state through the API using the
/api/v1/state/create_or_update
endpoint. Since you're on version 0.44.5, this should be available. Here's an example from the knowledge sources:
Copy code
bash curl -X POST "http://localhost:8000/api/v1/state/create_or_update" \   -H "Accept: application/json" \   -H "Content-Type: application/json" \   -d '{"connectionId":"<your-connection-id>","connectionState":{"stateType":"legacy","connectionId":"<your-connection-id>","state":{"<stream-name>":{"updatedAt":"2022-01-01T16:55:13.217559Z"}}}}'
2. Direct Database Update: For self-hosted instances, you can update the state directly in the PostgreSQL database. According to [forum discussions](https://discuss.airbyte.io/t/393), you can:
Copy code
sql UPDATE state SET state = jsonb_set(state, '{state, streams, 0, cursor}', '"2022-01-25T00:00:00.000000Z"', false) WHERE connection_id = '<your-connection-id>';
Important warnings from the knowledge sources: - Updates to connection state should be handled with extreme care as they may break your syncs - Ensure the cursor format matches exactly what the connector expects (including time precision) If the UI feature is not available in 0.44.5, you may want to consider upgrading to a newer version where this functionality is confirmed to be available.