Data migration from SQL Server 2005 to SQL Server 2022

pmscorca 1,007 Reputation points
2024-11-19T14:57:03.6433333+00:00

Hi,

I need to check if it is possible to migrate data from a SQL Server 2005 database to a SQL Server 2022 one.

I'm using SQL Server 2022 and it seems that it isn't possible to work with a compatibility level equals to 90 and so I think that it isn't possible to execute a backup operation in SQL Server 2005 and the next restore operation in SQL Server 2022.

Any suggests to me in order to solve a such issue? Thanks

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,147 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Ki-lianK-7341 500 Reputation points
    2024-11-19T14:58:55.71+00:00

    Sure! Here are the steps in brief:

    1. Intermediate Upgrade: Upgrade your SQL Server 2005 database to SQL Server 2008 or 2012 first.
    2. Backup and Restore: Take a backup from the intermediate version and restore it on SQL Server 2022.
    3. Data Migration Assistant (DMA): Use DMA to assess and assist with the migration.

  2. Erland Sommarskog 113.5K Reputation points MVP
    2024-11-19T22:18:18.48+00:00

    You can backup the database in SQL 2005 and restore the database on SQL 2022, without any intermediate steps as Kilian suggests. You are correct that there is no compatibility level 90 in SQL 2022, so the compat level will be set to 100, which is the lowest one available.

    I see little reason to copy the data in any other way.

    0 comments No comments

  3. ZoeHui-MSFT 38,621 Reputation points
    2024-11-20T01:44:40.39+00:00

    Hi @pmscorca,

    You can migrate databases from older versions of SQL Server to SQL Server 2022 (16.x), as long as the source database compatibility level is 90 or higher. Databases with a compatibility level of 90 (for example, on SQL Server 2005 (9.x)), are automatically upgraded to a compatibility level of 100 when migrated to SQL Server 2022 (16.x). If the compatibility level on the source database is 100 or higher, it is unchanged on SQL Server 2022 (16.x).

    See Supported version and edition upgrades (SQL Server 2022)

    Regards,

    Zoe Hui


    If the answer is helpful, please click "Accept Answer" and upvote it.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.