How To Migrate A SQL Server Database To A Newer Version of SQL Server
How To Migrate A SQL Server Database To A Newer Version of SQL Server
DOWNLOADS (HTTPS://WWW.APEXSQL.COM/DOWNLOAD.ASPX)
®
(https://www.apexsql.com)
PRICES (HTTPS://WWW.APEXSQL.COM/PURCHASE.ASPX)
SUPPORT (HTTPS://SUPPORT.QUEST.COM/)
(https://blog.apexsql.com)
(https://www.apexsql.com/contact/)
(https://shop.quest.com/)
(https://solutioncenter.apexsql.com/)
Solution center
DBAs are well aware that downgrading a SQL Server database cannot be done out of the box. Even when
the compatibility level of the database that needs to be migrated to an older SQL Server version matches
that version, the backup can’t be simply restored. Upgrading can also be a problem.
Restoring a database backup created on a SQL Server 2008 R2 to a SQL Server 2012 instance goes smoothly.
But, if a SQL Server 2000 backup is tried to be restored on a SQL Server 2012, the following error will be
shown:
(/wp-content/uploads/2019/02/c-users-ninja-desktop-apexsql-data-diff-content-w-1.png)
https://solutioncenter.apexsql.com/restore-sql-server-backup-to-a-newer-version-of-sql-server/ 1/21
14/7/2021 How to migrate a SQL Server database to a newer version of SQL Server
The downside of this solution is that there has to be 3 versions of SQL Server installed and the discontinued
or deprecated T-SQL features would have to be manually removed.
If there is no access to the live database from which the backup was taken from:
1. Start SQL Server Management Studio and connect to the instance that contains the database
2. In the database context menu, right-click a desired database and navigate to Tasks => Generate
Scripts:
https://solutioncenter.apexsql.com/restore-sql-server-backup-to-a-newer-version-of-sql-server/ 2/21
14/7/2021 How to migrate a SQL Server database to a newer version of SQL Server
(/wp-content/uploads/2019/02/word-image-143.png)
3. This will invoke the Generate Scripts wizard. In the Introduction step of the wizard, click the Next
button:
https://solutioncenter.apexsql.com/restore-sql-server-backup-to-a-newer-version-of-sql-server/ 3/21
14/7/2021 How to migrate a SQL Server database to a newer version of SQL Server
(/wp-content/uploads/2019/02/word-image-144.png)
4. In the Choose Objects step of the wizard, make sure that the Script entire database and all data‐
base objects option is selected and click the Next button:
https://solutioncenter.apexsql.com/restore-sql-server-backup-to-a-newer-version-of-sql-server/ 4/21
14/7/2021 How to migrate a SQL Server database to a newer version of SQL Server
(/wp-content/uploads/2019/02/word-image-145.png)
b. Specify whether database objects and data will be scripted to a single or multiple files, as well
as the path and encoding of the generated scripts:
https://solutioncenter.apexsql.com/restore-sql-server-backup-to-a-newer-version-of-sql-server/ 5/21
14/7/2021 How to migrate a SQL Server database to a newer version of SQL Server
(/wp-content/uploads/2019/02/word-image-146.png)
In the Script for Server Version option, set SQL Server 2012
In the Types of data to script option, set Schema and data
Set the following options to True:
Script Logins
Script Full-Text Indexes
Script Triggers
Click the OK button
https://solutioncenter.apexsql.com/restore-sql-server-backup-to-a-newer-version-of-sql-server/ 6/21
14/7/2021 How to migrate a SQL Server database to a newer version of SQL Server
(/wp-content/uploads/2019/02/word-image-147.png)
https://solutioncenter.apexsql.com/restore-sql-server-backup-to-a-newer-version-of-sql-server/ 7/21
14/7/2021 How to migrate a SQL Server database to a newer version of SQL Server
(/wp-content/uploads/2019/02/word-image-148.png)
8. In the Save Scripts step of the wizard, click the Finish button:
https://solutioncenter.apexsql.com/restore-sql-server-backup-to-a-newer-version-of-sql-server/ 8/21
14/7/2021 How to migrate a SQL Server database to a newer version of SQL Server
(/wp-content/uploads/2019/02/word-image-149.png)
9. Execute the generated SQL script(s) against the newer SQL instance
If there is no access to the original database for any reason (e.g. migrating a database to an off-site location
with no network connectivity), the procedures above are not applicable.
https://solutioncenter.apexsql.com/restore-sql-server-backup-to-a-newer-version-of-sql-server/ 9/21
14/7/2021 How to migrate a SQL Server database to a newer version of SQL Server
1. On the target SQL instance, create an empty database to hold the data and objects restored from the
backup
(/wp-content/uploads/2019/02/word-image-150.png)
https://solutioncenter.apexsql.com/restore-sql-server-backup-to-a-newer-version-of-sql-server/ 10/21
14/7/2021 How to migrate a SQL Server database to a newer version of SQL Server
(/wp-content/uploads/2019/02/word-image-151.png)
6. Click the Compare button in the bottom-right corner of the New project window
https://solutioncenter.apexsql.com/restore-sql-server-backup-to-a-newer-version-of-sql-server/ 11/21
14/7/2021 How to migrate a SQL Server database to a newer version of SQL Server
(/wp-content/uploads/2019/02/word-image-152.png)
8. Click the Synchronize button in the Actions region of the ribbon’s Home tab:
9. Click the Next button in the Synchronization direction step of the Synchronization wizard:
(/wp-content/uploads/2019/02/word-image-154.png)
https://solutioncenter.apexsql.com/restore-sql-server-backup-to-a-newer-version-of-sql-server/ 12/21
14/7/2021 How to migrate a SQL Server database to a newer version of SQL Server
10. Click the Next button in the Dependencies step of the Synchronization wizard, since all objects will
be synchronized all depended objects are included and this list will be empty:
(/wp-content/uploads/2019/02/word-image-155.png)
11. In the Output options step of the Synchronization wizard, select the Synchronize now action and
click the Next button:
(/wp-content/uploads/2019/02/word-image-156.png)
12. Review the synchronization summary and warnings, if there are any, and click the Synchronize
button:
https://solutioncenter.apexsql.com/restore-sql-server-backup-to-a-newer-version-of-sql-server/ 13/21
14/7/2021 How to migrate a SQL Server database to a newer version of SQL Server
(/wp-content/uploads/2019/02/word-image-157.png)
13. The Results window will be shown upon finished synchronization process:
https://solutioncenter.apexsql.com/restore-sql-server-backup-to-a-newer-version-of-sql-server/ 14/21
14/7/2021 How to migrate a SQL Server database to a newer version of SQL Server
https://solutioncenter.apexsql.com/restore-sql-server-backup-to-a-newer-version-of-sql-server/ 15/21
14/7/2021 How to migrate a SQL Server database to a newer version of SQL Server
(/wp-content/uploads/2019/02/word-image-159.png)
https://solutioncenter.apexsql.com/restore-sql-server-backup-to-a-newer-version-of-sql-server/ 16/21
14/7/2021 How to migrate a SQL Server database to a newer version of SQL Server
(/wp-content/uploads/2019/02/word-image-160.png)
18. Click the Compare button in the bottom-right corner of the New project window
19. In the Results grid, select the database tables the data is to be recovered to:
(/wp-content/uploads/2019/02/word-image-161.png)
20. In the Data difference view panel, select the rows to be recovered:
(/wp-content/uploads/2019/02/word-image-162.png)
21. Click the Synchronize button in the Actions region of the ribbon’s Home tab:
https://solutioncenter.apexsql.com/restore-sql-server-backup-to-a-newer-version-of-sql-server/ 17/21
14/7/2021 How to migrate a SQL Server database to a newer version of SQL Server
22. Click the Next button in the Synchronization direction step of the Synchronization wizard:
(/wp-content/uploads/2019/02/word-image-164.png)
23. In the Output options step of the Synchronization wizard, select the Synchronize now action and
click the Next button:
(/wp-content/uploads/2019/02/word-image-165.png)
24. Review the synchronization summary and warnings, if there are any, and click the Synchronize button:
https://solutioncenter.apexsql.com/restore-sql-server-backup-to-a-newer-version-of-sql-server/ 18/21
14/7/2021 How to migrate a SQL Server database to a newer version of SQL Server
(/wp-content/uploads/2019/02/word-image-166.png)
25. The Results window will be shown upon finished synchronization process:
https://solutioncenter.apexsql.com/restore-sql-server-backup-to-a-newer-version-of-sql-server/ 19/21
14/7/2021 How to migrate a SQL Server database to a newer version of SQL Server
This way, migrating an old version of SQL Server database to a newer version is done via the schema syn‐
chronization of the original database backup and a blank live database first, and data synchronization after‐
wards. ApexSQL Diff (https://www.apexsql.com/sql_tools_diff.aspx) and ApexSQL Data Diff
(https://www.apexsql.com/sql_tools_datadiff.aspx) will take care of all depreciated and discontinued
features.
Related Posts:
1. How to restore a SQL Server database backup to an older version of SQL Server
(https://solutioncenter.apexsql.com/restore-sql-server-database-backup-to-older-version-
of-sql-server/)
2. How to compare and synchronize databases programmatically
(https://solutioncenter.apexsql.com/comparing-and-synchronizing-databases-
programmatically/)
3. SQL Server database continuous integration workflow SYNC step – Creating the
synchronization/migration script (https://solutioncenter.apexsql.com/sql-server-database-
continuous-integration-workflow-sync-step-creating-synchronization-migration-script/)
4. How to automatically compare and synchronize multiple databases on different SQL Server
instances (https://solutioncenter.apexsql.com/how-to-automatically-compare-and-synchro‐
nize-multiple-databases-on-different-sql-server-instances/)
5. How to automatically pull SQL Server database objects from a shared script folder to a local
database (https://solutioncenter.apexsql.com/how-to-automatically-pull-sql-server-data‐
base-objects-from-a-shared-script-folder-to-a-local-database/)
April 4, 2013
Software Sales
https://solutioncenter.apexsql.com/restore-sql-server-backup-to-a-newer-version-of-sql-server/ 20/21
14/7/2021 How to migrate a SQL Server database to a newer version of SQL Server
(https://tv.apexsql.com/)
(https://www.linkedin.com/company/apexsql/)
(https://twitter.com/ApexSQL)
(https://www.facebook.com/ApexSQL)
(https://blog.apexsql.com)
(https://www.apexsql.com/#SubscribeBox)
© 2021 Quest Software Inc. ALL RIGHTS RESERVED. | GDPR (https://www.quest.com/legal/gdpr-hq.aspx) | Terms of Use
(https://www.quest.com/legal) | Privacy (https://www.quest.com/legal/privacy.aspx)
https://solutioncenter.apexsql.com/restore-sql-server-backup-to-a-newer-version-of-sql-server/ 21/21