Home » Blog » SQL Server » How to Migrate SQL Server 2014 to 2022?

How to Migrate SQL Server 2014 to 2022?

Neeraj Kumar
Published By Neeraj Kumar
Debasish Pramanik
Approved By Debasish Pramanik
Published On
Last Updated

You can migrate SQL Server 2014 to 2022 with four methods. Backup and restore moves databases to a new 2022 server. An in place upgrade needs SQL Server 2014 SP3. Detach and attach moves the data files. Migration software exports objects as SQL scripts for the new instance. Raise the compatibility level to 160 after you test the application.

Microsoft ended support for SQL Server 2014 in July 2024. Many teams now migrate SQL Server 2014 to 2022. SQL Server 2022 receives mainstream support until January 2028.

Most guides show one restore and miss the SP3 rule. Few explain what happens to the compatibility level or how to move objects when a restore is not possible.

This guide explains four methods to move SQL Server 2014 to 2022, with the checks before the move and the tasks after it.

Microsoft lists SQL Server 2014 SP3 as the lowest 2014 source for a direct upgrade in its supported version and edition upgrades article.

Why Migrate SQL Server 2014 to 2022?

Support dates decide the timing. Three facts explain it:

  • Old Instance. SQL Server 2014 extended support ended in July 2024.
  • New Instance. SQL Server 2022 mainstream support ends on 12 January 2028 and extended support ends on 12 January 2033.
  • Compatibility. SQL Server 2022 matches compatibility level 160. An upgraded database needs a separate step to use the newest behavior.

Microsoft states that SQL Server 2022 exists only for 64 bit platforms. A 32 bit instance needs a restore on new hardware.

Which Path Suits Your Setup?

Choose a path by situation:

SituationPath
New server and a long maintenance windowBackup and restore
One server on SP3 and no spare hardwareIn place upgrade
Large data files and a short copy between serversDetach and attach
No restore possible or objects onlySQL script export

Which Checks Come Before You Migrate SQL 2014 to 2022?

Six checks come first:

  1. Find the service pack level with this query:
SELECT SERVERPROPERTY('ProductVersion') AS version,
       SERVERPROPERTY('ProductLevel') AS service_pack;
  1. Confirm that the new server uses a supported operating system and 64 bit SQL Server 2022.
  2. Create backups of your user databases and of the system databases master, model and msdb. Backup scripts for every type sit in the Explore Different Types of Backups in SQL Server guide.
  3. Record the collation of ShopDB and match it on the new server.
  4. List the logins, linked servers and Agent tasks of the application.
  5. Confirm that the new server has free disk space for the data and log files.

4 Ways to Migrate SQL Server 2014 to 2022

Three methods use tools from Microsoft and the fourth adds software for script export.

MethodServerMain limit
Backup and RestoreNew SQL Server 2022 serverLogins and Agent tasks move separately
In Place UpgradeSame serverNeeds SQL Server 2014 SP3
Detach and AttachNew SQL Server 2022 serverDatabase goes offline during the copy
SQL Script ExportNew SQL Server 2022 serverTrial record limit

Method #1: Restore a SQL Server 2014 Backup on 2022 (Free, Easy Rollback)

A backup from SQL Server 2014 restores directly on SQL Server 2022 and the old instance remains online for a return path. Six steps move ShopDB:

  1. Install SQL Server 2022 on the new server.
  2. Backup ShopDB on the 2014 instance:
BACKUP DATABASE ShopDB
TO DISK = N'G:\Migrate\ShopDB.bak'
WITH CHECKSUM, STATS = 10;
  1. Move ShopDB.bak to the new server.
  2. Restore ShopDB with new file paths:
RESTORE DATABASE ShopDB
FROM DISK = N'H:\Migrate\ShopDB.bak'
WITH MOVE N'ShopDB' TO N'H:\Data\ShopDB.mdf',
     MOVE N'ShopDB_log' TO N'I:\Logs\ShopDB_log.ldf',
     STATS = 10;
  1. Add the logins of the 2014 instance to the 2022 instance.
  2. Verify the compatibility level and keep it at 120 until the application passes its tests.

Note: Microsoft states that a backup retains its compatibility level on restore when the level is 100 or higher. SQL Server 2014 databases arrive at level 120. Restore dialogs are explained in Restore a SQL Database From a BAK File.

Method #2: Upgrade in Place With SQL Server 2022 Setup (Free, Needs SP3)

Setup replaces the 2014 engine on the same server and preserves the databases. Microsoft requires SQL Server 2014 SP3 for this path. Eight steps start the upgrade:

  1. Install SQL Server 2014 SP3 when the build is older.
  2. Restart Windows if a restart is pending.
  3. Right click setup.exe on the SQL Server 2022 media and choose Run as administrator.
  4. Open Installation and choose Upgrade from a previous version of SQL Server.
  5. Accept the license and resolve any failed rule on Install Rules.
  6. Choose the 2014 instance on Select Instance.
  7. Review the summary and click Upgrade.
  8. Execute SELECT @@VERSION; in SSMS to confirm version 16.

    Setup cannot add features during an upgrade. Add them afterward with SQL Server 2022 Setup.

Note: Before Setup starts, place the Agent service account in the sysadmin role and enable Windows Authentication for the Agent. Create the backups first because an in place upgrade cannot be undone.

Method #3: Move the Data Files With Detach and Attach (Free, Source Goes Offline)

