- Connect to PG
- Begin a TX
- Create a snapshot name:
SELECT pg_export_snapshot(); - Get the LSN
SELECT pg_current_wal_lsn(); - PGDump it
pg_dump --snapshot=_snapshotname - Commit the TX
- Import it https://github.com/scratchmex/pgdump2sqlite?tab=readme-ov-file
- Start logical replication @ the LSN
Could do all the copies in a TX and report the SNAPSHOT name as well as WAL LSN so we can resume replication after importing the export.