Migration Dashboard
SQL Server 2016 Enterprise to 2022 Enterprise - interactive runbook with discovery, cutover, validation, and rollback scripts.
.xlsx workbook (Open XML) that Excel opens natively.
Progress checkboxes in this HTML are included as Done = Y/N.
Why migrate off SQL Server 2016?
SQL Server 2016 reached end of extended support on July 14, 2026. After that date Microsoft no longer provides security updates, cumulative updates, or standard product support for 2016. Continuing to run unsupported database engines is a business, compliance, and operational risk - not just a technical preference.
- No security patches - newly discovered CVEs will not be fixed on 2016; exposed instances become permanent attack targets.
- Compliance / audit failure - many frameworks (ISO, SOC2, PCI, HIPAA, internal IT policy) require supported platforms; auditors flag EOL databases.
- No Microsoft support for Sev-A incidents - production outages may leave you without vendor escalation paths.
- Insurance and cyber coverage risk - some policies limit payouts when known-unsupported software is in use.
- Vendor / application pressure - ISVs certify newer SQL versions only; delayed migration blocks app upgrades.
- Skills and tooling decay - monitoring, drivers, and SSMS features increasingly assume 2019/2022+.
Migration strategy - choose based on risk, downtime, and rollback needs
Do not pick a method only because it is popular. Match the approach to RTO/RPO, database size, HA topology, application certification, and how easily you must roll back. Microsoft supports a direct upgrade path from SQL Server 2016 SP3+ to 2022, but production teams often prefer side-by-side for safer rollback.
A. Side-by-side + backup/restore
- Build new Windows + SQL 2022; restore databases; rematch logins.
- Best for: most Enterprise production when downtime window is acceptable.
- Rollback: point apps back to 2016 instance.
B. Side-by-side + log shipping
- Keep 2022 secondary applying log backups until cutover.
- Best for: large databases needing short cutover.
- Rollback: leave 2016 primary authoritative if go-live fails.
C. Always On AG migration
- Add 2022 replicas / rebuild AG; failover listener at cutover.
- Best for: existing AG estates that must stay highly available.
- Requires careful WSFC/endpoint/listener redesign on 2022.
D. In-place upgrade
- Setup upgrades the same instance (requires 2016 SP3+).
- Best for: non-prod, small systems, strict hardware reuse.
- Rollback is not supported by setup - rely on VM snapshot / rebuild.
E. Replication / CDC sync cutover
- Stream changes to 2022; cut over when lag is inside SLA.
- Best for: very large DBs or selective database migration.
- Higher operational complexity; validate identity and DDL carefully.
F. Azure MI Link / hybrid migrate
- Use Managed Instance link or DMA-style migrate for cloud DR/exit.
- Best for: hybrid strategy or future Azure landing zone.
- Still requires driver, cert, and app certification work.
How to decide: If rollback must be fast and you can build new hardware/VMs, prefer A or B. If you already run Always On and need near-zero downtime, evaluate C. Use D only when downtime is approved and a tested full-instance restore/snapshot exists. Use E/F for scale or cloud goals after a successful UAT. Full plan: sql_server/docs/sql_2016_to_2022_migration_plan.md.
Key Changes That May Affect Migration (2016 to 2022)
Click a row to expand. Blue underlined script names are clickable links (open SQL in viewer). Tags: Blocker must fix before/at cutover Behavior plan/CE risk Feature optional adopt Ops config/HA
RAISERROR with formatting still works (prefer THROW for new code).
What is discontinued: ActiveX Agent steps, PolyBase Hadoop, Stretch DB.
- ActiveX Scripting SQL Agent job steps — convert to CmdExec or PowerShell (not T-SQL steps).
- PolyBase Hadoop/HDFS external data sources — recreate with S3/Azure/supported connectors.
- Stretch Database — unstretch before migration.
- SQL Agent T-SQL job steps — still fully supported.
- Remote admin connections / DAC — still available (
sp_configure 'remote admin connections'). - RAISERROR printf-style formatting — still works; Microsoft prefers
THROWfor new development.
- Cardinality Estimator / plans when raising compat (130→150/160).
- TempDB metadata concurrency (evaluate memory-optimized TempDB metadata).
- Batch mode on rowstore / memory grants under newer compat + IQP.
- String truncation / ANSI_WARNINGS — apps relying on silent truncation can fail.
- TRUSTWORTHY / cross-db chaining — still supported; treat as security review, not automatic break.
- Trace flags — re-validate; many legacy flags are obsolete on 2022.
- New database / catalog collation choices at install (UTF-8 options).
- Monitoring — old agents may use deprecated DMVs → upgrade to SQL 2022-supported build.
- Backup software — may not understand 2022 backup formats → vendor-check + prove restore on UAT.
- ORM frameworks — may emit deprecated SQL → upgrade ORM and regression-test generated queries.
- SSIS 2016 — SNAC/connection issues → upgrade SSIS to 2022; update connection managers to ODBC 18 / OLE DB 19.
- Replication to older versions — not a durable topology → upgrade/re-home subscribers before 2022 publisher cutover.
- Linked servers to 2008/2012 — TLS/provider issues → OLE DB 19 / ODBC 18 updates and explicit UAT tests (or retire links).
- Complete matrix in P0-05; inventories in P1-20..P1-24; prove in P4-09..P4-11.
- Related scripts: 09_linked_servers_and_jobs.sql 06_ha_dr_topology.sql 14_backup_chain_verification.sql
- Inventory linked servers and SSIS connection managers for SQLNCLI / SQLOLEDB.
- Replace with Microsoft ODBC Driver 18 or OLE DB Driver 19 on all app/ETL tiers.
- Recreate linked servers with the new provider; retest TLS 1.2+ connectivity.
- Script: 09_linked_servers_and_jobs.sql
- Scan for
is_remote_data_archive_enabledtables before migration. - Unstretch / migrate remote data back to local tables; drop Stretch config.
- Re-validate table sizes and backup windows after unstretch.
- Script: 11_stretch_database_check.sql
- List external data sources / tables of type Hadoop.
- Recreate external data sources with supported connectors (S3-compatible, Azure, Oracle, etc.).
- Rebuild dependent external tables and refresh SSIS/ETL packages.
- Script: 12_polybase_hadoop_check.sql
- Cut over at current compat (usually 130) and hold 7-14 days (Option A backout) unless UAT signed off higher.
- Enable Query Store first, baseline, then stage 140/150, then 160.
- For confirmed CE regressions: temporary
LEGACY_CARDINALITY_ESTIMATION = ON(database scoped) while remediating. - You cannot restore a 2022 database back to 2016 — prefer compat/scoped-config rollback over physical failback.
- Scripts: 19_query_store_enable_and_status.sql 20_compatibility_level_report.sql 21_rollback_evidence_capture.sql
- Never run production on RTM-only — install the latest CU before UAT and cutover.
- Do not enable all IQP features on day one in prod without UAT.
- After Query Store baseline and compat raise, evaluate
DOP_FEEDBACK/ plan forcing carefully. - Watch for sudden plan flips on parameterized queries (PSP); capture scoped configs with evidence script.
- Related scripts: 19_query_store_enable_and_status.sql 21_rollback_evidence_capture.sql
- Explicitly enable Query Store (READ_WRITE) on all migrated user databases before compat changes.
- Size capture policy appropriately (AUTO or CUSTOM) to control overhead.
- Use Query Store for day-1 regression detection and rollback of bad plans.
- Script: 19_query_store_enable_and_status.sql
- Test connectivity from every app tier with modern drivers before cutover.
- Confirm TLS 1.2+ enabled end-to-end; document any forced encryption settings.
- Coordinate with network/security if SSL inspection is in path.
- Related discovery: 01_instance_version_and_patch.sql 09_linked_servers_and_jobs.sql
- Backup Service Master Key and all TDE certificates + private keys before cutover; store offline.
- Restore certs on TARGET before restoring encrypted databases.
- Verify encryption state and recent private-key backups post-restore.
- Scripts: 23_tde_certificate_inventory.sql 05_database_features_tde_cdc.sql
- Export logins with matching SIDs (sp_help_revlogin / DBATools) before cutover.
- Run orphaned-user scan on TARGET; apply
ALTER USER ... WITH LOGINafter review. - Re-validate job owners, proxies, and linked-server logins.
- Scripts: 07_logins_and_server_roles.sql 08_orphaned_users_precheck.sql
- Inventory AG/mirroring/log shipping/replication on SOURCE.
- Rebuild endpoints, listeners, seeding, and jobs on 2022 WSFC/AG.
- Validate sync health and RPO before and after cutover.
- Scripts: 06_ha_dr_topology.sql 22_ag_health_check.sql
- Plan PVS capacity before enable — in the primary filegroup or redirected to a dedicated filegroup.
- Optional post-migration enable per database after validating disk for PVS growth.
- Monitor version store size and cleanup; do not enable blindly on all DBs day one.
- Useful for databases with long-running transactions or slow recovery times.
- Post-cutover health: 18_post_migration_validation.sql
- Pre-size TempDB with equal files (often up to 8, then multiples of 4); avoid tiny autogrowth.
- On 2022, evaluate
MEMORY_OPTIMIZED TEMPDB_METADATA = ON(restart required) for latch-heavy workloads. - Grant Perform volume maintenance tasks (IFI) to SQL service account.
- Monitor
dm_db_log_infoand TempDB waits after cutover. - Scripts: 02_server_configuration.sql 15_post_install_config_audit.sql
- Re-baseline max memory (leave headroom for OS), MAXDOP, and CTFP for the new host.
- Document Delayed Start behavior in DR/runbooks.
- Retest every startup trace flag; remove obsolete ones.
- Scripts: 02_server_configuration.sql 03_trace_flags_documentation.sql 15_post_install_config_audit.sql
sp_execute_external_script workloads break until runtimes are installed separately.- Inventory external script usage on SOURCE before migration.
- Install SQL Server 2022 Machine Learning Services + required packages on TARGET.
- Retest all R/Python/Java jobs in UAT.
- Readiness scan: 13_pre_migration_readiness.sql 10_deprecated_features_usage.sql
- Script publications, subscriptions, CDC capture/cleanup jobs, and CT settings from SOURCE.
- Rebuild on TARGET; validate lag vs SLA before declaring go-live.
- Scripts: 05_database_features_tde_cdc.sql 09_linked_servers_and_jobs.sql
- Optional: redesign backup targets to S3-compatible storage after cutover is stable.
- Do not change backup strategy on cutover night unless pre-tested.
- Always verify first full backup + restore test on 2022.
- Script: 14_backup_chain_verification.sql
- Do not require these for cutover success; adopt after stabilization.
- If Always Encrypted enclaves are already in use, validate host/driver versions on 2022.
- Plan least-privilege role cleanup after go-live (reduce sprawling sysadmin).
- Baseline security inventory: 07_logins_and_server_roles.sql 02_server_configuration.sql
Rollback Decision Tree
Use after evidence capture (21_rollback_evidence_capture.sql). Prefer Option A (compat / scoped config) before connection or physical failback. You cannot restore a 2022 database to 2016.
Quick Links - Post-Migration Troubleshooting
Click any link to open the embedded SQL in the script viewer (works offline from this HTML / unzipped package).
- Prod_Migration/01_Quick_Triage/00_RUN_FIRST_triage_playbook.sql — start here for incidents
- Prod_Migration/02_Upgrade_Validation/04_complete_post_upgrade_configuration_report.sql — day-1 config report
- Prod_Migration/06_Optimizer_Plans/03_query_store_regression.sql — plan regressions
- Prod_Migration/04_Wait_Stats/02_post_migration_wait_decoder.sql — wait decoder
- Prod_Migration/05_Concurrency/01_blocking_and_locks.sql — blocking
- Prod_Migration/07_Instance_Config/01_post_migration_config_audit.sql — config audit
- Prod_Migration/MASTER_INDEX.sql — full triage index
📋 Initiation
🔍 Discovery
🛠 Target Design
🚀 Build Target
🔬 UAT Pilot
📝 Prod Prep
⚡ Cutover
📈 Stabilization
⏪ Rollback
Script Library
All scripts are embedded in this HTML. Click a name to view/copy. Loose .sql files are also in the zip under scripts/ for SSMS.