Detach frees the MDF and LDF files so you can copy them to the SQL Server 2022 server. ShopDB remains offline until you attach it again. Six steps move the files:

  1. Right click ShopDB in Object Explorer and select Tasks and then Detach.
  2. Tick Drop Connections and click OK.
  3. Copy ShopDB.mdf and ShopDB_log.ldf to the new server.
  4. Right click Databases on the 2022 instance and select Attach.
  5. Click Add and select ShopDB.mdf.
  6. Click OK after you confirm the file paths.

Note: Attach upgrades the database to SQL Server 2022 and the upgrade cannot be reversed. Keep the backup that you took before the detach.

Method #4: Export SQL Server 2014 Objects as SQL Scripts With EmailDoctor (Free Preview, Paid Export)

Teams that cannot restore a backup use EmailDoctor SQL Server Data Migration Tool to preview the 2014 objects and export them as scripts. The migration software connects to the live instance and saves SQL Server compatible scripts that you execute in SSMS on the new instance.

Vendor notes list SQL Server versions from 2000 to 2019 and do not name SQL Server 2022. Test the script export with the free trial on one small database before you move production data.

The trial previews every object. Exports in trial stop at 25 records per table and 5 other categories until you buy a license.

Link the Software to the 2014 Server

Five steps open the database and show its objects:

  1. Start the software on a Windows PC that reaches the 2014 instance and click Open. Open button on the home screen
  2. Select Live SQL Server with Authentication in Online mode and add the login details. Login window for the old instance
  3. Select the database from the Drop Down List and click OK. Database list of the 2014 instance
  4. Expand the tree to check tables, views and stored procedures. Preview of the objects
  5. Click Export at the top.

Export the Objects as SQL Scripts

Select SQL Server Compatible SQL Scripts on the export type screen and save the script file.

Export type options

Open the saved file in SSMS, connect to the SQL Server 2022 instance and execute it there.

Note: Offline mode opens an MDF file when the 2014 server is down. Select With Schema & Data when you need rows and not only structure.

Which Tasks Follow a SQL 2014 to 2022 Migration?

Four tasks follow every method.

  1. Create a fresh backup of every moved database.
  2. Refresh the statistics:
USE ShopDB;
EXEC sp_updatestats;
  1. Rebuild full text catalogs where the database has them.
  2. Raise the level once the application tests pass and enable Query Store to catch slow queries:
SELECT name, compatibility_level FROM sys.databases;

ALTER DATABASE ShopDB SET QUERY_STORE = ON;
ALTER DATABASE ShopDB SET COMPATIBILITY_LEVEL = 160;

Level 160 matches SQL Server 2022. You need ALTER permission on the database to set it. Test on a restored copy before production.

Which Problems Stop a SQL 2014 to 2022 Move?

Five problems appear most:

ProblemReasonFix
Setup does not startWindows has a pending restartRestart Windows and open Setup again
Setup does not startWindows Installer service is stoppedStart Windows Installer
2014 instance missing on Select InstanceSource is below SP3 or is 32 bitInstall SP3 or restore on a new 64 bit server
Agent rule failsAgent account is not in the sysadmin roleAdd the account and enable Windows Authentication
New features are missingSetup cannot add features while upgradingAdd features with Setup afterward

Frequently Asked Questions

Can I Migrate SQL Server 2014 to 2022 Directly?

Yes. Microsoft lists SQL Server 2014 SP3 or later as a source for a direct upgrade. Apply the service pack first when your build is older.

Can I Migrate SQL Server 2016 to 2022?

Yes. Microsoft lists SQL Server 2016 SP3 or later for a direct upgrade. The other methods in this guide work the same way.

Can I Migrate SQL Server 2008 to 2022?

Yes. Skip the in place upgrade because Microsoft does not list SQL Server 2008 as an upgrade source. A migration works when the source compatibility level is 90 or higher. Level 90 databases move to level 100 automatically and higher levels stay unchanged.

Will a Restore Update the Compatibility Level?

No. A SQL Server 2014 database retains compatibility level 120 until you raise it with ALTER DATABASE.

Can I Return a Database to SQL Server 2014?

No. An older release cannot attach a database from SQL Server 2022. Restore the pre migration backup.

Can I Migrate a 32 Bit SQL Server 2014 Instance?

Yes. Restore the databases on a new 64 bit instance because Setup cannot convert a 32 bit instance.

Can the Migration Software Handle SQL 2014 to 2022?

Vendor notes list versions up to SQL Server 2019 and omit 2022. Export scripts with the free trial and test them on a 2022 instance before you buy.

Is Every Table Exported in the Trial?

No. Trial exports include 25 records per table and 5 other categories. A license removes the limit.

Author’s Verdict

To migrate SQL 2014 to 2022 with the safest rollback, choose backup and restore because the old server remains unchanged. In place upgrades save hardware but need SP3 and cannot be undone.

Detach and attach suits large files on a local network. Script export fits cases where a restore fails.

Once the application passes its tests, raise the compatibility level to 160 for SQL Server 2022. Save the 2014 backups for a week.

  • Four methods migrate SQL 2014 to 2022.
  • Backup and restore retains the old instance as a rollback.
  • In place needs SQL Server 2014 SP3 and a 64 bit instance.
  • Detach and attach moves the data files.
  • Script export handles objects.
  • Treat compatibility level 160 as a separate step and take a new backup.
  Neeraj Kumar

By Neeraj Kumar

Neeraj Kumar is a Principal Technical Architect at EmailDoctor with 19+ years of experience in email migration, cloud migration, data recovery and digital forensics. He guides enterprise teams through Exchange, Office 365 and Google Workspace projects and shares what works as an EmailDoctor writer. Every method in his posts is tested on Windows and Mac before it goes live.