<@U04S8PLJWMT> what happen when I change the datab...
# ask-ai
r
@kapa.ai what happen when I change the database of destination after historical sync is complete and also 3 4 increamental sync are completed in old database?
k
Changing the database (or more generally, the destination) after your historical sync and a few incremental syncs is essentially treated as creating a new destination/connection; Airbyte does not automatically move past data or state to the new database. From the docs we have, there are two relevant patterns: 1. Simple change to a new destination/database The knowledge sources do not explicitly describe a “switch database on the same connection” flow. When you point to a new destination (or new schema), that new target will not contain: - Any of the historical data that lives in the old database - The connection state that tells incremental syncs where to resume If you just change to a new database and start syncing without any extra steps, Airbyte will behave like a fresh setup: it will (re)sync all data according to your sync mode (full refresh or incremental), and all previous incremental updates already written to the old database will remain only in the old database. The docs emphasize that when switching destinations/versions, historical data may need to be “re-imported.” [[Quick start](https://docs.airbyte.com/release_notes/upgrading_to_destinations_v2#quick-start-to-upgrading)] 2. “Dual writing” / parallel destination pattern (recommended when changing destinations) The docs describe a controlled pattern called dual writing when you want to migrate or change destinations without losing history or re-syncing everything unnecessarily: [[Dual writing](https://docs.airbyte.com/release_notes/upgrading_to_destinations_v2#upgrading-connections-one-by-one-with-dual-writing)] High level: - Create a new destination pointing to the new database (and typically a new schema to avoid collisions). - Create a new connection from the same source to this new destination, mirroring the settings of the old connection. - For full refresh streams, just enable the new connection; you’ll get a parallel copy of all data in the new database. - For incremental streams, before enabling: 1. Copy historical raw data from the old destination’s schema to the new destination’s schema (for each incremental stream), so you don’t lose history already in the old DB. 2. Copy the connection state from the old connection’s Advanced Settings and paste it into the new connection’s state, then click Update State. 3. Enable the new connection; it will now continue incremental syncs from where the old one left off, but writing into the new database. - Once you’ve validated the new tables, you can switch your dashboards to use them and then pause/retire the old connection. So, if you “just change the database” on an existing destination/connection with 3–4 completed incremental syncs, the docs do not guarantee that those prior increments are carried over. To preserve history and resume incremental syncs correctly in the new database, you should follow the dual-writing pattern: copy over historical raw data and replicate the connection state into a new connection that points to the new database. [[Dual writing](https://docs.airbyte.com/release_notes/upgrading_to_destinations_v2#upgrading-connections-one-by-one-with-dual-writing)]