[ Web Proxy ]
URL:
Viewing: https://cloud.google.com/architecture/migrate-aws-rds-to-cloudsql-for-sqlserver [Back]  [Original]

Migrate from AWS to Google Cloud: Migrate from Amazon RDS for SQL Server to Cloud SQL for SQL Server  |  Cloud Architecture Center  |  Google Cloud Documentation Skip to main content
Google Cloud Documentation [Google Cloud Documentation]
Send feedback

Migrate from AWS to Google Cloud: Migrate from Amazon RDS for SQL Server to Cloud SQL for SQL Server Stay organized with collections Save and categorize content based on your preferences.

Last reviewed 2024-06-28 UTC

Google Cloud provides tools, products, guidance, and professional services to migrate from Amazon Relational Database Service (RDS) to Cloud SQL for SQL Server.

This document is intended for cloud and database administrators who want to plan, implement, and validate a database migration project. It's also intended for decision makers who are evaluating the opportunity to migrate and want an example of what a migration might look like.

This document focuses on a homogeneous database migration, which is a migration where the source and destination databases are the same database technology. The source is Amazon RDS for SQL Server, and the destination is Cloud SQL for SQL Server.

This document is part of a multi-part series about migrating from AWS to Google Cloud that includes the following documents:

For this migration to Google Cloud, we recommend that you follow the migration framework described in Migrate to Google Cloud: Get started.

The following diagram illustrates the path of your migration journey.

Migration path with four phases. [Migration path with four phases.]

You might migrate from your source environment to Google Cloud in a series of iterationsfor example, you might migrate some workloads first and others later. For each separate migration iteration, you follow the phases of the general migration framework:

  1. Assess and discover your workloads and data.
  2. Plan and build a foundation on Google Cloud.
  3. Migrate your workloads and data to Google Cloud.
  4. Optimize your Google Cloud environment.

For more information about the phases of this framework, see Migrate to Google Cloud: Get started.

To design an effective migration plan, we recommend that you validate each step of the plan, and ensure that you have a rollback strategy. To help you validate your migration plan, see Migrate to Google Cloud: Best practices for validating a migration plan.

Assess the source environment

In the assessment phase, you determine the requirements and dependencies to migrate your source environment to Google Cloud.

The assessment phase is crucial for the success of your migration. You need to gain deep knowledge about the workloads you want to migrate, their requirements, their dependencies, and about your current environment. You need to understand your starting point to successfully plan and execute a Google Cloud migration.

The assessment phase consists of the following tasks:

  1. Build a comprehensive inventory of your workloads.
  2. Catalog your workloads according to their properties and dependencies.
  3. Train and educate your teams on Google Cloud.
  4. Build experiments and proofs of concept on Google Cloud.
  5. Calculate the total cost of ownership (TCO) of the target environment.
  6. Choose the migration strategy for your workloads.
  7. Choose your migration tools.
  8. Define the migration plan and timeline.
  9. Validate your migration plan.

For more information about the assessment phase and these tasks, see Migrate to Google Cloud: Assess and discover your workloads. The following sections are based on information in that document.

The database assessment phase helps you choose the size and specifications of your target Cloud SQL database instance that matches the source for similar performance needs. Pay special attention to disk size and throughput, IOPS, and number of vCPUs. Migrations might struggle or fail due to incorrect target database instance sizing. Incorrect sizing can lead to long migration times, database performance problems, database errors, and application performance problems. When deciding on the Cloud SQL instance, keep in mind that disk performance is based on the disk size and the number of vCPUs.

The following sections rely on Migrate to Google Cloud: Assess and discover your workloads, and integrate the information in that document.

Build an inventory of your Amazon RDS instances

To define the scope of your migration, you create an inventory and collect information about your Amazon RDS instances. Ideally, the process should be automated, because manual approaches are prone to error and can lead to incorrect assumptions.

Amazon RDS and Cloud SQL might not have similar features, instance specifications, or operations. Some functionalities might be implemented differently or be unavailable. Areas of difference might include infrastructure, storage, authentication and security, replication, backup, high availability, resource capacity model and specific database engine feature integrations, and extensions. Depending on the database engine type, instance size, and architecture, there are also differences in the default values of database parameter settings.

