-- Migration Doctor snapshot, SQL export: workflow descriptors (OSWorkflow XML with transitions, conditions, validators, post functions). -- Read-only: a single SELECT, no writes, no temporary tables. Output: one JSON object per line. -- Run (read-only) with psql and save the output as workflows.jsonl: -- psql -X -q -A -t -v ON_ERROR_STOP=1 -h DBHOST -U READONLY_USER -d JIRADB -f workflows.sql -o export/workflows.jsonl -- If the Jira tables are not in the default search_path, set PGOPTIONS='-c search_path=your_schema' first. -- Then pass the export directory to the snapshot script: --sql-export-dir export (bash) or -SqlExportDir export (PowerShell). SELECT json_build_object( 'name', w.workflowname, 'descriptor', w.descriptor) FROM jiraworkflows w ORDER BY w.workflowname;