> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-detect-table-modification.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Resyncing a database ClickPipe

> Doc for resyncing a database ClickPipe

export const Image = ({img, alt, size = "lg"}) => {
  const normalizedSize = ["sm", "md", "lg"].includes(size) ? size : "lg";
  return <div className={`ch-image-${normalizedSize}`}>
      <Frame>
        <img src={img} alt={alt} />
      </Frame>
    </div>;
};

<h3 id="what-mongodb-resync-do">
  What does Resync do?
</h3>

Resync involves the following operations in order:

1. The existing ClickPipe is dropped, and a new "resync" ClickPipe is kicked off. Thus, changes to source table structures will be picked up when you resync.
2. The resync ClickPipe creates (or replaces) a new set of destination tables which have the same names as the original tables except with a `_resync` suffix.
3. Initial load is performed on the `_resync` tables.
4. The `_resync` tables are then swapped with the original tables. Soft deleted rows are transferred from the original tables to the `_resync` tables before the swap.

All the settings of the original ClickPipe are retained in the resync ClickPipe. The statistics of the original ClickPipe are cleared in the UI.

<Note>
  You can resync multiple times, however please account for the load on the source database when you resync,
  since initial load with parallel threads is involved each time.
</Note>

<h3 id="guide-mongodb-resync">
  Resync ClickPipe Guide
</h3>

1. In the Data Sources tab, click on the MongoDB ClickPipe you wish to resync.
2. Head over to the **Settings** tab.
3. Click on the **Resync** button.

<Image img="https://mintcdn.com/private-7c7dfe99-detect-table-modification/nH26ELfEvmC8yX3w/images/integrations/data-ingestion/clickpipes/postgres/resync_button.webp?fit=max&auto=format&n=nH26ELfEvmC8yX3w&q=85&s=8027527ad8bcb35c5cbf75dca032856f" border size="md" width="737" height="205" data-path="images/integrations/data-ingestion/clickpipes/postgres/resync_button.webp" />

4. A dialog box should appear for confirmation. Click on Resync again.
5. Head over to the **Metrics** tab.
6. Wait for the status of the pipe to be **Setup** or **Snapshot**.
7. The initial load of the resync can be monitored in the **Tables** tab - in the **Initial Load Stats** section.
8. Once the initial load is complete, the pipe will atomically swap the `_resync` tables with the original tables. During the swap, the status will be **Resync**.
9. Once the swap is complete, the pipe will enter the **Running** state and perform CDC if enabled.