Benchmarking can help you to better understand the workloads to be migrated and helps you define the right architecture of the migration target environment. Collecting information about performance is important to help estimate the performance needs of the Google Cloud target environment. Benchmarking concepts and tools are detailed in the Perform testing and validation phase of the migration process, but they also apply to the inventory building stage.

Tools for assessments

For an initial overview assessment of your current infrastructure, we recommend that you use Google Cloud Migration Center along with other specialized database assessment tools such as migVisor and Database Migration Assessment Tool (DMA).

With Migration Center, you can perform a complete assessment of your application and database landscape, including the technical fit for a database migration to Google Cloud. You receive size and configuration recommendations for each source database, and create a total cost of ownership (TCO) report for servers and databases.

For more information about assessing your AWS environment by using Migration Center, see Import data from other cloud providers.

In addition to Migration Center, you can use the specialized tool migVisor. migVisor supports a variety of database engines and is particularly suitable for heterogeneous migrations. For an introduction to migVisor, see the migVisor overview.

migVisor can identify artifacts and incompatible proprietary database features that can cause migration defaulting, and can point to workarounds. migVisor can also recommend a target Google Cloud solution, including initial sizing and architecture.

The migVisor database assessment output provides the following:

To see some examples of assessment outputs, see migVisor - Cloud migration assessment tool.

Note that migVisor temporarily increases database server utilization. Typically, this additional load is less than 3%, and can be run during non-peak hours.

The migVisor assessment output helps you to build a complete inventory of your RDS instances. The report includes generic properties (database engine version and edition, CPUs, and memory size), as well as details about database topology, backup policies, parameter settings, and special customizations in use.

If you prefer to use open source tools, you can use data collector scripts with (or instead of) the mentioned tools. These scripts can help you collect detailed information (about workloads, features, database objects, and database code) and build your database inventory. Also, scripts usually provide a detailed database migration assessment, including a migration effort estimation.

We recommend the open source tool DMA, which was built by Google engineers. It offers a complete and accurate database assessment, including features in use, database logic, and database objects (including schemas, tables, views, functions, triggers, and stored procedures).

To use DMA, download the collection scripts for your database engine from the Git repository, and follow the instructions. Send the output files to Google Cloud for analysis. Google Cloud creates and delivers a database assessment readout, and provides the next steps in the migration journey.

Identify and document the migration scope and affordable downtime

At this stage, you document essential information that influences your migration strategy and tooling. By now, you can answer the following questions:

To define the migration scope, decide what data to keep and what to migrate. Migrating all your databases might take considerable time and effort. Some data might remain in your source database backups. For example, old logging tables or archival data might not be needed. Alternatively, you might decide to move data after the migration process, depending on your strategy and tools.

Establish data migration baselines that help you compare and evaluate your outcomes and impacts. These baselines are reference points that represent the state of your data before and after the migration and help you make decisions. It's important to take measurements on the source environment that can help you evaluate your data migration's success. Such measurements include the following:

Determine how much downtime you can afford. What are the business impacts of downtime? Are there periods of low database activity, during which there are fewer users affected by downtime? If so, how long are such periods and when do they occur? Consider having a partial write only downtime, while read-only requests are still served.

Assess your deployment and administration process

After you build the inventories, assess the operational and deployment processes for your database to determine how you need to adapt them to facilitate your migration. These processes are fundamental to how you prepare and maintain your production environment.

Consider how you complete the following tasks:

Complete the assessment

After you build the inventories from your Amazon RDS environment, complete the rest of the activities of the assessment phase as described in Migrate to Google Cloud: Assess and discover your workloads.

Plan and build your foundation

In the plan and build phase, you provision and configure the infrastructure to do the following:

The plan and build phase is composed of the following tasks:

  1. Build a resource hierarchy.
  2. Configure Google Cloud's Identity and Access Management (IAM).
  3. Set up billing.
  4. Set up network connectivity.
  5. Harden your security.
  6. Set up logging, monitoring, and alerting.

For more information about each of these tasks, see the Migrate to Google Cloud: Plan and build your foundation.

