Upgrade the database major version by migrating data Stay organized with collections Save and categorize content based on your preferences.
This page describes how to migrate your data to an instance running a laterversion of SQL Server. Before proceeding with this method, considerupgrading the database major version in-place.
Plan a major version upgrade
Choose a target major version and edition.
Consider the features offered in each SQL Server version and addressincompatibilities.
New major versions introduce incompatible changes that might require you tomodify the application code, the schema, or the database settings beforeyou can upgrade your database instance. Review the release notes of yourtarget major version to determine the incompatibilities that you need toaddress. If you're skipping major versions, address the incompatibilitieslisted for each version that you're skipping.
Test the upgrade with a dry run.
Perform a dry run of the end-to-end upgrade process with a test instancebefore you upgrade the production database. You might want to test the upgradeusing acloneinstead of your production database to avoid any performance impact from theexport on your production workload.
In addition to validating that the upgrade completes successfully, runtests to understand the expected downtime of the upgrade, confirm yourupgrade workflow, and ensure that the application behaves as expected on the upgradeddatabase. If you haven't enabledautomatic storage increases,take note of the disk storage used by the upgraded dry run instance todetermine whether you need to increase the storage capacity for theproduction instance before upgrading.
Decide when you want to upgrade.
Note: Upgrades require the instance to become unavailable for a period oftime. Be sure to schedule your upgrade when database activity is low.
Migrate your data
Migrating entailsexporting the datafrom the source instance to a BAK file andimporting the datainto the target instance.
To migrate your data to a Cloud SQL instance running a more recent databaseversion, follow these steps:
Create the target instance with the desired SQL Server version.
Make sure the target instance has:
- Sufficient storage to hold all of the current instance's data.
- The same authorized networks as the current instance.Learn more.
- The same user accounts, with the same SQL Server privileges and passwords.
For more information, seeCreating an instance.
Confirm that you canconnect to the new instancewith your local SQL Server tools and update them, if necessary.
Export the current instance's data to a SQL Server BAK file by following theinstructions inExport data to a BAK file.
Donot export the
sqlserversystem database. Thesqlserverdatabase isthe default database you connect to before you create any otherdatabases. After you create another database, switch to the new databaseto create tables and insert data. Don't use thesqlserverdatabase for yourapplication's data.Create a Cloud Storage bucketif needed, and upload your BAK file to the bucket.
Import the data to the target instance by following the instructions inImport from a BAK file.
Update your applications to connect to the new instance.
Upgrade thedatabase compatibility level.
When you're confident that your new instance is operating successfully,delete the old instance.
What's next
- Learn aboutimporting and exporting data.
- Learn aboutoptions for connecting to an instance.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-17 UTC.