[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-08-30 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)."]]