Monitoring and alerting

Use Google Cloud Monitoring, which includes predefined dashboards for several Google Cloud products, including a Cloud SQL monitoring dashboard. Alternatively, you can consider using third-party monitoring solutions that are integrated with Google Cloud, like Datadog and Splunk. For more information, see About database observability.

Migrate Amazon RDS for SQL Server instances to Cloud SQL for SQL Server

To migrate your instances, you do the following:

  1. Choose the migration strategy: continuous replication or scheduled maintenance.

  2. Choose the migration tools, depending on your chosen strategy and requirements.

  3. Define the migration plan and timeline for each database migration, including preparation and execution tasks.

  4. Define the preparation tasks that must be done to ensure the migration tool can work properly.

  5. Define the execution tasks, which include work activities that implement the migration.

  6. Define fallback scenarios for each execution task.

  7. Perform testing and validation, which can be done in a separate staging environment.

  8. Perform the migration.

  9. Perform the production cut-over.

  10. Clean up the source environment and configure the target instance.

  11. Perform tuning and optimization.

Each phase is described in the following sections.

Choose the migration strategy

At this step, you have enough information to evaluate and select one of the following migration strategies that best suits your use case for each database:

For more information about data migration strategies, see Evaluating data migration approaches.

The following diagram shows a flowchart based on example questions that you might have when deciding the migration strategy for a single database:

Flowchart to help you choose the migration strategy. [Flowchart to help you choose the migration strategy.]

The preceding flowchart shows the following decision points:

Strategies might vary for different databases, even when they're located on the same instance. A mix of strategies can produce optimal results. For example, migrate small and infrequently used databases by using the scheduled maintenance approach, but use continuous replication for mission-critical databases where having downtime is expensive.

Usually, a migration is considered completed when the switch between the initial source instance and the target instance takes place. Any replication (if used) is stopped and all reads and writes are done on the target instance. Switching when both instances are in sync means no data loss and minimal downtime.

For more information about data migration strategies and deployments, see Classification of database migrations.

Migration configurations that provide no application downtime require a more complicated setup. Find the right balance between setup complexity and downtime scheduled during low-traffic business hours.

Each migration strategy has a tradeoff and some impact associated with the migration process. For example, replication processes involve some additional load on your source instances and your applications might be affected by replication lag. Applications (and customers) might have to wait during application downtime, at least as long as the replication lag lasts before using the new database. In practice, the following factors might increase downtime:

The following common practices can help minimize downtime and impact:

Choose your migration tools

The most important factor for a successful migration is choosing the right migration tool. Once the migration strategy has been decided, review and decide upon the migration tool.

There are many tools available, each optimized for certain migration use cases. Use cases can include the following:

To ensure a seamless migration and cut-over, you can use application deployment patterns, infrastructure orchestration, and custom migration applications. However, specialized tools called managed migration services can facilitate the process of moving data, applications, or even entire infrastructures from one environment to another. They run the data extraction from the source databases, securely transport data to the target databases, and can optionally modify the data during transit. With these capabilities, they encapsulate the complex logic of migration and offer migration monitoring capabilities.

Managed migration services provide the following advantages:

The next sections describe the migration tool recommendations, which depend on the chosen migration strategy.

Tools for scheduled maintenance migrations

The following subsections describe the tools that can be used for one-time migrations, along with their limitations and best practices.

Built-in database engine backups

When significant downtime is acceptable, and your source databases are relatively static, you can use the database engine's built-in backup and restore capabilities.

Some effort is required for setup and synchronization, especially for a large number of databases, but database engine backups are usually readily available and straightforward to use. This approach is suitable for any database size, and it's usually more effective than other tools for large instances.

Database engine backups have the following general limitations:

If you choose this approach, consider the following restrictions and best practices:

For details about limitations and best practices, see Best practices for importing and exporting data with Cloud SQL for SQL Server and Cloud SQL for SQL Server Known Issues.

Other approaches for scheduled maintenance migrations

Using other approaches might provide more control and flexibility in your scheduled maintenance migration process.

For example, by using flat files to export and import your data (or by using custom scripts), you can do the following:

Other approaches include the following:

Tools for continuous replication migrations

The following diagram shows a flowchart with questions that can help you choose the migration tool for a single database, when you use a continuous replication migration strategy:

Flowchart to help you choose a tool for continuous replication migrations. [Flowchart to help you choose a tool for continuous replication migrations.]

The preceding flowchart shows the following decision points:

The following sections describe the tools that can be used for continuous replication migrations, along with their limitations and best practices.

Database Migration Service for continuous replication migration

Database Migration Service supports homogeneous migrations to Cloud SQL for SQL Server, when the source is Amazon RDS.

Database Migration Service is a cost-effective and straightforward tool. We recommend Database Migration Service for situations with the following circumstances:

If you choose this tool, consider the following restrictions and best practices:

For a full list of limitations, see Known limitations.

Database engine built-in replication

Cloud SQL supports replication for SQL Server. However, Standard Amazon RDS for SQL Server can only be a Subscriber. Built-in replication from Amazon RDS Standard is not available. Only Amazon RDS Custom for SQL Server can be set up as a built-in Publisher.

For a list of supported and unsupported features on Amazon RDS, see Amazon RDS for Microsoft SQL Server.

Other approaches for continuous replication migration

Other continuous replication migration approaches include the following:

Third-party tools for continuous replication migrations

In some cases, it might be better to use one third-party tool for most database engines. Such cases might be if you prefer to use a managed migration service and you need to ensure that the target database is always in near-real-time sync with the source, or if you need more complex transformations like data cleaning, restructuring, and adaptation during the migration process.

If you decide to use a third-party tool, choose one of the following recommendations, which you can use for most database engines.

Striim is an end-to-end, in-memory platform for collecting, filtering, transforming, enriching, aggregating, analyzing, and delivering data in real time:

For more information about Striim, see Running Striim in the Google Cloud.

Debezium is an open source distributed platform for CDC, and can stream data changes to external subscribers:

For more information about Debezium migrations, see Near Real Time Data Replication using Debezium.

Fivetran is an automated data movement platform for moving data out of and across cloud data platforms.

Define the migration plan and timeline

For a successful database migration and production cut-over, we recommend that you prepare a well-defined, comprehensive migration plan. To help reduce the impact on your business, we recommend that you create a list of all the necessary work items.

Defining the migration scope reveals the work tasks that you must do before, during, and after the database migration process. For example, if you decide not to migrate certain tables from a database, you might need pre-migration or post-migration tasks to implement this filtering. You also ensure that your database migration doesn't affect your existing service-level agreement (SLA) and business continuity plan.

We recommend that your migration planning documentation include the following documents:

Database migrations are an iterative process, and first migrations are often slower than the later ones. Usually, well-planned migrations run without issues, but unplanned issues can still arise. We recommend that you always have a rollback plan. As a best practice, follow the guidance from Migrate to Google Cloud: Best practices for validating a migration plan.

TDD

The TDD documents all technical decisions to be made for the project. Include the following in the TDD:

RACI matrix

Some migrations projects require a RACI matrix, which is a common project management document that defines which individuals or groups are responsible for tasks and deliverables within the migration project.

Timeline

Prepare a timeline for each database that needs to be migrated. Include all work tasks that must be performed, and defined start dates and estimated end dates.

For each migration environment, we recommend that you create a T-minus plan. A T-minus plan is structured as a countdown schedule, and lists all the tasks required to complete the migration project, along with the responsible groups and estimated duration.

The timeline should account for not only pre-migration preparation tasks execution, but also validating, auditing, or testing tasks that happen after the data transfer takes place.

The duration of migration tasks typically depends on database size, but there are also other aspects to consider, like business logic complexity, application usage, and team availability.

A T-Minus plan might look like the following:

