What you need
You need SPSync installed, which we do with you on a call (book one), and a
Postgres database you can create tables in. Any reasonably current Postgres works,
self-hosted or managed. If you are not a tenant admin yourself, read the
admin permissions guide first: delegated sign-in covers the
sites you can already see, and an admin can grant Sites.Selected on specific sites for
unattended runs.
Six steps to a replicated table
- Sign in. Open the desktop app, or run
spsync auth login, and authenticate with your Microsoft account. Delegated access is enough for a first run. - Choose the list. Search for the site, then tick the list. Tick the lists its lookup columns point to as well, or those lookups will have nothing to join to.
- Point at Postgres. Put a connection string such as
postgresql://user:password@host:5432/database?sslmode=requirein an environment variable and name that variable as the destination. The string itself never goes in the configuration file. - Run the first sync. The first run creates the schema and loads every item. Each list
becomes a table named
{prefix}_{list}, keyed onsp_item_id. A lookup arrives as{col}_idand{col}_value, a person column as{col}_user_idpointing at the sharedsp_userstable, and a multi-value column as its own{table}__{col}child table. - Check the result. Query the table from
psqlor any SQL client, and compare its row count with the list. Deleted items will appear later as rows withsp_deleted_atset. - Set the schedule. The desktop app runs every five minutes by default. From the CLI,
run
spsync runfrom cron, Task Scheduler or a CI pipeline. Either way, runs after the first read only what changed, and a reconcile, weekly by default, checks the table against SharePoint.
After the first run
How long the first run takes depends on the size of the list; later runs are quick. The schema reference lists every column type mapping, and the PostgreSQL destination page covers hosted Postgres options.