-- Migration Doctor snapshot, SQL export: installed apps (plugin keys) used to attribute workflow rules to apps. -- Read-only: a single SELECT, no writes, no temporary tables. Output: one JSON object per line. -- Run (read-only) with sqlcmd and save the output as plugins.jsonl. JIRA_SCHEMA is the schema of the -- Jira tables (usually jiraschema, sometimes dbo): -- sqlcmd -S DBHOST -d JIRADB -E -v JIRA_SCHEMA=jiraschema -y 0 -f 65001 -i plugins.sql -o export/plugins.jsonl -- (-E uses Windows authentication; use -U READONLY_USER and let sqlcmd prompt for the password otherwise.) -- Then pass the export directory to the snapshot script: --sql-export-dir export (bash) or -SqlExportDir export (PowerShell). SET NOCOUNT ON; SELECT (SELECT pv.pluginkey AS [key], pv.pluginname AS [name], pv.pluginversion AS [version] FOR JSON PATH, WITHOUT_ARRAY_WRAPPER, INCLUDE_NULL_VALUES) FROM $(JIRA_SCHEMA).pluginversion pv ORDER BY pv.pluginkey;