Date Phase Category Tasks Role T-minus Status
11/1/2023 Pre-migration Assessment Create assessment report Discovery team -21 Complete
11/7/2023 Pre-migration Target preparation Design target environment as described by the design document Migration team -14 Complete
11/15/2023 Pre-migration Company governance Migration date and T-Minus approval Leadership -6 Complete
11/18/2023 Migration Set up DMS Build connection profiles Cloud migration engineer -3 Complete
11/19/2023 Migration Set up DMS Build and start migration jobs Cloud migration engineer -2 Not started
11/19/2023 Migration Monitor DMS Monitor DMS Jobs and DDL changes in the source instance Cloud migration engineer -2 Not started
11/21/2023 Migration Cutover DMS Promote DMS replica Cloud migration engineer 0 Not started
11/21/2023 Migration Migration validation Database migration validation Migration team 0 Not started
11/21/2023 Migration Application test Run capabilities and performance tests Migration team 0 Not started
11/22/2023 Migration Company governance Migration validation GO or NO GO Migration team 1 Not started
11/23/2023 Post-migration Validate monitoring Configure monitoring Infrastructure team 2 Not started
11/25/2023 Post-migration Security Remove DMS user account Security team 4 Not started

Multiple database migrations

If you have multiple databases to migrate, your migration plan should contain tasks for all of the migrations.

We recommend that you start the process by migrating a smaller, ideally non-mission-critical database. This approach can help you to build your knowledge and confidence in the migration process and tooling. You can also detect any flaws in the process in the early stages of the overall migration schedule.

If you have multiple databases to migrate, the timelines can be parallelized. For example, to speed up the migration process, you might choose to migrate a group of small, static, or less mission-critical databases at the same time, as shown in the following diagram.

Parallel database migration tasks. [Parallel database migration tasks.]

In the example shown in the diagram, databases 1-4 are a group of small databases that are migrated at the same time.

Define the preparation tasks

The preparation tasks are all the activities that you need to complete to fulfill the migration prerequisites. If you don't complete the preparation tasks, the migration can't take place or the migrated database might be unusable as a result.

Preparation tasks can be categorized as follows:

Amazon RDS instance preparation and prerequisites

Consider the following common setup and prerequisite tasks:

Source database preparation and prerequisites

Cloud SQL setup

Carefully choose the size and specifications of your target Cloud SQL database instance to match the source for similar performance needs. Pay special attention to disk size and throughput, IOPS, and number of vCPUs. Incorrect sizing can lead to long migration times, database performance problems, database errors, and application performance problems.

Ensure that the destination is the correct fit. It's important to note that Amazon RDS configuration options might vary from Cloud SQL. In the event that Cloud SQL doesn't meet your requirements, consider options that include databases on Compute Engine.

You must confirm the following properties and requirements before you create your Cloud SQL instances, because they can't be changed later without recreating them.

For more information about Cloud SQL setup, see the following:

Migration-specific setup

If you use file export and import to migrate, or use the Database Migration Service migration tool, you need to create a Cloud Storage bucket. The bucket stores the database and transaction log backup files. For more information about using Database Migration Service, see Store backup files in a Cloud Storage bucket.

If you use replication, you must ensure that the Cloud SQL replica has access to your primary database. This can be accomplished through the documented connectivity options.

Depending on your scenario and criticality, you might need to implement a fallback scenario, which usually includes reversing the direction of the replication. In this case, you might need an additional replication mechanism from Cloud SQL back to your source Amazon instance.

For most third-party tools, you need to provision migration specific resources. For example, for Striim, you need to use the Google Cloud Marketplace to begin. Then, to set up your migration environment in Striim, you can use the Flow Designer to create and change applications, or you can select a pre-existing template. Applications can also be coded using the Tungsten Query Language (TQL) programming language. Using a data validation dashboard, you can get a visual representation of data handled by your Striim application.

You can decommission the resources that connect your Amazon and Google Cloud environment after the migration is completed and validated.

Define the execution tasks

Execution tasks implement the migration work itself. The tasks depend on your chosen migration tool, as described in the following subsections.

Built-in database engine backups

For more information and instructions for database specific backups, see Import data from a BAK file to Cloud SQL for SQL Server and Exporting data from RDS for SQL Server. For more information about how to automate transaction log file uploads, see Schedule transaction log file uploads for Amazon RDS.

Database Migration Service migration jobs

Define and configure migration jobs in Database Migration Service to migrate data from a source instance to the destination database. Migration jobs connect to the source database instance through user-defined connection profiles.

