In order to implement Incremental Sync, Syncmaven need to persist state between sync runs. State also can be used by connectors internally to cache some data for optimization purposes.

State is always optional, and syncs can work without it. You can run every sync in a full refresh mode, which means state will be ignored. Also, you can not provide state at all.

The internal structure of state can be found on Protocol page.

Syncmaven provides a several ways to store state

Local files

By default, Syncmaven stores state in bunch of local files in <project-dir>/.state directory. This is convenient for local debugging.

To change the default location, you can use --state <dir> option with sync command.

However, to preserve state between different machines, the other options should be used.

Postgres

Syncmaven can store state in Postgres database. To enable this, you need to provide a connection string to the database. Provide the connection string using --state postgres://<user>:<password>@<host>:<port>/<database> option with sync command.