This page describes how to migrate your data to an instance running a later
version of SQL Server. Before proceeding with this method, consider
upgrading the database major version in-place.
Consider the features offered in each SQL Server version and address
incompatibilities.
New major versions introduce incompatible changes that might require you to
modify the application code, the schema, or the database settings before
you can upgrade your database instance. Review the release notes of your
target major version to determine the incompatibilities that you need to
address. If you're skipping major versions, address the incompatibilities
listed for each version that you're skipping.
Perform a dry run of the end-to-end upgrade process with a test instance
before you upgrade the production database. You might want to test the upgrade
using a clone
instead of your production database to avoid any performance impact from the
export on your production workload.
In addition to validating that the upgrade completes successfully, run
tests to understand the expected downtime of the upgrade, confirm your
upgrade workflow, and ensure that the application behaves as expected on the upgraded
database. If you haven't enabled automatic storage increases,
take note of the disk storage used by the upgraded dry run instance to
determine whether you need to increase the storage capacity for the
production instance before upgrading.
Confirm that you can connect to the new instance
with your local SQL Server tools and update them, if necessary.
Export the current instance's data to a SQL Server BAK file by following the
instructions in
Export data to a BAK file.
Do not export the sqlserver system database. The sqlserver database is
the default database you connect to before you create any other
databases. After you create another database, switch to the new database
to create tables and insert data. Don't use the sqlserver database for your
application's data.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Upgrade the database major version by migrating data\n\n\u003cbr /\u003e\n\n[MySQL](/sql/docs/mysql/upgrade-major-db-version-migrate \"View this page for the MySQL database engine\") \\| [PostgreSQL](/sql/docs/postgres/upgrade-major-db-version-migrate \"View this page for the PostgreSQL database engine\") \\| SQL Server\n\n\u003cbr /\u003e\n\nThis page describes how to migrate your data to an instance running a later\nversion of SQL Server. Before proceeding with this method, consider\n[upgrading the database major version in-place](/sql/docs/sqlserver/upgrade-major-db-version-inplace).\n\nPlan a major version upgrade\n----------------------------\n\n1. Choose a target major version and edition.\n\n See the [list of versions that Cloud SQL supports](/sql/docs/sqlserver/db-versions).\n2. Consider the features offered in each SQL Server version and address\n incompatibilities.\n\n New major versions introduce incompatible changes that might require you to\n modify the application code, the schema, or the database settings before\n you can upgrade your database instance. Review the release notes of your\n target major version to determine the incompatibilities that you need to\n address. If you're skipping major versions, address the incompatibilities\n listed for each version that you're skipping.\n - [SQL Server 2022](https://learn.microsoft.com/en-us/sql/sql-server/what-s-new-in-sql-server-2022?view=sql-server-ver16)\n - [SQL Server 2019](https://docs.microsoft.com/en-us/sql/sql-server/what-s-new-in-sql-server-ver15?view=sql-server-ver15)\n - [SQL Server 2017](https://docs.microsoft.com/en-us/sql/sql-server/what-s-new-in-sql-server-2017?view=sql-server-ver15)\n3. Test the upgrade with a dry run.\n\n Perform a dry run of the end-to-end upgrade process with a test instance\n before you upgrade the production database. You might want to test the upgrade\n using a [clone](/sql/docs/sqlserver/clone-instance)\n instead of your production database to avoid any performance impact from the\n export on your production workload.\n\n In addition to validating that the upgrade completes successfully, run\n tests to understand the expected downtime of the upgrade, confirm your\n upgrade workflow, and ensure that the application behaves as expected on the upgraded\n database. If you haven't enabled [automatic storage increases](/sql/docs/sqlserver/instance-settings#automatic-storage-increase-2ndgen),\n take note of the disk storage used by the upgraded dry run instance to\n determine whether you need to increase the storage capacity for the\n production instance before upgrading.\n4. Decide when you want to upgrade.\n\n | **Note:** Upgrades require the instance to become unavailable for a period of time. Be sure to schedule your upgrade when database activity is low.\n\nMigrate your data\n-----------------\n\nMigrating entails [exporting the data](/sql/docs/sqlserver/import-export/import-export-bak#export_data_to_a_bak_file)\nfrom the source instance to a BAK file and [importing the data](/sql/docs/sqlserver/import-export/import-export-bak#import_data_from_a_bak_file)\ninto the target instance.\n\nTo migrate your data to a Cloud SQL instance running a more recent database\nversion, follow these steps:\n\n1. Create the target instance with the desired SQL Server version.\n\n Make sure the target instance has:\n - Sufficient storage to hold all of the current instance's data.\n - The same authorized networks as the current instance. [Learn more](/sql/docs/sqlserver/configure-ip).\n - The same user accounts, with the same SQL Server privileges and passwords.\n\n For more information, see [Creating an instance](/sql/docs/sqlserver/create-instance).\n2. Confirm that you can [connect to the new instance](/sql/docs/sqlserver/connect-admin-ip)\n with your local SQL Server tools and update them, if necessary.\n\n3. Export the current instance's data to a SQL Server BAK file by following the\n instructions in\n [Export data to a BAK file](/sql/docs/sqlserver/import-export/import-export-bak#export_data_to_a_bak_file).\n\n Do *not* export the `sqlserver` system database. The `sqlserver` database is\n the default database you connect to before you create any other\n databases. After you create another database, switch to the new database\n to create tables and insert data. Don't use the `sqlserver` database for your\n application's data.\n4. [Create a Cloud Storage bucket](/storage/docs/creating-buckets)\n if needed, and upload your BAK file to the bucket.\n\n5. Import the data to the target instance by following the instructions in\n [Import from a BAK file](/sql/docs/sqlserver/import-export/import-export-bak#import_data_from_a_bak_file).\n\n6. Update your applications to connect to the new instance.\n\n7. Upgrade the [database compatibility level](/sql/docs/sqlserver/upgrade-major-db-version-inplace#db-compat).\n\n8. When you're confident that your new instance is operating successfully,\n delete the old instance.\n\nWhat's next\n-----------\n\n- Learn about [importing and exporting data](/sql/docs/sqlserver/import-export).\n- Learn about [options for connecting to an instance](/sql/docs/sqlserver/external-connection-methods)."]]