Test all the prerequisites to ensure the job can run successfully. Choose a time when your workloads can afford a small downtime for the migration and production cut-over.

The migration process usually involves the following tasks:

For a detailed migration setup process, see Migrate your SQL Server databases to Cloud SQL for SQL Server.

Database engine built-in replication

If you are using Amazon RDS Standard, you might need to first migrate to the Amazon RDS Custom version and then replicate to Cloud SQL.

Cloud SQL supports replication for SQL Server. For more information about replication from an external server, see Migrating data from SQL Server 2017 to Cloud SQL for SQL Server using snapshot replication.

Third-party tools

Define any execution tasks for the third-party tool you've chosen. For example, if you decide to use Striim, you need to create apps in your namespace, and configure the CDC reader to connect to the Amazon instance. For details, see SQL Server setup in the Striim documentation.

Define fallback scenarios

Define fallback action items for each migration execution task, to safeguard against unforeseen issues that might occur during the migration process. The fallback tasks usually depend on the migration strategy and tools used.

Fallback might require significant effort. As a best practice, don't perform production cut-over until your test results are satisfactory. Both the database migration and the fallback scenario should be properly tested to avoid a severe outage.

Define success criteria and timebox all your migration execution tasks. Doing a migration dry run helps collect information about the expected times for each task. For example, for a scheduled maintenance migration, you can afford the downtime represented by the cut-over window. However, it's important to plan your next action in case the one-time migration job or the restore of the backup fails midway. Depending on how much time of your planned downtime has elapsed, you might have to postpone the migration if the migration task doesn't finish in the expected amount of time.

A fallback plan usually refers to rolling back the migration after you perform the production cut-over, if issues on the target instance appear. If you implement a fallback plan, remember that it must be treated as a full database migration, including planning and testing.

If you choose not to have a fallback plan, make sure you understand the possible consequences. Having no fallback plan can add unforeseen effort and cause avoidable disruptions in your migration process.

Although a fallback is a last resort, and most database migrations don't end up using it, we recommend that you always have a fallback strategy.

Simple fallback

In this fallback strategy, you switch your applications back to the original source database instance. Adopt this strategy if you can afford downtime when you fall back or if you don't need the transactions committed on the new target system.

If you do need all the written data on your target database, and you can afford some downtime, you can consider stopping writes to your target database instance, taking built-in backups and restoring them on your source instance, and then re-connecting your applications to the initial source database instance. Depending on the nature of your workload and amount of data written on the target database instance, you could bring it into your initial source database system at a later time, especially if your workloads aren't dependent on any specific record creation time or any time ordering constraints.

Reverse replication

In this strategy, you replicate the writes that happen on your new target database after production cut-over back to your initial source database. In this way, you keep the original source in sync with the new target database and have the writes happening on the new target database instance. Its main disadvantage is that you can't test the replication stream until after you cut-over to the target database instance, therefore it doesn't allow end-to-end testing and it has a small period of no fallback.

Choose this approach when you can still keep your source instance for some time and you migrate using the continuous replication migration.

Forward replication

This strategy is a variation of reverse replication. You replicate the writes on your new target database to a third database instance of your choice. You can point your applications to this third database, which connects to the server and runs read-only queries while the server is unavailable. You can use any replication mechanism, depending on your needs. The advantage of this approach is that it can be fully end-to-end tested.

Take this approach when you want to be covered by a fallback at all times or when you must discard your initial source database shortly after the production cut-over.

Duplicate writes

If you choose a Y (writing and reading) or data-access microservice migration strategy, this fallback plan is already set. This strategy is more complicated, because you need to refactor applications or develop tools that connect to your database instances.

Your applications write to both initial source and target database instances, which lets you perform a gradual production cut-over until you are using only your target database instances. If there are any issues, you connect your applications back to the initial source with no downtime. You can discard the initial source and the duplicate writing mechanism when you consider the migration performed with no issues observed.

We recommend this approach when it's critical to have no migration downtime, have a reliable fallback in place, and when you have time and resources to perform application refactoring.

Perform testing and validation

The goals of this step are to test and validate the following:

