<@U04SE163WC8> in OSS after creating source, desti...
# ask-ai
k
@kapa.ai in OSS after creating source, destination (postgres), and connection.. and initial sync is already done... can I move the destination/target db to another host?
u
Yes, you can move the destination/target database to another host. However, you will need to update the destination settings in Airbyte to reflect the new host details. Here are the steps you need to follow: 1. In the left navigation bar, click Destinations. 2. Find the destination you want to update and click on it. 3. On the Set up the destination page, update the Host, Port, and DB Name fields with the new hostname, port number, and name for your Postgres database. 4. Click Save Changes. Please note that the schema names are case sensitive. The 'public' schema is set by default. Multiple schemas may be used at one time. No schemas set explicitly - will sync all of existing. For User and Password, enter the username and password for your Postgres database on the new host. Remember to test the connection after updating the details to ensure that Airbyte can connect to the new host. Here is the relevant [documentation](https://docs.airbyte.com/integrations/destinations/postgres#naming-conventions) for more details.
k
it mean the database also need to be predefined in the target host? @kapa.ai
u
A message from kapa.ai
u
Yes, the database needs to be predefined in the target host. When setting up a destination in Airbyte, you need to provide the name of the database in the destination configuration. This database should already exist on the database server. Additionally, the user specified in the destination configuration should have the necessary permissions on the database. These permissions typically include the ability to create tables and write rows. For example, when setting up a [Postgres destination](https://docs.airbyte.com/integrations/destinations/postgres#naming-conventions), you need to provide the Host, Port, DB Name, User, and Password. The DB Name should be the name of an existing database on the Postgres server, and the User should have the necessary permissions on this database. Similarly, when setting up a [MSSQL destination](https://docs.airbyte.com/integrations/destinations/mssql#setup-the-mssql-destination-in-airbyte), you need to provide the Host, Port, Username, Password, Schema, and Database. The Database should exist within the schema provided, and the Username should have the necessary permissions on this database. Please refer to the relevant documentation for the specific destination you are setting up for more details.
k
Assuming everything is ready, and I already migrated data from current database (data from initial sync). When I already moved the database to new host, when the sync start, will it do another full sync again? @kapa.ai
u
A message from kapa.ai
u
When you move your database to a new host, Airbyte will not automatically perform a full refresh sync. The type of sync that Airbyte performs depends on the sync mode that you have configured for your connection. If you have configured your connection to use the CDC (Change Data Capture) incremental mode, Airbyte will continue to perform incremental syncs after the initial full refresh sync. This means that only the new or updated data will be synced to the new host. However, under certain circumstances, such as when the write-ahead logs (WALs) needed for the incremental sync have been removed by Postgres, Airbyte may perform a full refresh sync. You can find more details about this in the [Postgres troubleshooting guide](https://docs.airbyte.com/integrations/sources/postgres/postgres-troubleshooting#under-cdc-incremental-mode-there-are-still-full-refresh-syncs). If you have configured your connection to use the Full Refresh - Overwrite sync mode, Airbyte will perform a full refresh sync every time a sync is triggered. This means that all the data will be synced to the new host, and the existing data in the destination will be overwritten. You can find more details about this in the [Full Refresh - Overwrite + Deduped guide](https://docs.airbyte.com/using-airbyte/core-concepts/sync-modes/full-refresh-overwrite-deduped#destination-specific-mechanism-for-full-refresh). If you want to ensure that Airbyte performs a full refresh sync after moving your database to a new host, you can manually trigger a full refresh sync from the Airbyte UI.
k
where can I find write-ahead logs (WALs) @kapa.ai
u
A message from kapa.ai
u
Write-ahead logs (WALs) are a feature of the database system you are using. In the context of PostgreSQL, which is mentioned in the knowledge sources, WALs are used to record changes made to the database. The location of the WAL files depends on your PostgreSQL configuration. The
pg_wal
directory within the data directory of your PostgreSQL installation typically contains the WAL files. However, this can vary based on your specific setup and configuration. You can determine the location of the PostgreSQL data directory by running the following SQL command in your PostgreSQL environment:
Copy code
sql SHOW data_directory;
This will return the path to the data directory. The
pg_wal
directory within this directory is where the WAL files are stored. Please note that accessing and manipulating WAL files should be done with caution and typically only for advanced use cases, as improper handling can lead to data loss or corruption. For more information on WALs in PostgreSQL, you can refer to the [official PostgreSQL documentation](https://www.postgresql.org/docs/current/wal-intro.html).