Considere os recursos oferecidos em cada versão do SQL Server e as incompatibilidades
de endereço.
Novas versões principais apresentam alterações incompatíveis que podem exigir que você
modifique o código, o esquema ou as configurações do banco de dados do aplicativo antes
de fazer upgrade da instância do banco de dados. Revise as notas de lançamento da
versão principal de destino para determinar as incompatibilidades que você precisa
resolver. Se você estiver pulando versões principais, resolva as incompatibilidades
listadas para cada versão que você está ignorando.
Faça uma simulação do processo de upgrade de ponta a ponta com uma instância de teste
antes de fazer upgrade do banco de dados de produção. É possível testar o upgrade
usando um clone
em vez de seu banco de dados de produção para evitar qualquer impacto no desempenho da
exportação na carga de trabalho de produção.
Além de validar se o upgrade foi concluído com êxito, execute
testes para entender o tempo de inatividade esperado do upgrade, confirmar o
fluxo de trabalho do upgrade e garantir que o aplicativo se comporte conforme esperado no banco de dados
atualizado. Se você não ativou os aumentos de armazenamento automáticos, anote o armazenamento em disco usado pela instância de simulação atualizada para determinar se é necessário aumentar a capacidade de armazenamento da produção antes do upgrade.
Não exporte o banco de dados sqlserver do sistema. O banco de dados sqlserver é
o banco de dados padrão ao qual você se conecta antes de criar qualquer outro
banco de dados. Depois de criar outro banco de dados, alterne para o novo banco de dados
para criar tabelas e inserir dados. Não use o banco de dados sqlserver para os dados do seu aplicativo.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-09-04 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)."]]