Define the key success factors, which are subjective to your migration. The following are examples of subjective factors:

The storage configurations in your source environment might not map directly to Google Cloud environment targets. For example, configurations from the General Purpose SSD (gp2 and gp3) volumes with IOPS burst performance or Provisioned IOPS SSD. To compare and properly size the target instances, benchmark your source instances, in both the assessment and validation phases.

In the benchmarking process, you apply production-like sequences of operations to the database instances. During this time, you capture and process metrics to measure and compare the relative performance of both source and target systems.

For conventional, server based configurations, use relevant measurements observed during peak loads. For flexible resource capacity models like Aurora Serverless, consider looking at historical metric data to observe your scaling needs.

The following tools can be used for testing, validation, and database benchmarking:

To run an end-to-end test, including testing of the migration plan, always perform a migration dry run exercise. A dry run performs the full-scope database migration without switching any production workloads, and it offers the following advantages:

Data testing can be performed on a small set of the databases to be migrated or the entire set. Depending on the total number of databases and the tools used for implementing their migration, you can decide to adopt a risk based approach. With this approach, you perform data validation on a subset of databases migrated through the same tool, especially if this tool is a managed migration service.

For testing, you should have access to both source and target databases and do the following tasks:

Ideally, all these migration test scenarios are automated and repeatable on any source system. The automated test cases suite is adapted to perform against the switched applications.

If you're using Database Migration Service as your migration tool, see Verify a migration.

Data Validation Tool

For performing data validation, we recommend that you use the Data Validation Tool (DVT). The DVT is an open sourced Python CLI tool, backed by Google, that provides an automated and repeatable solution for validation across different environments.

The DVT can help streamline the data validation process by offering customized, multi-level validation functions to compare source and target tables on the table, column, and row level. You can also add validation rules.

The DVT covers many Google Cloud data sources, including AlloyDB for PostgreSQL, BigQuery, Cloud SQL, Spanner, JSON, and CSV files on Cloud Storage. It can also be integrated with Cloud Run functions and Cloud Run for event based triggering and orchestration.

The DVT supports the following types of validations:

For more information about the DVT, see the Git repository and Data validation made easy with Google Cloud's Data Validation Tool.

Perform the migration

The migration tasks include the activities to support the transfer from one system to another.

Consider the following best practices for your data migration:

Perform the migration by following your defined execution tasks, and refer to the documentation for your selected migration tool.

Perform the production cut-over

The high-level production cut-over process can differ depending on your chosen migration strategy. If you can have downtime on your workloads, then your migration cut-over begins by stopping writes to your source database.

For continuous replication migrations, you typically do the following high-level steps in the cut-over process:

After the data has been migrated by using the chosen migration tool, you validate the data in the target database. You confirm that the source database and the target databases are in sync and the data in the target instance adheres to your chosen migration success standards.

Once the data validation passes your criteria, you can perform the application level cut-over. Deploy the workloads that have been refactored to use the new target instance. You deploy the versions of your applications that point to the new target database instance. The deployments can be performed either through rolling updates, staged releases, or by using a blue-green deployment pattern. Some application downtime might be incurred.

Follow the best practices for your production cut-over:

Cleanup the source environment and configure the Cloud SQL instance

After the cut-over is completed, you can delete the source databases. We recommend performing the following important actions before the cleanup of your source instance:

In a fallback scenario, you might want to implement the replication of your writes on the Cloud SQL instance back to your original source database. The setup resembles the migration process but would run in reverse: the initial source database would become the new target.

As a best practice to keep the source instances up to date after the cut-over, replicate the writes performed on the target Cloud SQL instances back to the source database. If you need to roll back, you can fall back to your old source instances with minimal data loss.

Besides the source environment cleanup, the following critical configurations for your Cloud SQL instances must be done:

Don't start an administrative operation before the previous operation has completed.

For more information, see the following:

Optimize your environment after migration

Optimization is the last phase of your migration. In this phase, you iterate on optimization tasks until your target environment meets your optimization requirements. The steps of each iteration are as follows:

  1. Assess your current environment, teams, and optimization loop.
  2. Establish your optimization requirements and goals.
  3. Optimize your environment and your teams.
  4. Tune the optimization loop.

You repeat this sequence until you've achieved your optimization goals.

For more information about optimizing your Google Cloud environment, see Migrate to Google Cloud: Optimize your environment and Google Cloud Well-Architected Framework: Performance optimization.

Establish your optimization requirements

Review the following optimization requirements for your Google Cloud environment and choose the ones that best fit your workloads.

Increase the reliability and availability of your database

With Cloud SQL, you can implement a high availability and disaster recovery strategy that aligns with your recovery time objective (RTO) and recovery point objective (RPO). To increase reliability and availability, consider the following:

Increase the cost effectiveness of your database infrastructure

To have a positive economic impact, your workloads must use the available resources and services efficiently. Consider the following options:

To reduce licencing costs, specifically for Cloud SQL for SQL Server, consider the following:

Increase the performance of your database infrastructure

Minor database-related performance issues frequently have the potential to impact the entire operation. To maintain and increase your Cloud SQL instance performance, consider the following guidelines:

For more information about increasing performance, see Performance in "Diagnose issues", and Cloud SQL - SQL Server Performance Analysis and Query Tuning.

Increase database observability capabilities

Diagnosing and troubleshooting issues in applications that connect to database instances can be challenging and time-consuming. For this reason, a centralized place where all team members can see what's happening at the database and instance level is essential. You can monitor Cloud SQL instances in the following ways:

General Cloud SQL best practices and operational guidelines

Apply the best practices for Cloud SQL to configure and tune the database.

Some important Cloud SQL general recommendations are as follows:

To be able to efficiently handle any database performance issues that you might encounter, use the following guidelines until your issue is resolved:

Scale up infrastructure: Increase resources (such as disk throughput, vCPU, and RAM). Depending on the urgency and your team's availability and experience, vertically scaling your instance can resolve most performance issues. Later, you can further investigate the root cause of the issue in a test environment and consider options to eliminate it.

Perform and schedule database maintenance operations: Index defragmentation, statistics updates, vacuum analyze, and reindex heavily updated tables. Check if and when these maintenance operations were last performed, especially on the affected objects (tables, indexes). Find out if there was a change from normal database activities. For example, recently adding a new column or having lots of updates on a table.

Perform database tuning and optimization: Are the tables in your database properly structured? Do the columns have the correct data types? Is your data model right for the type of workload? Investigate your slow queries and their execution plans. Are they using the available indexes? Check for index scans, locks, and waits on other resources. Consider adding indexes to support your critical queries. Eliminate non-critical indexes and foreign keys. Consider rewriting complex queries and joins. The time it takes to resolve your issue depends on the experience and availability of your team and can range from hours to days.

Scale out your reads: Consider having read replicas. When scaling vertically isn't sufficient for your needs, and database tuning and optimization measures aren't helping, consider scaling horizontally. Routing read queries from your applications to a read replica improves the overall performance of your database workload. However, it might require additional effort to change your applications to connect to the read replica.

Database re-architecture: Consider partitioning and indexing the database. This operation requires significantly more effort than database tuning and optimization, and it might involve a data migration, but it can be a long-term fix. Sometimes, poor data model design can lead to performance issues, which can be partially compensated by vertical scale-up. However, a proper data model is a long-term fix. Consider partitioning your tables. Archive data that isn't needed anymore, if possible. Normalize your database structure, but remember that denormalizing can also improve performance.

Database sharding: You can scale out your writes by sharding your database. Sharding is a complicated operation and involves re-architecting your database and applications in a specific way and performing data migration. You split your database instance in multiple smaller instances by using a specific partitioning criteria. The criteria can be based on customer or subject. This option lets you horizontally scale both your writes and reads. However, it increases the complexity of your database and application workloads. It might also lead to unbalanced shards called hotspots, which would outweigh the benefit of sharding.

Specifically for Cloud SQL for SQL Server, consider the following best practices:

For more details, see General best practices and Operational guidelines for Cloud SQL for SQL Server.

What's next

Contributors

Authors:

Other contributors:

Send feedback

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-06-28 UTC.

Need to tell us more? [[["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 2024-06-28 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page