<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Asaf Lev on Medium]]></title>
        <description><![CDATA[Stories by Asaf Lev on Medium]]></description>
        <link>https://medium.com/@asaflevpm?source=rss-436e63d7b741------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*44nhAQDp4fgxz2bVsPaTiw.jpeg</url>
            <title>Stories by Asaf Lev on Medium</title>
            <link>https://medium.com/@asaflevpm?source=rss-436e63d7b741------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 03:32:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@asaflevpm/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Modernizing Databases Without Live Cloud Connectivity via DMS]]></title>
            <link>https://medium.com/google-cloud/modernizing-databases-without-live-cloud-connectivity-via-dms-a3439dc203d0?source=rss-436e63d7b741------2</link>
            <guid isPermaLink="false">https://medium.com/p/a3439dc203d0</guid>
            <category><![CDATA[cloud-migration]]></category>
            <category><![CDATA[database-migration]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Asaf Lev]]></dc:creator>
            <pubDate>Mon, 26 Oct 2026 10:12:13 GMT</pubDate>
            <atom:updated>2026-10-26T23:56:47.142Z</atom:updated>
            <content:encoded><![CDATA[<p>Enterprise database modernization to PostgreSQL and AlloyDB often encounters a major roadblock before code conversion even starts: direct network connectivity. Security policies, compliance restrictions, and air-gapped enterprise environments often restrict live database connections from cloud services or agents to source databases like Oracle and SQL Server.</p><p>To solve this, we are introducing offline Google Cloud Database Migration Service (DMS) Conversion Workspace creation via Cloud Storage (GCS) Seeding (seed stands for pull schema and code from the source database metadata tables).</p><p>This architecture enables schema extraction locally, staging in GCS, and offline initialization of DMS conversion workspaces.</p><p>This release represents a major milestone for our migration agent, providing a streamlined foundation for localized and air-gapped schema translation.</p><h3>Strategic Capabilities &amp; Ecosystem Impact</h3><h3>1. Milestone for DMS Migration Agent</h3><p>The DMS migration agent simplifies schema and procedural code conversion directly within local environments. By enabling offline workspace seeding, The agent allows developers to extract database metadata locally, evaluate conversion issues, apply AI-driven transformations, and stage DDL artifacts without establishing live cloud database links.</p><p>The agent provides several key benefits over cloud-only conversions: performs hill-climbing optimization, automatically generates and executes validation tests, and dramatically reduces manual refactoring effort.</p><h3>2. Enabler for AlloyDB Omni On-Premises</h3><p>For workloads operating under strict data residency constraints or deployed in hybrid topologies, Google Cloud offers AlloyDB Omni — the downloadable, enterprise-grade edition of AlloyDB capable of running anywhere. Offline GCS seeding acts as a primary enabler for AlloyDB Omni modernizations. Organizations can now analyze SQL Server or Oracle schemas and transform them into PostgreSQL/AlloyDB SQL dialects off-cloud, preparing applications for deployment onto on-premises AlloyDB Omni instances.</p><h3>Architectural Overview &amp; Execution Flow</h3><p>The offline workflow follows a three-stage lifecycle:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1gtXkvnSZLqWKC7ArTIUlg.png" /></figure><ol><li><strong>Client Extraction</strong>: Local execution of standalone SQL extractors (sqlserver_extractor.py or oracle_extractor.py) against system catalogs to generate structured JSON metadata definitions.</li><li><strong>GCS Secure Staging</strong>: Streamlined transfer of versioned JSON extraction files into user-managed Cloud Storage buckets.</li><li><strong>Workspace Ingestion</strong>: Creation and seeding of the GCP DMS Conversion Workspace targeting the pre-populated Cloud Storage seed path.</li></ol><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FCujTx8sUIFI%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DCujTx8sUIFI&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FCujTx8sUIFI%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/4cd93be8a673f1946fb054c2428ff44b/href">https://medium.com/media/4cd93be8a673f1946fb054c2428ff44b/href</a></iframe><h3>Extraction Script Setup &amp; Password Handling</h3><p>To ensure security, extraction tools accept passwords via dedicated environment variables rather than command-line flags:</p><pre>SQL Server: DMS_SQLSERVERPASSWORD<br>Oracle: DMS_ORACLEPASSWORD</pre><h3>Environment Configuration</h3><pre># - - GCP Infrastructure Variables - -<br>export PROJECT_ID=&quot;your-gcp-project-id&quot;<br>export REGION=&quot;us-central1&quot;<br>export GCS_BUCKET=&quot;your-dms-schema-bucket&quot;<br>export WORKSPACE_ID=&quot;my-conversion-workspace-$(date +%s)&quot;<br># - - Target Engine Selection (POSTGRESQL or ALLOYDB) - -<br>export TARGET_ENGINE=&quot;POSTGRESQL&quot;<br># - - SQL Server Source Connection Parameters - -<br>export SOURCE_ENGINE=&quot;SQL_SERVER&quot;<br>export DB_HOST=&quot;127.0.0.1&quot;<br>export DB_PORT=&quot;1433&quot;<br>export DB_USER=&quot;sa&quot;<br>export DB_NAME=&quot;MySourceDatabase&quot;<br># - - Oracle Source Connection Parameters - -<br># export SOURCE_ENGINE=&quot;ORACLE&quot;<br># export DB_HOST=&quot;127.0.0.1&quot;<br># export DB_PORT=&quot;1521&quot;<br># export DB_USER=&quot;SYSTEM&quot;<br># export DB_NAME=&quot;ORCL&quot;<br># - - Local Staging Directory - -<br>export TEMP_DIR=&quot;./dms_extracted_schema&quot;</pre><h3>SQL Server Extraction Example</h3><p>The sqlserver_extractor.py script queries Microsoft SQL Server catalog views and generates clean JSON structure files while excluding internal system objects.</p><pre># Set password securely in environment<br>export DMS_SQLSERVERPASSWORD=&quot;YourSecurePassword&quot;<br># Create local staging directory<br>mkdir -p &quot;$TEMP_DIR&quot;<br># Run SQL Server Extractor<br>python3 sqlserver_extractor.py \<br> --host &quot;$DB_HOST&quot; \<br> --port &quot;$DB_PORT&quot; \<br> --user &quot;$DB_USER&quot; \<br> --database &quot;$DB_NAME&quot; \<br> --output &quot;$TEMP_DIR&quot;</pre><h3>Oracle Extraction Example</h3><p>The oracle_extractor.py script queries Oracle data dictionary views (DBA_* or ALL_*) and automatically filters out system schemas (SYS, SYSTEM, AUDSYS, etc.).</p><pre>Set password securely in environment:<br>export DMS_ORACLEPASSWORD=&quot;YourSecurePassword&quot;<br>Create local staging directory:<br>mkdir -p &quot;$TEMP_DIR&quot;<br>Run Oracle Extractor:<br>python3 oracle_extractor.py \<br> --host &quot;$DB_HOST&quot; \<br> --port &quot;$DB_PORT&quot; \<br> --user &quot;$DB_USER&quot; \<br> --database &quot;$DB_NAME&quot; \<br> --output &quot;$TEMP_DIR&quot;</pre><h3>Manual Workspace Creation via CLI</h3><pre>## Manual Workspace Creation via `gcloud` CLI<br># 1. Upload extraction JSON files to Cloud Storage<br>gcloud storage cp &quot;$TEMP_DIR&quot;/*.json &quot;gs://${GCS_BUCKET}/${SOURCE_ENGINE}/&quot;<br># 2. Create the Conversion Workspace<br>gcloud database-migration conversion-workspaces create &quot;$WORKSPACE_ID&quot; \<br> --location=&quot;$REGION&quot; \<br> --source-database-engine=&quot;$SOURCE_ENGINE&quot; \<br> --destination-database-engine=&quot;$TARGET_ENGINE&quot; \<br> --display-name=&quot;Workspace for $SOURCE_ENGINE Migration&quot;<br># 3. Seed the Workspace from GCS<br>gcloud database-migration conversion-workspaces seed &quot;$WORKSPACE_ID&quot; \<br> --location=&quot;$REGION&quot; \<br> --gcs-path=&quot;gs://${GCS_BUCKET}/${SOURCE_ENGINE}/&quot;</pre><h3>End-to-End Orchestration using workspace_init.py</h3><p>For automated integration testing or CI/CD execution, workspace_init.py automates bucket verification, file upload, workspace initialization, seeding, and verification.</p><h3>Key Workflow Steps in workspace_init.py</h3><ol><li><strong>Access Verification</strong>: Validates project permissions via gcloud projects describe.</li><li><strong>Bucket Setup</strong>: Confirms GCS destination bucket availability or creates it in the target region.</li><li><strong>GCS Upload</strong>: Uploads extracted JSON files to a timestamped GCS path.</li><li><strong>Workspace Creation &amp; Seeding</strong>: Invokes gcloud database-migration conversion-workspaces create and seed commands synchronously.</li><li><strong>Validation</strong>: Calls describe on the workspace to verify has_seed_success: ‘true’.</li></ol><h3>Execution Command</h3><pre>python3 workspace_init.py \<br> --config_path=&quot;./config.yaml&quot; \<br> --workspace_name=&quot;Automated-DMS-Workspace&quot; \<br> --workspace_resource_name=&quot;$WORKSPACE_ID&quot; \<br> --temp_dir_path=&quot;$TEMP_DIR&quot;</pre><p>Example config.yaml</p><pre>project_id: &quot;your-gcp-project-id&quot;<br>gcs_bucket: &quot;your-dms-schema-bucket&quot;<br>region: &quot;us-central1&quot;<br>database_type: &quot;SQLSERVER&quot; # Options: SQLSERVER, ORACLE<br>dest_db_type: &quot;POSTGRESQL&quot; # Options: POSTGRESQL, ALLOYDB</pre><h3>Join the DMS Migration Agent Preview(s)</h3><p>Offline Conversion Workspace creation via GCS Seeding opens new possibilities for enterprise database modernizations across restricted networks, air-gapped environments, and hybrid AlloyDB Omni deployments.</p><p>Interested in evaluating offline GCS seeding and migration agent previews? Sign up for our private preview program:</p><p><a href="https://docs.google.com/forms/d/e/1FAIpQLSfozBesgL85qtT6yUFd6Y2B-6snF1R4AF2--EX-WkhlnuHKtQ/viewform?usp=header"><em>Sign up for Database Migration Service Private Preview</em></a></p><h4>Oracle Metadata Extractor (oracle_extractor.py)</h4><pre>#!/usr/bin/env python3<br># Copyright 2026 Google LLC<br>#<br># Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);<br># you may not use this file except in compliance with the License.<br># You may obtain a copy of the License at<br>#<br>#     https://www.apache.org/licenses/LICENSE-2.0<br>#<br># Unless required by applicable law or agreed to in writing, software<br># distributed under the License is distributed on an &quot;AS IS&quot; BASIS,<br># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<br># See the License for the specific language governing permissions and<br># limitations under the License.<br><br>&quot;&quot;&quot;Queries an Oracle Server to extract database metadata.<br><br>This script connects to a specified Oracle database and executes a<br>predefined set of queries to gather information about schemas, tables, columns,<br>indexes, etc.<br>The results of each query are stored in a separate JSON file in the specified<br>output directory. You will need to upload those JSON files to a GCS bucket<br>folder in your project and use the &#39;Seed from GCS&#39; option when creating a DMS<br>conversion workspace to point to it.<br><br>Parameters are provided via command-line arguments.<br><br>1. Install oracledb: pip install oracledb<br>2. Run the script:<br>   python oracle_extractor.py --host &lt;your_server_address&gt;<br>   --user &lt;your_username&gt; [--password &lt;user_password&gt;]<br>   --database &lt;your_database&gt; --output &lt;output_folder_name&gt;<br><br>The database password should either be provided using the --password flag or<br>by setting the DMS_ORACLEPASSWORD environment variable.<br><br>To get a description of the various flags, run<br>&#39;python3 oracle_extractor.py --help&#39;<br>&quot;&quot;&quot;<br><br>import argparse<br>import decimal<br>import json<br>import os<br>from pathlib import Path<br>import sys<br>import time<br>from typing import Any, Dict, List<br><br>import oracledb<br><br>Decimal = decimal.Decimal<br><br>INTERNAL_USERS = frozenset({<br>    &quot;SYS&quot;,<br>    &quot;WKSYS&quot;,<br>    &quot;OWBSYS&quot;,<br>    &quot;CSMIG&quot;,<br>    &quot;SPATIAL_CSW_ADMIN_USR&quot;,<br>    &quot;ORDSYS&quot;,<br>    &quot;DEMO&quot;,<br>    &quot;OLAPSYS&quot;,<br>    &quot;APEX_040000&quot;,<br>    &quot;APEX_PUBLIC_USER&quot;,<br>    &quot;DSSYS&quot;,<br>    &quot;MDDATA&quot;,<br>    &quot;SI_INFORMTN_SCHEMA&quot;,<br>    &quot;DIP&quot;,<br>    &quot;AURORA$ORB$UNAUTHENTICATED&quot;,<br>    &quot;MGMT_VIEW&quot;,<br>    &quot;AWR_STAGE&quot;,<br>    &quot;OUTLN&quot;,<br>    &quot;XDB&quot;,<br>    &quot;DMSYS&quot;,<br>    &quot;ORACLE_OCM&quot;,<br>    &quot;DBSNMP&quot;,<br>    &quot;XS$NULL&quot;,<br>    &quot;TRACESVR&quot;,<br>    &quot;FLOWS_30000&quot;,<br>    &quot;CTXSYS&quot;,<br>    &quot;LBACSYS&quot;,<br>    &quot;SYSMAN&quot;,<br>    &quot;ORDPLUGINS&quot;,<br>    &quot;EXFSYS&quot;,<br>    &quot;WMSYS&quot;,<br>    &quot;WKPROXY&quot;,<br>    &quot;FLOWS_FILES&quot;,<br>    &quot;WK_TEST&quot;,<br>    &quot;MDSYS&quot;,<br>    &quot;TSMSYS&quot;,<br>    &quot;ANONYMOUS&quot;,<br>    &quot;PERFSTAT&quot;,<br>    &quot;SPATIAL_WFS_ADMIN_USR&quot;,<br>    &quot;AUDSYS&quot;,<br>    &quot;RDSADMIN&quot;,<br>    &quot;SYSTEM&quot;,<br>    &quot;GSMADMIN_INTERNAL&quot;,<br>    &quot;DBSFWUSER&quot;,<br>    &quot;APPQOSSYS&quot;,<br>})<br>INTERNAL_USERS_LIST = &quot;, &quot;.join(f&quot;&#39;{user}&#39;&quot; for user in INTERNAL_USERS)<br><br><br>def exclude_internal_users(column_name: str) -&gt; str:<br>  return (<br>      f&quot;{column_name} NOT IN ({INTERNAL_USERS_LIST}) AND {column_name} NOT LIKE&quot;<br>      f&quot; &#39;FLOWS_%&#39; AND {column_name} NOT LIKE &#39;APEX_%&#39;&quot;<br>  )<br><br><br>class QueryInfo:<br><br>  def __init__(self, query: str, owner_column: str, not_null_column: str = &quot;&quot;):<br>    self.query = query<br>    self.owner_column = owner_column<br>    self.not_null_column = not_null_column<br><br><br>ORACLE_QUERIES: Dict[str, QueryInfo] = {<br>    &quot;ORACLE_ALL_USERS&quot;: QueryInfo(<br>        query=&quot;SELECT * FROM &lt;OWNER&gt;_USERS&quot;, owner_column=&quot;USERNAME&quot;<br>    ),<br>    &quot;ORACLE_ALL_SYNONYMS&quot;: QueryInfo(<br>        query=(<br>            &quot;SELECT MAIN.*, O.OBJECT_TYPE FROM &lt;OWNER&gt;_SYNONYMS MAIN JOIN&quot;<br>            &quot; &lt;OWNER&gt;_OBJECTS O ON MAIN.TABLE_OWNER = O.OWNER AND&quot;<br>            &quot; MAIN.TABLE_NAME = O.OBJECT_NAME WHERE O.SECONDARY = &#39;N&#39; AND&quot;<br>            &quot; O.OBJECT_TYPE NOT LIKE &#39;%PARTITION&#39;&quot;<br>        ),<br>        owner_column=&quot;MAIN.TABLE_OWNER&quot;,<br>    ),<br>    &quot;ORACLE_ALL_TABLES&quot;: QueryInfo(<br>        query=(<br>            &quot;SELECT MAIN.* FROM &lt;OWNER&gt;_TABLES MAIN WHERE MAIN.SECONDARY = &#39;N&#39;&quot;<br>        ),<br>        owner_column=&quot;MAIN.OWNER&quot;,<br>    ),<br>    &quot;ORACLE_ALL_SEQUENCES&quot;: QueryInfo(<br>        query=&quot;SELECT MAIN.* FROM &lt;OWNER&gt;_SEQUENCES MAIN&quot;,<br>        owner_column=&quot;MAIN.SEQUENCE_OWNER&quot;,<br>    ),<br>    &quot;ORACLE_ALL_VIEWS&quot;: QueryInfo(<br>        query=&quot;SELECT MAIN.* FROM &lt;OWNER&gt;_VIEWS MAIN&quot;, owner_column=&quot;MAIN.OWNER&quot;<br>    ),<br>    &quot;ORACLE_ALL_CONSTRAINTS&quot;: QueryInfo(<br>        query=(<br>            &quot;SELECT MAIN.* FROM &lt;OWNER&gt;_CONSTRAINTS MAIN WHERE EXISTS (SELECT 1&quot;<br>            &quot; FROM &lt;OWNER&gt;_TABLES T WHERE T.OWNER = MAIN.OWNER AND T.TABLE_NAME&quot;<br>            &quot; = MAIN.TABLE_NAME AND T.SECONDARY = &#39;N&#39;)&quot;<br>        ),<br>        owner_column=&quot;MAIN.OWNER&quot;,<br>    ),<br>    &quot;ORACLE_ALL_TRIGGERS&quot;: QueryInfo(<br>        query=(<br>            &quot;SELECT MAIN.* FROM &lt;OWNER&gt;_TRIGGERS MAIN WHERE NOT EXISTS (SELECT&quot;<br>            &quot; 1 FROM &lt;OWNER&gt;_OBJECTS O WHERE O.OWNER = MAIN.OWNER AND&quot;<br>            &quot; O.OBJECT_NAME = MAIN.TRIGGER_NAME AND O.OBJECT_TYPE = &#39;TRIGGER&#39;&quot;<br>            &quot; AND O.SECONDARY = &#39;Y&#39;)&quot;<br>        ),<br>        owner_column=&quot;MAIN.OWNER&quot;,<br>    ),<br>    &quot;ORACLE_ALL_INDEXES&quot;: QueryInfo(<br>        query=(<br>            &quot;SELECT MAIN.* FROM &lt;OWNER&gt;_INDEXES MAIN WHERE EXISTS (SELECT 1&quot;<br>            &quot; FROM &lt;OWNER&gt;_TABLES T WHERE T.OWNER = MAIN.TABLE_OWNER AND&quot;<br>            &quot; T.TABLE_NAME = MAIN.TABLE_NAME AND T.SECONDARY = &#39;N&#39;)&quot;<br>        ),<br>        owner_column=&quot;MAIN.OWNER&quot;,<br>    ),<br>    &quot;ORACLE_ALL_SOURCE&quot;: QueryInfo(<br>        query=&quot;SELECT MAIN.* FROM &lt;OWNER&gt;_SOURCE MAIN&quot;,<br>        owner_column=&quot;MAIN.OWNER&quot;,<br>    ),<br>    &quot;ORACLE_ALL_TAB_COMMENTS&quot;: QueryInfo(<br>        query=&quot;SELECT MAIN.* FROM &lt;OWNER&gt;_TAB_COMMENTS MAIN&quot;,<br>        owner_column=&quot;MAIN.OWNER&quot;,<br>        not_null_column=&quot;MAIN.COMMENTS&quot;,<br>    ),<br>    &quot;ORACLE_ALL_COL_COMMENTS&quot;: QueryInfo(<br>        query=&quot;SELECT MAIN.* FROM &lt;OWNER&gt;_COL_COMMENTS MAIN&quot;,<br>        owner_column=&quot;MAIN.OWNER&quot;,<br>        not_null_column=&quot;MAIN.COMMENTS&quot;,<br>    ),<br>    &quot;ORACLE_ALL_MVIEWS&quot;: QueryInfo(<br>        query=(<br>            &quot;SELECT MAIN.* FROM &lt;OWNER&gt;_MVIEWS MAIN WHERE EXISTS (SELECT 1 FROM&quot;<br>            &quot; &lt;OWNER&gt;_OBJECTS O WHERE O.OWNER = MAIN.OWNER AND O.OBJECT_NAME =&quot;<br>            &quot; MAIN.MVIEW_NAME AND O.OBJECT_TYPE = &#39;MATERIALIZED VIEW&#39; AND&quot;<br>            &quot; O.SECONDARY = &#39;N&#39;)&quot;<br>        ),<br>        owner_column=&quot;MAIN.OWNER&quot;,<br>    ),<br>    &quot;ORACLE_ALL_CONS_COLUMNS&quot;: QueryInfo(<br>        query=&quot;SELECT MAIN.* FROM &lt;OWNER&gt;_CONS_COLUMNS MAIN&quot;,<br>        owner_column=&quot;MAIN.OWNER&quot;,<br>    ),<br>    &quot;ORACLE_ALL_IND_COLUMNS&quot;: QueryInfo(<br>        query=&quot;SELECT MAIN.* FROM &lt;OWNER&gt;_IND_COLUMNS MAIN&quot;,<br>        owner_column=&quot;MAIN.INDEX_OWNER&quot;,<br>    ),<br>    &quot;ORACLE_ALL_PART_TABLES&quot;: QueryInfo(<br>        query=&quot;SELECT MAIN.* FROM &lt;OWNER&gt;_PART_TABLES MAIN&quot;,<br>        owner_column=&quot;MAIN.OWNER&quot;,<br>    ),<br>    &quot;ORACLE_ALL_PART_KEY_COLUMNS&quot;: QueryInfo(<br>        query=&quot;SELECT MAIN.* FROM &lt;OWNER&gt;_PART_KEY_COLUMNS MAIN&quot;,<br>        owner_column=&quot;MAIN.OWNER&quot;,<br>    ),<br>    &quot;ORACLE_ALL_SUBPART_KEY_COLUMNS&quot;: QueryInfo(<br>        query=&quot;SELECT MAIN.* FROM &lt;OWNER&gt;_SUBPART_KEY_COLUMNS MAIN&quot;,<br>        owner_column=&quot;MAIN.OWNER&quot;,<br>    ),<br>    &quot;ORACLE_ALL_TAB_PARTITIONS&quot;: QueryInfo(<br>        query=(<br>            &quot;SELECT MAIN.TABLE_OWNER, MAIN.TABLE_NAME, MAIN.PARTITION_NAME, &quot;<br>            &quot;MAIN.PARTITION_POSITION, MAIN.HIGH_VALUE, MAIN.SUBPARTITION_COUNT &quot;<br>            &quot;FROM &lt;OWNER&gt;_TAB_PARTITIONS MAIN&quot;<br>        ),<br>        owner_column=&quot;MAIN.TABLE_OWNER&quot;,<br>    ),<br>    &quot;ORACLE_ALL_PART_INDEXES&quot;: QueryInfo(<br>        query=(<br>            &quot;SELECT MAIN.OWNER, MAIN.INDEX_NAME, MAIN.TABLE_NAME,&quot;<br>            &quot; MAIN.PARTITIONING_TYPE, MAIN.SUBPARTITIONING_TYPE,&quot;<br>            &quot; MAIN.PARTITION_COUNT, MAIN.PARTITIONING_KEY_COUNT,&quot;<br>            &quot; MAIN.SUBPARTITIONING_KEY_COUNT, MAIN.LOCALITY, MAIN.INTERVAL FROM&quot;<br>            &quot; &lt;OWNER&gt;_PART_INDEXES MAIN&quot;<br>        ),<br>        owner_column=&quot;MAIN.OWNER&quot;,<br>    ),<br>    &quot;ORACLE_ALL_TAB_SUBPARTITIONS&quot;: QueryInfo(<br>        query=(<br>            &quot;SELECT MAIN.TABLE_OWNER, MAIN.TABLE_NAME, MAIN.PARTITION_NAME,&quot;<br>            &quot; MAIN.SUBPARTITION_NAME, MAIN.SUBPARTITION_POSITION,&quot;<br>            &quot; MAIN.HIGH_VALUE FROM &lt;OWNER&gt;_TAB_SUBPARTITIONS MAIN&quot;<br>        ),<br>        owner_column=&quot;MAIN.TABLE_OWNER&quot;,<br>    ),<br>    &quot;ORACLE_ALL_TAB_COLS&quot;: QueryInfo(<br>        query=&quot;SELECT MAIN.* FROM &lt;OWNER&gt;_TAB_COLS MAIN&quot;,<br>        owner_column=&quot;MAIN.OWNER&quot;,<br>    ),<br>    &quot;ORACLE_ALL_IND_EXPRESSIONS&quot;: QueryInfo(<br>        query=&quot;SELECT MAIN.* FROM &lt;OWNER&gt;_IND_EXPRESSIONS MAIN&quot;,<br>        owner_column=&quot;MAIN.INDEX_OWNER&quot;,<br>    ),<br>    &quot;ORACLE_ALL_DEPENDENCIES&quot;: QueryInfo(<br>        query=&quot;SELECT MAIN.* FROM &lt;OWNER&gt;_DEPENDENCIES MAIN&quot;,<br>        owner_column=&quot;MAIN.OWNER&quot;,<br>    ),<br>}<br><br><br>def get_version_query() -&gt; str:<br>  &quot;&quot;&quot;Returns the query to get the Oracle version.&quot;&quot;&quot;<br>  return (<br>      &quot;SELECT PRODUCT, VERSION FROM PRODUCT_COMPONENT_VERSION WHERE PRODUCT&quot;<br>      &quot; LIKE &#39;%Oracle%Database%&#39;&quot;<br>  )<br><br><br>def get_query(query_type: str, oracle_version: int, use_dba: bool) -&gt; str:<br>  &quot;&quot;&quot;Constructs the SQL query based on the query type, Oracle version, and whether to use DBA tables.<br><br>  Args:<br>      query_type: The key from ORACLE_QUERIES.<br>      oracle_version: The major Oracle version.<br>      use_dba: True to use DBA_ views, False to use ALL_ views.<br><br>  Returns:<br>      The constructed SQL query string.<br>  &quot;&quot;&quot;<br>  owner = &quot;DBA&quot; if use_dba else &quot;ALL&quot;<br>  if query_type == &quot;ORACLE_ALL_USERS&quot;:<br>    if oracle_version &lt; 12:<br>      return (<br>          f&quot;SELECT * FROM {owner}_USERS WHERE&quot;<br>          f&quot; {exclude_internal_users(&#39;USERNAME&#39;)}&quot;<br>      )<br>    else:<br>      return f&quot;SELECT * FROM {owner}_USERS WHERE ORACLE_MAINTAINED = &#39;N&#39;&quot;<br><br>  if query_type not in ORACLE_QUERIES:<br>    raise ValueError(<br>        f&quot;Oracle query {query_type} for version {oracle_version} not defined&quot;<br>    )<br><br>  query_info = ORACLE_QUERIES[query_type]<br>  expression = query_info.query.replace(&quot;&lt;OWNER&gt;&quot;, owner)<br><br>  if not query_info.owner_column:<br>    return expression<br><br>  join_clause = &quot;&quot;<br>  where_clauses = []<br><br>  if oracle_version &lt; 12:<br>    where_clauses.append(exclude_internal_users(query_info.owner_column))<br>  else:<br>    join_clause = (<br>        f&quot; JOIN {owner}_USERS U ON {query_info.owner_column} = U.USERNAME&quot;<br>    )<br>    where_clauses.append(&quot;U.ORACLE_MAINTAINED = &#39;N&#39;&quot;)<br><br>  if query_info.not_null_column:<br>    where_clauses.append(f&quot;{query_info.not_null_column} IS NOT NULL&quot;)<br><br>  if where_clauses:<br>    existing_where = &quot; WHERE &quot; in expression.upper()<br>    if join_clause and existing_where:<br>      expression = expression.replace(&quot; WHERE &quot;, join_clause + &quot; WHERE &quot;)<br>    elif join_clause:<br>      expression += join_clause<br><br>    if not existing_where:<br>      expression += &quot; WHERE &quot;<br>    else:<br>      expression += &quot; AND &quot;<br>    expression += &quot; AND &quot;.join(where_clauses)<br>  elif join_clause:<br>    expression += join_clause<br><br>  return expression<br><br><br>class CustomJsonEncoder(json.JSONEncoder):<br>  &quot;&quot;&quot;Custom JSON encoder to handle non-serializable types from pymssql.&quot;&quot;&quot;<br><br>  def default(self, o):<br>    if isinstance(o, (int, float)):<br>      return o<br>    if isinstance(o, bool):<br>      return o<br>    if o is None:<br>      return None<br>    if isinstance(o, Decimal):<br>      return float(o)  # Convert Decimal to float<br>    if isinstance(o, bytes):<br>      try:<br>        return o.decode(&quot;utf-8&quot;)<br>      except UnicodeDecodeError:<br>        return o.hex()  # Fallback for non-utf8 bytes<br>    # Convert any other type to string<br>    return str(o)<br><br><br>def execute_query(cursor: oracledb.Cursor, query: str) -&gt; List[Dict[str, Any]]:<br>  &quot;&quot;&quot;Executes a single query and returns the results.<br><br>  Args:<br>      cursor: The Oracle database cursor.<br>      query: The SQL query to execute.<br><br>  Returns:<br>      A list of dictionaries, where each dictionary represents a row.<br>  &quot;&quot;&quot;<br>  print(f&quot;--------------------\nExecuting query: {query}&quot;)<br>  cursor.execute(query)<br>  columns = [col[0] for col in cursor.description]<br>  results = []<br>  for row in cursor:<br>    row_dict = {}<br>    for i, value in enumerate(row):<br>      if value is not None:<br>        col_name = columns[i]<br>        # Convert LOBs to strings<br>        if isinstance(value, oracledb.LOB):<br>          value = value.read()<br>        row_dict[col_name] = value<br>    results.append(row_dict)<br>  return results<br><br><br>def get_oracle_version(cursor: oracledb.Cursor) -&gt; int:<br>  &quot;&quot;&quot;Retrieves the major Oracle version.<br><br>  Args:<br>      cursor: The Oracle database cursor.<br><br>  Returns:<br>      The major version number.<br><br>  Raises:<br>      RuntimeError: If the Oracle version cannot be determined.<br>  &quot;&quot;&quot;<br>  query = get_version_query()<br>  print(f&quot;Executing query: {query}&quot;)<br>  cursor.execute(query)<br>  row = cursor.fetchone()<br>  if row:<br>    version_str = row[1]  # VERSION column<br>    major_version = int(version_str.split(&quot;.&quot;)[0])<br>    print(f&quot;*** Detected Oracle version: {major_version} ({version_str})&quot;)<br>    return major_version<br>  raise RuntimeError(&quot;Could not determine Oracle version&quot;)<br><br><br>def check_dba_access(cursor: oracledb.Cursor) -&gt; bool:<br>  &quot;&quot;&quot;Checks if the user has access to DBA_USERS.<br><br>  Args:<br>      cursor: The Oracle database cursor.<br><br>  Returns:<br>      True if DBA_USERS is accessible, False otherwise.<br>  &quot;&quot;&quot;<br>  try:<br>    cursor.execute(&quot;SELECT 1 FROM DBA_USERS WHERE ROWNUM = 1&quot;)<br>    print(&quot;*** DBA access confirmed.&quot;)<br>    return True<br>  except oracledb.DatabaseError as e:<br>    print(f&quot;*** No DBA access: {e}&quot;)<br>    return False<br><br><br>def _write_schemas(input_dir: str):<br>  &quot;&quot;&quot;Read ORACLE_ALL_USERS.json and filter schema names.&quot;&quot;&quot;<br>  file_path = os.path.join(input_dir, &quot;ORACLE_ALL_USERS.json&quot;)<br>  if not os.path.exists(file_path):<br>    print(f&quot;Error: {file_path} not found.&quot;, file=sys.stderr)<br>    sys.exit(1)<br><br>  schema_names = []<br>  try:<br>    with open(file_path, &quot;r&quot;, encoding=&quot;utf-8&quot;) as f:<br>      users = json.load(f)<br><br>    for user in users:<br>      name = user.get(&quot;USERNAME&quot;)<br>      if not name or &quot;&#39;&quot; in name:<br>        continue<br><br>      # Filter logic (internal users are already filtered by the extractor,<br>      # but we add these for consistency with the user request)<br>      oracle_maintained = user.get(&quot;ORACLE_MAINTAINED&quot;)<br>      if oracle_maintained is not None and oracle_maintained.upper() == &quot;Y&quot;:<br>        continue<br><br>      schema_names.append(name)<br><br>  except (OSError, json.JSONDecodeError) as e:<br>    print(f&quot;Error processing {file_path}: {e}&quot;, file=sys.stderr)<br>    sys.exit(1)<br><br>  file_path = Path(__file__).parent / &quot;schemas.txt&quot;<br>  file_path.write_text(&quot;\n&quot;.join(schema_names))<br><br><br>def main():<br>  &quot;&quot;&quot;Main function to extract data from Oracle.&quot;&quot;&quot;<br>  parser = argparse.ArgumentParser(<br>      description=&quot;Extract data from Oracle server.&quot;<br>  )<br>  parser.add_argument(<br>      &quot;--host&quot;, required=True, help=&quot;Host address or name of the Oracle server&quot;<br>  )<br>  parser.add_argument(<br>      &quot;--user&quot;, required=True, help=&quot;Oracle user for authentication&quot;<br>  )<br>  parser.add_argument(<br>      &quot;--password&quot;,<br>      required=False,<br>      help=(<br>          &quot;User password, if not set in DMS_ORACLEPASSWORD environment variable&quot;<br>      ),<br>  )<br>  parser.add_argument(<br>      &quot;--database&quot;, default=&quot;ORCL&quot;, help=&quot;Oracle database name (default: ORCL)&quot;<br>  )<br>  parser.add_argument(<br>      &quot;--port&quot;, default=&quot;1521&quot;, help=&quot;Oracle listener port (default: 1521)&quot;<br>  )<br>  parser.add_argument(<br>      &quot;--output&quot;, required=True, help=&quot;Local folder name to save query results&quot;<br>  )<br>  args = parser.parse_args()<br><br>  password = args.password or os.environ.get(&quot;DMS_ORACLEPASSWORD&quot;)<br>  if not password:<br>    parser.error(<br>        &quot;Password must be provided using the --password flag or by setting the&quot;<br>        &quot; DMS_ORACLEPASSWORD environment variable.&quot;<br>    )<br><br>  output_dir = args.output<br>  try:<br>    # Prepare output directory<br>    if not os.path.exists(output_dir):<br>      os.makedirs(output_dir)<br>      print(f&quot;Created output directory: {output_dir}&quot;)<br>    else:<br>      print(<br>          f&quot;Output directory {output_dir} exists. Cleaning up *.json files...&quot;<br>      )<br>      for item in os.listdir(output_dir):<br>        if item.endswith(&quot;.json&quot;):<br>          print(&quot;Delete file before proceeding &quot;)<br>          #os.remove(os.path.join(output_dir, item))<br>      print(&quot;Cleanup complete.&quot;)<br><br>    start_time = time.time()<br>    total_size = 0<br><br>    dsn = oracledb.makedsn(args.host, args.port, service_name=args.database)<br><br>    with (<br>        oracledb.connect(<br>            user=args.user, password=password, dsn=dsn<br>        ) as connection,<br>        connection.cursor() as cursor,<br>    ):<br>      oracle_version = get_oracle_version(cursor)<br>      use_dba = check_dba_access(cursor)<br><br>      for query_key in ORACLE_QUERIES:<br>        query = get_query(query_key, oracle_version, use_dba)<br>        results = execute_query(cursor, query)<br><br>        file_path = os.path.join(output_dir, f&quot;{query_key}.json&quot;)<br>        with open(file_path, &quot;w&quot;) as f:<br>          if results:<br>            json.dump(results, f, indent=2, cls=CustomJsonEncoder)<br><br>            file_size = os.path.getsize(file_path)<br>            total_size += file_size<br>            print(<br>                f&quot;Saved {len(results)} rows to {file_path} ({file_size} bytes)&quot;<br>            )<br>          else:<br>            f.write(&quot;[]&quot;)<br>            print(f&quot;Query for {query_key} returned no results.&quot;)<br><br>    output_path = os.path.join(output_dir, &quot;METADATA.json&quot;)<br>    with open(output_path, &quot;w&quot;, encoding=&quot;utf-8&quot;) as f:<br>      f.write(<br>          json.dumps({<br>              &quot;database&quot;: args.database,<br>              &quot;engine&quot;: &quot;ORACLE&quot;,<br>          })<br>          + &quot;\n&quot;<br>      )<br><br>    end_time = time.time()<br>    duration = end_time - start_time<br>    print(f&quot;Extraction complete in {duration:.2f} seconds.&quot;)<br>    print(f&quot;Total size of JSON files: {total_size} bytes.&quot;)<br>    _write_schemas(output_dir)<br>    sys.exit(0)<br><br>  except RuntimeError as e:<br>    print(f&quot;An error occurred: {e}&quot;, file=sys.stderr)<br>    sys.exit(1)<br><br><br>if __name__ == &quot;__main__&quot;:<br>  main()</pre><h4>SQL Server Metadata Extractor (sqlserver_extractor.py)</h4><pre>#!/usr/bin/env python3<br># Copyright 2026 Google LLC<br>#<br># Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);<br># you may not use this file except in compliance with the License.<br># You may obtain a copy of the License at<br>#<br>#     https://www.apache.org/licenses/LICENSE-2.0<br>#<br># Unless required by applicable law or agreed to in writing, software<br># distributed under the License is distributed on an &quot;AS IS&quot; BASIS,<br># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<br># See the License for the specific language governing permissions and<br># limitations under the License.<br><br>&quot;&quot;&quot;Queries a Microsoft SQL Server to extract database metadata.<br><br>This script connects to a specified SQL Server database and executes a<br>predefined set of queries to gather information about schemas, tables, columns,<br>indexes, etc.<br>The results of each query are stored in a separate JSON file in the specified<br>output directory. You will need to upload those JSON files to a GCS bucket<br>folder in your project and use the &#39;Seed from GCS&#39; option when creating a DMS<br>conversion workspace to point to it.<br><br>Parameters are provided via command-line arguments.<br><br>1. Install pymssql: pip install pymssql<br>2. Run the script:<br>   python sqlserver_extractor.py --host &lt;your_server_address&gt;<br>   [--port &lt;your_port&gt;] [--user &lt;your_username&gt; [--password &lt;user_password&gt;]]<br>   --database &lt;your_database&gt; --output &lt;output_folder_name&gt;<br><br>If not using Windows Authentication, the database password should either be<br>provided using the --password flag or<br>by setting the DMS_SQLSERVERPASSWORD environment variable.<br><br>To get a description of the various flags, run<br>&#39;python3 sqlserver_extractor.py --help&#39;<br>&quot;&quot;&quot;<br><br>import argparse<br>import datetime<br>import decimal<br>import glob<br>import json<br>import os<br>from pathlib import Path<br>import sys<br>import time<br>import uuid<br><br>import pymssql<br><br>Decimal = decimal.Decimal<br><br><br>def _query_customize(table, query=None):<br>  &quot;&quot;&quot;Constructs a query that prioritizes a custom view if it exists.<br><br>  Args:<br>      table (str): The base system table name (e.g., &#39;tables&#39;).<br>      query (str, optional): The fallback query if the custom view doesn&#39;t<br>        exist. Defaults to &#39;SELECT * FROM sys.{table}&#39;.<br><br>  Returns:<br>      str: The constructed SQL query.<br>  &quot;&quot;&quot;<br>  if query is None:<br>    query = f&quot;SELECT * FROM sys.{table}&quot;<br>  return (<br>      f&quot;IF OBJECT_ID(&#39;dbo.dms_{table}_view&#39;) IS NOT NULL SELECT * FROM&quot;<br>      f&quot; dbo.dms_{table}_view ELSE {query}&quot;<br>  )<br><br><br>def _query_not_ms_shipped(table):<br>  &quot;&quot;&quot;Constructs a query to select from sys.{table} excluding Microsoft shipped objects.<br><br>  Args:<br>      table (str): The base system table name.<br><br>  Returns:<br>      str: The constructed SQL query.<br>  &quot;&quot;&quot;<br>  return _query_customize(<br>      table, f&quot;SELECT * FROM sys.{table} WHERE is_ms_shipped != 1&quot;<br>  )<br><br><br>def _query_not_object_ms_shipped(table):<br>  &quot;&quot;&quot;Constructs a query to select from sys.{table} excluding Microsoft shipped objects using OBJECTPROPERTY.<br><br>  Args:<br>      table (str): The base system table name.<br><br>  Returns:<br>      str: The constructed SQL query.<br>  &quot;&quot;&quot;<br>  return _query_customize(<br>      table,<br>      f&quot;SELECT * FROM sys.{table} WHERE OBJECTPROPERTY(object_id,&quot;<br>      &quot; &#39;IsMSShipped&#39;) != 1&quot;,<br>  )<br><br><br>QUERIES_INFO = {<br>    &quot;CHECK_CONSTRAINTS&quot;: _query_not_ms_shipped(&quot;check_constraints&quot;),<br>    &quot;ALL_COLUMNS&quot;: _query_customize(<br>        &quot;columns&quot;,<br>        &quot;&quot;&quot;<br>        SELECT cols.* from sys.columns as cols LEFT JOIN sys.objects as objs<br>        ON cols.object_id=objs.object_id where OBJECTPROPERTY(cols.object_id,<br>        &#39;IsMSShipped&#39;) != 1 OR objs.type = &#39;TT&#39;<br>        &quot;&quot;&quot;,<br>    ),<br>    &quot;COMPUTED_COLUMNS&quot;: _query_customize(&quot;computed_columns&quot;),<br>    &quot;DATABASE_PRINCIPALS&quot;: _query_customize(&quot;database_principals&quot;),<br>    &quot;DATABASES&quot;: _query_customize(&quot;databases&quot;),<br>    &quot;DEFAULT_CONSTRAINTS&quot;: _query_customize(&quot;default_constraints&quot;),<br>    &quot;FOREIGN_KEY_COLUMNS&quot;: _query_customize(&quot;foreign_key_columns&quot;),<br>    &quot;FOREIGN_KEYS&quot;: _query_customize(&quot;foreign_keys&quot;),<br>    &quot;IDENTITY_COLUMNS&quot;: _query_customize(<br>        &quot;identity_columns&quot;,<br>        &quot;&quot;&quot;<br>        SELECT object_id,name,column_id,CAST(seed_value AS NVARCHAR) AS<br>        seed_value,CAST(increment_value AS NVARCHAR) AS increment_value<br>        FROM sys.identity_columns<br>        &quot;&quot;&quot;,<br>    ),<br>    &quot;INDEX_COLUMNS&quot;: _query_not_object_ms_shipped(&quot;index_columns&quot;),<br>    &quot;INDEXES&quot;: _query_not_object_ms_shipped(&quot;indexes&quot;),<br>    &quot;KEY_CONSTRAINTS&quot;: _query_customize(&quot;key_constraints&quot;),<br>    &quot;OBJECTS&quot;: _query_customize(&quot;objects&quot;),<br>    &quot;PARTITION_FUNCTIONS&quot;: _query_customize(&quot;partition_functions&quot;),<br>    &quot;PARTITION_PARAMETERS&quot;: _query_customize(&quot;partition_parameters&quot;),<br>    &quot;PARTITION_RANGE_VALUES&quot;: _query_customize(<br>        &quot;partition_range_values&quot;,<br>        &quot;&quot;&quot;<br>        SELECT function_id,boundary_id,parameter_id,CAST(value AS NVARCHAR) AS<br>        value FROM sys.partition_range_values<br>        &quot;&quot;&quot;,<br>    ),<br>    &quot;PARTITION_SCHEMES&quot;: _query_customize(&quot;partition_schemes&quot;),<br>    &quot;PARTITIONS&quot;: _query_not_object_ms_shipped(&quot;partitions&quot;),<br>    &quot;PROCEDURES&quot;: _query_not_ms_shipped(&quot;procedures&quot;),<br>    &quot;SCHEMAS&quot;: _query_customize(&quot;schemas&quot;),<br>    &quot;SEQUENCES&quot;: _query_customize(<br>        &quot;sequences&quot;,<br>        &quot;&quot;&quot;<br>        SELECT name,object_id,schema_id,CAST(start_value AS NVARCHAR) AS<br>        start_value, CAST(increment AS NVARCHAR) AS increment,<br>        CAST(minimum_value AS NVARCHAR) AS minimum_value, CAST(maximum_value<br>        AS NVARCHAR) AS maximum_value, is_cycling,is_cached FROM<br>        sys.sequences WHERE is_ms_shipped != 1<br>        &quot;&quot;&quot;,<br>    ),<br>    &quot;SQL_EXPRESSION_DEPENDENCIES&quot;: _query_customize(<br>        &quot;sql_expression_dependencies&quot;,<br>        &quot;&quot;&quot;<br>        SELECT * FROM sys.sql_expression_dependencies WHERE<br>        OBJECTPROPERTY(referencing_id, &#39;IsMSShipped&#39;) != 1<br>        &quot;&quot;&quot;,<br>    ),<br>    &quot;ALL_SQL_MODULES&quot;: _query_not_object_ms_shipped(&quot;sql_modules&quot;),<br>    &quot;SYNONYMS&quot;: _query_customize(&quot;synonyms&quot;),<br>    &quot;TABLES&quot;: _query_not_ms_shipped(&quot;tables&quot;),<br>    &quot;TRIGGERS&quot;: _query_not_ms_shipped(&quot;triggers&quot;),<br>    &quot;TYPES&quot;: _query_customize(<br>        &quot;types&quot;,<br>        &quot;&quot;&quot;<br>        SELECT t.*,tt.type_table_object_id FROM sys.types AS t LEFT JOIN<br>        sys.table_types AS tt ON t.user_type_id = tt.user_type_id<br>        &quot;&quot;&quot;,<br>    ),<br>    &quot;VERSION&quot;: (<br>        &quot;&quot;&quot;<br>        SELECT SERVERPROPERTY(&#39;productversion&#39;) as &#39;version&#39;,<br>        SERVERPROPERTY(&#39;edition&#39;) as &#39;edition&#39;<br>        &quot;&quot;&quot;<br>    ),<br>    &quot;VIEWS&quot;: _query_not_ms_shipped(&quot;views&quot;),<br>}<br><br><br>class CustomJsonEncoder(json.JSONEncoder):<br>  &quot;&quot;&quot;Custom JSON encoder to handle non-serializable types from pymssql.&quot;&quot;&quot;<br><br>  def default(self, o):<br>    if isinstance(o, (int, float)):<br>      return o<br>    if isinstance(o, bool):<br>      return o<br>    if o is None:<br>      return None<br>    if isinstance(o, Decimal):<br>      return float(o)  # Convert Decimal to float<br>    if isinstance(o, datetime.datetime):<br>      return o.isoformat()<br>    if isinstance(o, uuid.UUID):<br>      return str(o)<br>    if isinstance(o, bytes):<br>      try:<br>        return o.decode(&quot;utf-8&quot;)<br>      except UnicodeDecodeError:<br>        return o.hex()  # Fallback for non-utf8 bytes<br>    # Convert any other type to string<br>    return str(o)<br><br><br>def _execute_queries(<br>    server, port, database, output_folder, user=None, password=None<br>):<br>  &quot;&quot;&quot;Connects to the SQL Server, executes the predefined queries, and saves results to JSON files.<br><br>  Args:<br>      server (str): SQL Server host address or name.<br>      port (int): SQL Server port number.<br>      database (str): SQL Server database to connect to.<br>      output_folder (str): Local folder to save the query results.<br>      user (str, optional): SQL Server user for SQL Server Authentication. Omit<br>        for Windows Authentication.<br>      password (str, optional): SQL Server password for SQL Server<br>        Authentication. Omit for Windows Authentication.<br>  &quot;&quot;&quot;<br>  if os.path.exists(output_folder):<br>    print(<br>        f&quot;Output folder &#39;{output_folder}&#39; already exists. Deleting existing&quot;<br>        &quot; .json files...&quot;<br>    )<br>    for file in glob.glob(os.path.join(output_folder, &quot;*.json&quot;)):<br>      try:<br>        print(f&quot;Please delete {file}&quot;)<br>        # os.remove ....<br>      except OSError as e:<br>        print(f&quot;  Error deleting file {file}: {e}&quot;)<br>        sys.exit(1)<br>  else:<br>    os.makedirs(output_folder)<br>    print(f&quot;Created output folder: {output_folder}&quot;)<br><br>  total_size = 0<br>  start_time = time.time()<br>  conn = None<br><br>  try:<br>    if user and password:<br>      print(<br>          f&quot;Connecting to server: {server}:{port}, database: {database} using&quot;<br>          f&quot; SQL Server Authentication as user: {user}&quot;<br>      )<br>      conn = pymssql.connect(<br>          server=server,<br>          port=port,<br>          user=user,<br>          password=password,<br>          database=database,<br>      )<br>    else:<br>      print(<br>          f&quot;Connecting to server: {server}:{port}, database: {database} using&quot;<br>          &quot; Windows Authentication&quot;<br>      )<br>      conn = pymssql.connect(server, port=port, database=database)<br><br>    cursor = conn.cursor(as_dict=True)<br>    print(&quot;Successfully connected to SQL Server.&quot;)<br><br>    for result_file, query in QUERIES_INFO.items():<br>      output_path = os.path.join(output_folder, f&quot;{result_file}.json&quot;)<br><br>      print(f&quot;-------------------\nExecuting query for {result_file}:\n{query}&quot;)<br><br>      try:<br>        cursor.execute(query)<br>        rows = cursor.fetchall()<br><br>        file_size = 0<br>        with open(output_path, &quot;w&quot;, encoding=&quot;utf-8&quot;) as f:<br>          for row in rows:<br>            # Process row to handle potential byte strings or other<br>            # non-serializable types<br>            processed_row = {}<br>            for k, v in row.items():<br>              if v is not None:<br>                if isinstance(v, bytes):<br>                  try:<br>                    processed_row[k] = v.decode(&quot;utf-8&quot;)<br>                  except UnicodeDecodeError:<br>                    processed_row[k] = v.hex()  # Fallback for non-utf8 bytes<br>                else:<br>                  processed_row[k] = v<br><br>            line = (<br>                json.dumps(<br>                    processed_row, cls=CustomJsonEncoder, ensure_ascii=False<br>                )<br>                + &quot;\n&quot;<br>            )<br>            f.write(line)<br>            file_size += len(line.encode(&quot;utf-8&quot;))<br><br>        print(f&quot;Results saved to {output_path} ({file_size} bytes)&quot;)<br>        total_size += file_size<br><br>      except pymssql.Error as e:<br>        print(f&quot;  Error executing query for {result_file}: {e}&quot;)<br>        sys.exit(1)<br>      except (TypeError, OSError) as e:<br>        print(f&quot;  An unexpected error occurred for {result_file}: {e}&quot;)<br>        sys.exit(1)<br><br>  except pymssql.Error as e:<br>    print(f&quot;Database connection error: {e}&quot;)<br>    sys.exit(1)<br>  except (TypeError, OSError) as e:<br>    print(f&quot;An error occurred: {e}&quot;)<br>    sys.exit(1)<br>  finally:<br>    if conn:<br>      conn.close()<br>      print(&quot;\nConnection closed.&quot;)<br><br>  output_path = os.path.join(output_folder, &quot;METADATA.json&quot;)<br>  with open(output_path, &quot;w&quot;, encoding=&quot;utf-8&quot;) as f:<br>    f.write(<br>        json.dumps({<br>            &quot;database&quot;: database,<br>            &quot;engine&quot;: &quot;SQLSERVER&quot;,<br>        })<br>        + &quot;\n&quot;<br>    )<br><br>  end_time = time.time()<br>  total_time = end_time - start_time<br>  print(f&quot;\nTotal time taken: {total_time:.2f} seconds&quot;)<br>  print(f&quot;Total size of result files: {total_size} bytes&quot;)<br><br><br>def _write_schemas(input_dir: str):<br>  &quot;&quot;&quot;Read SCHEMAS.json and filter schema names.&quot;&quot;&quot;<br>  file_path = os.path.join(input_dir, &quot;SCHEMAS.json&quot;)<br>  if not os.path.exists(file_path):<br>    print(f&quot;Error: {file_path} not found.&quot;, file=sys.stderr)<br>    sys.exit(1)<br><br>  schema_names = []<br>  try:<br>    with open(file_path, &quot;r&quot;, encoding=&quot;utf-8&quot;) as f:<br>      for line in f:<br>        if not line.strip():<br>          continue<br>        try:<br>          schema = json.loads(line)<br>          name = schema.get(&quot;name&quot;)<br>          # Convert to int if it&#39;s there, but it can be None or a string<br>          principal_id_raw = schema.get(&quot;principal_id&quot;)<br>          try:<br>            principal_id = (<br>                int(principal_id_raw) if principal_id_raw is not None else None<br>            )<br>          except (ValueError, TypeError):<br>            principal_id = None<br><br>          # Filter logic<br>          if (<br>              name in [&quot;sys&quot;, &quot;INFORMATION_SCHEMA&quot;, &quot;guest&quot;, &quot;cdc&quot;]<br>              or &quot;&#39;&quot; in name<br>          ):<br>            continue<br>          if principal_id is not None and principal_id &gt;= 16384:<br>            continue<br><br>          if name:<br>            schema_names.append(name)<br>        except json.JSONDecodeError as e:<br>          print(f&quot;Warning: Skipping invalid JSON line: {e}&quot;, file=sys.stderr)<br>  except OSError as e:<br>    print(f&quot;Error reading {file_path}: {e}&quot;, file=sys.stderr)<br>    sys.exit(1)<br><br>  file_path = Path(__file__).parent / &quot;schemas.txt&quot;<br>  file_path.write_text(&quot;\n&quot;.join(schema_names))<br><br><br>def main():<br>  &quot;&quot;&quot;Main function to parse command-line arguments and start the query execution process.&quot;&quot;&quot;<br>  parser = argparse.ArgumentParser(<br>      description=&quot;Query Microsoft SQL Server and store results in JSON files.&quot;<br>  )<br>  parser.add_argument(<br>      &quot;--host&quot;,<br>      required=True,<br>      help=&quot;Host address or name of the SQL Server.&quot;,<br>  )<br>  parser.add_argument(<br>      &quot;--port&quot;,<br>      required=False,<br>      help=&quot;Port number of the SQL Server. Default is 1433.&quot;,<br>      default=1433,<br>  )<br>  parser.add_argument(<br>      &quot;--user&quot;,<br>      required=False,<br>      help=(<br>          &quot;SQL Server user for SQL Server Authentication. Omit for Windows&quot;<br>          &quot; Authentication.&quot;<br>      ),<br>  )<br>  parser.add_argument(<br>      &quot;--password&quot;,<br>      required=False,<br>      help=(<br>          &quot;User password, if not set in DMS_SQLSERVERPASSWORD environment&quot;<br>          &quot; variable. Omit for Windows Authentication.&quot;<br>      ),<br>  )<br>  parser.add_argument(<br>      &quot;--database&quot;, required=True, help=&quot;SQL Server database to connect to.&quot;<br>  )<br>  parser.add_argument(<br>      &quot;--output&quot;,<br>      required=True,<br>      help=&quot;Local folder name to save the query results.&quot;,<br>  )<br>  args = parser.parse_args()<br><br>  password = password = args.password or os.environ.get(&quot;DMS_SQLSERVERPASSWORD&quot;)<br><br>  if (args.user and not password) or (not args.user and password):<br>    parser.error(<br>        &quot;Both user and password must be provided for SQL Server Authentication.&quot;<br>        &quot; Password must be provided using the --password flag or by setting the&quot;<br>        &quot; DMS_SQLSERVERPASSWORD environment variable.&quot;<br>    )<br><br>  _execute_queries(<br>      args.host, args.port, args.database, args.output, args.user, password<br>  )<br><br>  _write_schemas(args.output)<br>  sys.exit(0)<br><br><br>if __name__ == &quot;__main__&quot;:<br>  main()</pre><h4>DMS Conversion Workspace creation and initialization (workspace_init.py)</h4><pre># Copyright 2026 Google LLC<br>#<br># Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);<br># you may not use this file except in compliance with the License.<br># You may obtain a copy of the License at<br>#<br>#     https://www.apache.org/licenses/LICENSE-2.0<br>#<br># Unless required by applicable law or agreed to in writing, software<br># distributed under the License is distributed on an &quot;AS IS&quot; BASIS,<br># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<br># See the License for the specific language governing permissions and<br># limitations under the License.<br><br>&quot;&quot;&quot;Orchestrates GCP DMS Conversion Workspace creation and initialization.<br><br>This script runs the necessary gcloud commands to:<br>1. Verify/Create GCS bucket.<br>2. Upload schema files to GCS.<br>3. Create a Conversion Workspace.<br>4. Seed the workspace with uploaded files.<br>&quot;&quot;&quot;<br><br>import argparse<br>import datetime<br>import os<br>import subprocess<br>import sys<br>import tempfile<br>import uuid<br>import yaml<br><br><br>def _run_command(cmd: list[str], description: str) -&gt; bool:<br>  &quot;&quot;&quot;Runs a command and prints output, handles failures.&quot;&quot;&quot;<br>  print(f&quot;\n[Executing] {description}...&quot;)<br>  print(f&quot;Command: {&#39; &#39;.join(cmd)}&quot;)<br>  try:<br>    # Use stdout=None, stderr=None to stream output directly to terminal<br>    subprocess.run(cmd, check=True, text=True, shell=False)<br>    print(f&quot;[Success] {description}&quot;)<br>    return True<br>  except subprocess.CalledProcessError as e:<br>    print(f&quot;[Failed] {description}&quot;)<br>    print(f&quot;Exit code: {e.returncode}&quot;)<br>    return False<br><br><br>def _check_gcloud_access(project_id: str) -&gt; bool:<br>  &quot;&quot;&quot;Checks if gcloud is authenticated and has access to the project.&quot;&quot;&quot;<br>  print(f&quot;\nChecking gcloud access to project {project_id}...&quot;)<br>  cmd = [<br>      &quot;gcloud&quot;,<br>      &quot;projects&quot;,<br>      &quot;describe&quot;,<br>      project_id,<br>      &quot;--format=value(projectId)&quot;,<br>  ]<br>  try:<br>    with tempfile.TemporaryFile(mode=&quot;w+t&quot;) as stderr_f:<br>      try:<br>        subprocess.run(<br>            cmd,<br>            stdout=subprocess.DEVNULL,<br>            stderr=stderr_f,<br>            text=True,<br>            check=True,<br>            shell=False,<br>        )<br>        print(f&quot;[Success] Gcloud access verified for project: {project_id}&quot;)<br>        return True<br>      except subprocess.CalledProcessError as e:<br>        stderr_f.seek(0)<br>        stderr_val = stderr_f.read().strip()<br>        print(f&quot;[Failed] Gcloud access check failed for project {project_id}.&quot;)<br>        print(f&quot;Error: {stderr_val}&quot;)<br>        print(&quot;\nEnsure you are logged in by running: gcloud auth login&quot;)<br>        return False<br>  except Exception as e:<br>    print(f&quot;Unexpected error during gcloud check: {e}&quot;)<br>    return False<br><br><br>def _setup_bucket(project_id: str, gcs_bucket: str, region: str) -&gt; bool:<br>  &quot;&quot;&quot;Verifies GCS bucket exists, creates it if not.&quot;&quot;&quot;<br>  bucket_url = f&quot;gs://{gcs_bucket}&quot;<br>  check_bucket_cmd = [<br>      &quot;gcloud&quot;,<br>      &quot;storage&quot;,<br>      &quot;buckets&quot;,<br>      &quot;list&quot;,<br>      bucket_url,<br>      &quot;--project&quot;,<br>      project_id,<br>  ]<br>  print(f&quot;\nChecking if bucket {bucket_url} exists...&quot;)<br>  res = subprocess.run(<br>      check_bucket_cmd,<br>      stdout=subprocess.DEVNULL,<br>      stderr=subprocess.DEVNULL,<br>      check=False,<br>      shell=False,<br>  )<br>  if res.returncode != 0:<br>    print(f&quot;Bucket {bucket_url} does not exist. Creating it...&quot;)<br>    create_bucket_cmd = [<br>        &quot;gcloud&quot;,<br>        &quot;storage&quot;,<br>        &quot;buckets&quot;,<br>        &quot;create&quot;,<br>        bucket_url,<br>        &quot;--project&quot;,<br>        project_id,<br>        &quot;--location&quot;,<br>        region,<br>    ]<br>    return _run_command(create_bucket_cmd, &quot;Create GCS Bucket&quot;)<br>  else:<br>    print(f&quot;Bucket {bucket_url} exists.&quot;)<br>    return True<br><br><br>def main():<br>  parser = argparse.ArgumentParser(<br>      description=&quot;Orchestrate DMS Conversion Workspace creation.&quot;<br>  )<br>  parser.add_argument(&quot;--config_path&quot;, required=True)<br>  parser.add_argument(&quot;--workspace_name&quot;, required=True)<br>  parser.add_argument(&quot;--workspace_resource_name&quot;, required=True)<br>  parser.add_argument(&quot;--temp_dir_path&quot;, required=True)<br><br>  args = parser.parse_args()<br><br>  # Load configuration<br>  if not os.path.exists(args.config_path):<br>    print(f&quot;ERROR: Configuration file not found at {args.config_path}&quot;)<br>    sys.exit(1)<br><br>  with open(args.config_path, &quot;r&quot;) as f:<br>    try:<br>      config = yaml.safe_load(f)<br>    except yaml.YAMLError as e:<br>      print(f&quot;ERROR: Failed to parse YAML config: {e}&quot;)<br>      sys.exit(1)<br><br>  project_id = config.get(&quot;project_id&quot;)<br>  gcs_bucket = config.get(&quot;gcs_bucket&quot;)<br>  region = config.get(&quot;region&quot;)<br>  db_type = config.get(&quot;database_type&quot;)<br>  dest_db_type = config.get(&quot;dest_db_type&quot;, &quot;POSTGRESQL&quot;)<br><br>  # Verify mandatory fields<br>  missing = []<br>  if not project_id:<br>    missing.append(&quot;project_id&quot;)<br>  if not gcs_bucket:<br>    missing.append(&quot;gcs_bucket&quot;)<br>  if not region:<br>    missing.append(&quot;region&quot;)<br>  if not db_type:<br>    missing.append(&quot;database_type&quot;)<br>  if missing:<br>    print(f&quot;ERROR: Missing required fields in config: {&#39;, &#39;.join(missing)}&quot;)<br>    sys.exit(1)<br><br>  if not _check_gcloud_access(project_id):<br>    sys.exit(1)<br><br>  db_type = db_type.upper()<br>  if db_type not in [&quot;SQLSERVER&quot;, &quot;ORACLE&quot;]:<br>    print(<br>        f&quot;ERROR: Invalid database_type in config: {db_type}. Must be SQLSERVER&quot;<br>        &quot; or ORACLE.&quot;<br>    )<br>    sys.exit(1)<br><br>  dest_db_type = dest_db_type.upper()<br>  if dest_db_type not in [&quot;POSTGRESQL&quot;, &quot;ALLOYDB&quot;]:<br>    print(<br>        f&quot;ERROR: Invalid dest_db_type in config: {dest_db_type}. Must be&quot;<br>        &quot; POSTGRESQL or ALLOYDB.&quot;<br>    )<br>    sys.exit(1)<br><br>  # 3. Upload to GCS<br>  if not _setup_bucket(project_id, gcs_bucket, region):<br>    sys.exit(1)<br><br>  bucket_url = f&quot;gs://{gcs_bucket}&quot;<br><br>  timestamp = datetime.datetime.now().strftime(&quot;%Y-%m-%d-%H-%M&quot;)<br>  random_str = uuid.uuid4().hex[:8]<br>  gcs_dest_path = f&quot;{db_type.lower()}-{timestamp}-{random_str}&quot;<br>  full_gcs_path = f&quot;{bucket_url}/{gcs_dest_path}&quot;<br><br>  print(f&quot;\nUploading files from {args.temp_dir_path} to {full_gcs_path}...&quot;)<br>  upload_cmd = [<br>      &quot;gcloud&quot;,<br>      &quot;storage&quot;,<br>      &quot;cp&quot;,<br>      f&quot;{args.temp_dir_path}/*.json&quot;,<br>      f&quot;{full_gcs_path}/&quot;,<br>      &quot;-J&quot;,<br>      &quot;--project&quot;,<br>      project_id,<br>  ]<br>  print(f&quot;Command: {upload_cmd}&quot;)<br>  try:<br>    subprocess.run(upload_cmd, shell=False, check=True)<br>    print(&quot;[Success] Upload files to GCS&quot;)<br>  except subprocess.CalledProcessError as e:<br>    print(f&quot;[Failed] Upload files to GCS. Exit code: {e.returncode}&quot;)<br>    sys.exit(1)<br><br>  # 4. Create Workspace<br>  gcloud_db_type = &quot;ORACLE&quot; if db_type == &quot;ORACLE&quot; else &quot;SQL_SERVER&quot;<br>  create_ws_cmd = [<br>      &quot;gcloud&quot;,<br>      &quot;database-migration&quot;,<br>      &quot;conversion-workspaces&quot;,<br>      &quot;create&quot;,<br>      args.workspace_resource_name,<br>      f&quot;--display-name={args.workspace_name}&quot;,<br>      f&quot;--region={region}&quot;,<br>      f&quot;--project={project_id}&quot;,<br>      f&quot;--source-database-engine={gcloud_db_type}&quot;,<br>      f&quot;--destination-database-engine={dest_db_type}&quot;,<br>      &quot;--no-async&quot;,<br>  ]<br>  if not _run_command(create_ws_cmd, &quot;Create Conversion Workspace&quot;):<br>    sys.exit(1)<br><br>  console_url = (<br>      &quot;https://console.cloud.google.com/dbmigration/conversion-workspaces/&quot;<br>      f&quot;locations/{region}/instances/{args.workspace_resource_name}/&quot;<br>      f&quot;conversion-editor?project={project_id}&quot;<br>  )<br>  print(f&quot;\nConversion Workspace Console URL: {console_url}&quot;)<br><br>  # 5. Seed Workspace<br>  seed_cmd = [<br>      &quot;gcloud&quot;,<br>      &quot;database-migration&quot;,<br>      &quot;conversion-workspaces&quot;,<br>      &quot;seed&quot;,<br>      args.workspace_resource_name,<br>      f&quot;--region={region}&quot;,<br>      f&quot;--project={project_id}&quot;,<br>      f&quot;--gcs-path={full_gcs_path}&quot;,<br>      &quot;--no-async&quot;,<br>      &quot;--auto-commit&quot;,<br>  ]<br><br>  if not _run_command(<br>      seed_cmd, &quot;Seed Conversion Workspace (may take a long time)&quot;<br>  ):<br>    sys.exit(1)<br><br>  # 6. Verify Seeding Success<br>  describe_cmd = [<br>      &quot;gcloud&quot;,<br>      &quot;database-migration&quot;,<br>      &quot;conversion-workspaces&quot;,<br>      &quot;describe&quot;,<br>      args.workspace_resource_name,<br>      f&quot;--region={region}&quot;,<br>      f&quot;--project={project_id}&quot;,<br>  ]<br>  print(<br>      &quot;\nVerifying seeding success for workspace&quot;<br>      f&quot; {args.workspace_resource_name}...&quot;<br>  )<br>  try:<br>    res = subprocess.run(<br>        describe_cmd, capture_output=True, text=True, check=True, shell=False<br>    )<br>    if &quot;has_seed_success: &#39;true&#39;&quot; in res.stdout:<br>      print(&quot;[Success] Workspace seeded successfully verified.&quot;)<br>    else:<br>      print(<br>          &quot;ERROR: There was a problem with the workspace creation/seeding&quot;<br>          &quot; operation. Seeding success could not be verified.&quot;<br>      )<br>      print(f&quot;Workspace details:\n{res.stdout}&quot;)<br>      sys.exit(1)<br>  except subprocess.CalledProcessError as e:<br>    print(f&quot;ERROR: Failed to describe conversion workspace: {e.stderr}&quot;)<br>    sys.exit(1)<br><br>  print(&quot;\n[ALL STEPS COMPLETED SUCCESSFULLY]&quot;)<br>  sys.exit(0)<br><br><br>if __name__ == &quot;__main__&quot;:<br>  main()</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a3439dc203d0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/modernizing-databases-without-live-cloud-connectivity-via-dms-a3439dc203d0">Modernizing Databases Without Live Cloud Connectivity via DMS</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DMS MCP Tool Brings Database Migrations to Gemini]]></title>
            <link>https://medium.com/google-cloud/dms-mcp-tool-brings-database-migrations-to-gemini-272d2748b199?source=rss-436e63d7b741------2</link>
            <guid isPermaLink="false">https://medium.com/p/272d2748b199</guid>
            <category><![CDATA[google-gemini]]></category>
            <category><![CDATA[cloud-migration]]></category>
            <category><![CDATA[database-migration]]></category>
            <category><![CDATA[mcp-toolbox-for-databases]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <dc:creator><![CDATA[Asaf Lev]]></dc:creator>
            <pubDate>Sun, 26 Apr 2026 10:37:17 GMT</pubDate>
            <atom:updated>2026-07-22T07:00:19.438Z</atom:updated>
            <content:encoded><![CDATA[<p>You’re in the Google Cloud Console monitoring job status, in your terminal running gcloud commands, and perhaps in a chat window trying to explain a status update to your team.</p><p>As the PM for Google Cloud Database Migration Service (DMS), my goal has always been to reduce the friction of moving workloads to the cloud. Today, we’re bringing your migration workflows directly into your AI workspace using the <strong>Model Context Protocol (MCP)</strong>.</p><h3>What is the DMS MCP Tool?</h3><p>The Model Context Protocol (MCP) is an open standard that enables AI models (like Gemini) to safely interact with external tools and data sources. By implementing an MCP server for DMS, we’ve essentially given Gemini a way to communicate with your migrations.</p><p>Instead of navigating through menus, you can now simply ask Gemini: <em>“Which of my migration jobs are still running?”</em> or <em>“Stop the sqlserver-mj-job immediately.”</em></p><h3>Getting Started: Detailed Setup</h3><p>Setting this up in your environment (like Cloud Shell) is straightforward. To enable Gemini to communicate with the DMS API, you need to create a configuration file that defines the MCP server.</p><h3>1. Create the Configuration</h3><p>Create a folder structure for the extension (e.g., .gemini/extensions/dms/) and create a gemini-extension.json file. This file tells Gemini where the DMS MCP server lives and how to authenticate.</p><p><strong>Note:</strong> The x-goog-user-project header is critical as it identifies which project should be billed for the API calls.</p><pre>{<br>  &quot;name&quot;: &quot;dms&quot;,<br>  &quot;version&quot;: &quot;1.0.0&quot;,<br>  &quot;mcpServers&quot;: {<br>    &quot;dms&quot;: {<br>      &quot;httpUrl&quot;: &quot;[https://datamigration.googleapis.com/mcp](https://datamigration.googleapis.com/mcp)&quot;,<br>      &quot;authProviderType&quot;: &quot;google_credentials&quot;,<br>      &quot;oauth&quot;: {<br>        &quot;scopes&quot;: [&quot;[https://www.googleapis.com/auth/cloud-platform]&quot;]<br>      },<br>      &quot;timeout&quot;: 30000,<br>      &quot;headers&quot;: {<br>        &quot;x-goog-user-project&quot;: &quot;your-project-id&quot;<br>      }<br>    }<br>  }<br>}</pre><h3>2. Reload and Verify</h3><p>Once your file is saved, you need to refresh Gemini’s extension registry. In your Gemini-enabled terminal, run:</p><pre>/extensions reload --all</pre><p>To verify that it is attached, type /mcp. You should see the DMS server listed as “Ready” with 8 distinct tools.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HZsY9z5qKmCoSREmeDos7g.png" /><figcaption>DMS MCP server tools</figcaption></figure><h3>1. Visibility at the speed of thought</h3><p><strong>User:</strong> “Use dms mcp tool to list my migration jobs that are still running” (you can add project name and region if you like)</p><p>Gemini will automatically identify your project context, call the list_migration_jobs tool, and present you with a clean, formatted list.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GwRyu6d34BnnLm2t3q7NRg.png" /><figcaption>Gemini CLI Permission to Execute MCP Tools</figcaption></figure><p>Once you approve, Gemini returns a clear status report of your active jobs:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/1*igjHW3h4QFQMhRHmmf6pzA.png" /><figcaption>List Running Migration Jobs using DMS MCP Tool</figcaption></figure><h3>2. Instant Action</h3><p>Suppose you notice a job that shouldn’t be running during a maintenance window. You don’t need to find its ID in the console or remember complex CLI syntax. Just tell Gemini:</p><p><strong>User:</strong> “Stop the migration job named gitit0test-5-wcstwie”</p><p>Gemini initiates the stop operation and provides you with the operation ID for tracking, all while staying within the same chat context.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4DaPi34bHGLayNAzL2mVpA.png" /><figcaption>Stop Migration Job using DMS MCP Tool</figcaption></figure><h3>Why This Matters</h3><p>This isn’t just about “cool” technology. It’s about <strong>Velocity</strong> and <strong>Focus</strong>.</p><ul><li><strong>Reduced Cognitive Load:</strong> You don’t have to remember specific CLI flags or Console navigation paths.</li><li><strong>Contextual Intelligence:</strong> Gemini understands the <em>state</em> of your migrations. It can explain why a job is in a “Starting” state or help you troubleshoot errors without you leaving the chat.</li><li><strong>Operational Safety:</strong> You still have the full power of Google Cloud’s IAM and authorization, Gemini is simply the interface, and every action requires your explicit “Allow” before execution.</li></ul><p>We are moving toward a world where managing cloud infrastructure feels like collaborating with an expert. The DMS MCP tool is a foundational piece of that vision, bringing natural language operations to the forefront of database migration management.</p><p>Ready to try it? Check out the <a href="https://docs.cloud.google.com/database-migration/docs/use-database-migration-service-mcp">official documentation</a> for a deep dive into the configuration and available tools.</p><h3>🚀 Update: Bringing DMS MCP to Antigravity</h3><p>Since the original publication of this post, Google has launched the <strong>Antigravity</strong>, which offer an evolved agent-first experience. If you are migrating your workflow from the Gemini CLI to Antigravity, setting up the DMS MCP server is just as easy, but the configuration location and syntax have changed slightly.</p><p><strong>1. Configure the MCP Server</strong></p><p>In Antigravity, MCP servers are centrally managed. Open your global MCP configuration file located at ~/.gemini/config/mcp_config.json ($HOME/.gemini/config/mcp_config.json).</p><p>Add the dms block to your mcpServers object. Note that Antigravity uses the serverUrl property instead of httpUrl:</p><pre>{<br>  &quot;mcpServers&quot;: {<br>    &quot;dms&quot;: {<br>      &quot;serverUrl&quot;: &quot;https://datamigration.googleapis.com/mcp&quot;,<br>      &quot;authProviderType&quot;: &quot;google_credentials&quot;,<br>      &quot;oauth&quot;: {<br>        &quot;scopes&quot;: [&quot;https://www.googleapis.com/auth/cloud-platform&quot;]<br>      },<br>      &quot;timeout&quot;: 30000,<br>      &quot;headers&quot;: {<br>        &quot;x-goog-user-project&quot;: &quot;your-project-id&quot;<br>      }<br>    }<br>  }<br>}</pre><p><em>(Don’t forget to replace your-project-id with the project you want billed for the API calls.)</em></p><p><strong>2. Authenticate and Verify</strong></p><ul><li><strong>In Antigravity CLI:</strong> Type /mcp in the prompt box to open the interactive MCP Manager Overlay. You should see the dms server listed. Select it, choose <strong>Authenticate</strong>, and complete the Google credentials sign-in flow in your browser.</li></ul><p>Once authenticated, your Antigravity agent will have full context of your database migrations and can seamlessly execute the same natural language commands!</p><p>Happy migrating!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=272d2748b199" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/dms-mcp-tool-brings-database-migrations-to-gemini-272d2748b199">DMS MCP Tool Brings Database Migrations to Gemini</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automating Google DMS Heterogeneous Migrations: SQL Server to AlloyDB via gCloud]]></title>
            <link>https://medium.com/google-cloud/automating-google-dms-heterogeneous-migrations-sql-server-to-alloydb-via-gcloud-8166330d67d0?source=rss-436e63d7b741------2</link>
            <guid isPermaLink="false">https://medium.com/p/8166330d67d0</guid>
            <category><![CDATA[cloud-migration]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[migration]]></category>
            <category><![CDATA[data-migration]]></category>
            <dc:creator><![CDATA[Asaf Lev]]></dc:creator>
            <pubDate>Mon, 23 Mar 2026 09:24:34 GMT</pubDate>
            <atom:updated>2026-03-25T01:14:32.523Z</atom:updated>
            <content:encoded><![CDATA[<p>Transitioning between different database systems like migrating from SQL Server to AlloyDB for PostgreSQL is an exciting opportunity to modernize your infrastructure, even if the schema conversion and data replication tasks require careful planning.</p><p>While the Google Cloud Console offers a fantastic, intuitive UI for Database Migration Service (DMS), the real power comes when teams integrate these migrations into CI/CD pipelines to achieve seamless, repeatable, and large-scale success across their entire database fleet.</p><p>Today, I want to walk you through how to fully automate a heterogeneous migration from SQL Server to AlloyDB using the gcloud CLI. We will cover everything from creating an AI-powered Conversion Workspace, converting the schema, applying it to the destination, and finally creating and starting the continuous migration job.</p><p>Let’s dive into automation!</p><h3>Prerequisites</h3><p>Before you run the automation script, you need to ensure a few foundational pieces are in place in your Google Cloud project:</p><ul><li><strong>Private Connectivity:</strong> Ensure your source and destination are reachable within your VPC.</li><li><strong>Connection Profiles:</strong> You must have already created a source connection profile (for SQL Server) and a destination connection profile (for AlloyDB).</li><li><strong>Bastion Host (Optional):</strong> If you are using Private Service Access (PSA), ensure your bastion host is configured appropriately.</li></ul><h3>Step 0: Setting the Environment</h3><p>First, let’s define our environment variables so the script is easily reusable.</p><pre>export REGION=&quot;us-central1&quot;<br>export CW=&quot;my-mssql-to-pg-workspace1&quot;<br>export SRC_CONN_PROFILE=&quot;sqlserversource&quot;<br>export DST_CONN_PROFILE=&quot;alloy-dms1&quot; <br>export MJ_NAME=&quot;my-migration-job1&quot;</pre><h3>Step 1: Create the Conversion Workspace (with AI enabled!)</h3><p>The Conversion Workspace is where the magic happens. It takes your source schema and translates it to the destination dialect. Notice the global-settings flag here we are explicitly enabling the <strong>AI Assistant</strong>, <strong>AI Conversion</strong>, and <strong>Pattern Applier</strong> to get the best automated conversion rates possible.</p><pre>echo &quot;1. Create Conversion Workspace&quot;<br>CMD=&quot;gcloud database-migration conversion-workspaces create $CW \<br> --source-database-engine=SQL_SERVER \<br> --destination-database-engine=POSTGRESQL \<br> --destination-database-provider=ALLOYDB \ <br> --region=$REGION \<br> --no-async \<br> --global-settings=&#39;aiAssistant=true,aiConversion=true,aiPatternApplier=true,cc=true&#39;&quot;<br>$CMD</pre><p><em>(Pro tip: If you want to limit the workspace to specific object types, you can update it later using — global-filter=”type=TABLE”).</em></p><h3>Step 2: Pull Schema and Objects</h3><p>Once the workspace is created, we need to extract the schema metadata from the source connection profile into the workspace.</p><pre>echo &quot;2. Seed all objects&quot;<br>CMD=&quot;gcloud database-migration conversion-workspaces seed $CW \<br> --region=$REGION \<br> --source-connection-profile=$SRC_CONN_PROFILE \<br> --no-async \<br> --auto-commit&quot;<br>$CMD</pre><h3>Optional Step: Add Mapping Rules</h3><p>Sometimes you need to apply specific transformations, such as preserving case, renaming schemas, or changing data types. You can import these rules directly via a configuration file.</p><pre>echo &quot;Optional: Add mapping rules (preserve case)&quot;<br>CMD=&quot;gcloud database-migration conversion-workspaces import-rules $CW \<br> --region=$REGION \<br> --file-format=ORA2PG \<br> --config-files=mapping_example.conf&quot;<br>$CMD</pre><p><strong><em>mapping_example.conf</em></strong></p><pre>EXPORT_SCHEMA 1<br>CASE_HANDLING PRESERVE_ORIGINAL</pre><h3>Step 3: Convert the Schema</h3><p>Now we instruct DMS to actually run the conversion logic against the seeded objects.</p><pre>echo &quot;3. Convert&quot;<br>CMD=&quot;gcloud database-migration conversion-workspaces convert $CW \<br> --region=$REGION \<br> --no-async \<br> --auto-commit&quot; <br>$CMD</pre><h3>Step 4: Apply to Destination</h3><p>Once converted, the next step is to apply the DDL (Data Definition Language) to your AlloyDB destination.</p><pre>echo &quot;4. Apply&quot;<br>CMD=&quot;gcloud database-migration conversion-workspaces apply $CW \<br> --region=$REGION \<br> --destination-connection-profile=$DST_CONN_PROFILE \<br> --no-async&quot;<br>$CMD</pre><h3>Intermission: Handling Issues Programmatically</h3><p>In the real world, heterogeneous migrations are rarely 100% perfect on the first try. You might have code that requires manual intervention. You can automate the extraction of these issues to review them offline or pass them to an AI code assistant!</p><pre># Export actions required to a text file<br>echo &quot;Exporting &#39;Action Required&#39; entities to a text file…&quot;<br>gcloud database-migration conversion-workspaces describe-issues $CW \<br> --region=$REGION \<br> --filter=&quot;conversion.status=action.required&quot; &gt; action_required.txt<br># Export error severity issues<br>echo &quot;Exporting errors to a text file…&quot;<br>gcloud database-migration conversion-workspaces describe-issues $CW \<br> --region=$REGION \<br> --filter=&quot;issue.severity=error&quot; &gt; error_desc.txt</pre><h3>Step 5: Create and Start the Migration Job</h3><p>With the schema successfully applied to AlloyDB, we can now create the actual migration job to move the data and replicate ongoing changes (CDC). We set the type to CONTINUOUS to ensure minimal downtime.</p><pre>echo &quot;5. Create Migration Job&quot;<br>CMD=&quot;gcloud database-migration migration-jobs create $MJ_NAME \<br> --region=$REGION \<br> --type=CONTINUOUS \<br> --source=$SRC_CONN_PROFILE \<br> --destination=$DST_CONN_PROFILE \<br> --conversion-workspace=$CW \<br> --no-async&quot;<br>$CMD<br>echo &quot;6. Start the migration job&quot;<br>CMD=&quot;gcloud database-migration migration-jobs start $MJ_NAME --region=$REGION&quot;<br>$CMD</pre><h3>The Complete Automation Script</h3><p>For your convenience, here is the complete, copy-pasteable bash script. Just update the variables at the top, save it as migrate.sh, make it executable (chmod +x migrate.sh), and watch DMS do the heavy lifting!</p><pre># Full automation script for Google DMS: SQL Server to AlloyDB<br><br>export REGION=&quot;us-central1&quot;<br>export CW=&quot;my-mssql-to-pg-workspace1&quot;<br>export SRC_CONN_PROFILE=&quot;sqlserversource&quot;<br>export DST_CONN_PROFILE=&quot;alloy-dms1&quot; <br>export MJ_NAME=&quot;my-migration-job1&quot;<br><br>echo &quot;========================================&quot;<br>echo &quot;1. Create Conversion Workspace&quot;<br>echo &quot;========================================&quot;<br>CMD=&quot;gcloud database-migration conversion-workspaces create $CW --source-database-engine=SQL_SERVER --destination-database-engine=POSTGRESQL --region=$REGION --no-async --global-settings=&#39;aiAssistant=true,aiConversion=true,aiPatternApplier=true,cc=true&#39;&quot;<br>echo &quot;&gt; $CMD&quot;<br>eval $CMD<br><br>echo &quot;========================================&quot;<br>echo &quot;2. Seed all objects&quot;<br>echo &quot;========================================&quot;<br>CMD=&quot;gcloud database-migration conversion-workspaces seed $CW --region=$REGION --source-connection-profile=$SRC_CONN_PROFILE --no-async --auto-commit&quot;<br>echo &quot;&gt; $CMD&quot;<br>eval $CMD<br><br># OPTIONAL: Add mappings <br># echo &quot;Optional: Add mapping rules (preserve case)&quot;<br># CMD=&quot;gcloud database-migration conversion-workspaces import-rules $CW --region=$REGION --file-format=ORA2PG --config-files=mapping_example.conf&quot;<br># echo &quot;&gt; $CMD&quot;<br># eval $CMD<br><br>echo &quot;========================================&quot;<br>echo &quot;3. Convert Schema&quot;<br>echo &quot;========================================&quot;<br>CMD=&quot;gcloud database-migration conversion-workspaces convert $CW --region=$REGION --no-async --auto-commit&quot; <br>echo &quot;&gt; $CMD&quot;<br>eval $CMD<br><br>echo &quot;========================================&quot;<br>echo &quot;4. Apply to Destination&quot;<br>echo &quot;========================================&quot;<br>CMD=&quot;gcloud database-migration conversion-workspaces apply $CW --region=$REGION --destination-connection-profile=$DST_CONN_PROFILE --no-async&quot;<br>echo &quot;&gt; $CMD&quot;<br>eval $CMD<br><br>echo &quot;========================================&quot;<br>echo &quot;Optional: Exporting Issues&quot;<br>echo &quot;========================================&quot;<br>echo &quot;&gt; Exporting &#39;action.required&#39; to action_required.txt&quot;<br>gcloud database-migration conversion-workspaces describe-issues $CW --region=$REGION --filter=&quot;conversion.status=action.required&quot; &gt; action_required.txt<br><br>echo &quot;&gt; Exporting &#39;error&#39; severity to error_desc.txt&quot;<br>gcloud database-migration conversion-workspaces describe-issues $CW --region=$REGION --filter=&quot;issue.severity=error&quot; &gt; error_desc.txt<br><br>echo &quot;========================================&quot;<br>echo &quot;5. Create Migration Job&quot;<br>echo &quot;========================================&quot;<br>CMD=&quot;gcloud database-migration migration-jobs create $MJ_NAME --region=$REGION --type=CONTINUOUS --source=$SRC_CONN_PROFILE --destination=$DST_CONN_PROFILE --conversion-workspace=$CW --no-async&quot;<br>echo &quot;&gt; $CMD&quot;<br>eval $CMD<br><br>echo &quot;========================================&quot;<br>echo &quot;6. Start the Migration Job&quot;<br>echo &quot;========================================&quot;<br>CMD=&quot;gcloud database-migration migration-jobs start $MJ_NAME --region=$REGION&quot;<br>echo &quot;&gt; $CMD&quot;<br>eval $CMD<br><br>echo &quot;Migration pipeline initialized successfully!&quot;</pre><h3>Wrapping up</h3><p>By leveraging the gCloud database-migration command group, you can take full control of your heterogeneous migrations. Whether you are running a single complex migration or building a factory to migrate hundreds of databases, automation is key to predictability and scale.</p><p>Have you tried automating your DMS pipelines yet? Let me know your thoughts or questions in the comments below!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8166330d67d0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/automating-google-dms-heterogeneous-migrations-sql-server-to-alloydb-via-gcloud-8166330d67d0">Automating Google DMS Heterogeneous Migrations: SQL Server to AlloyDB via gCloud</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Passwordless Migrations: How to Enable IAM Authentication for Google DMS Destinations]]></title>
            <link>https://medium.com/google-cloud/passwordless-migrations-how-to-enable-iam-authentication-for-google-dms-destinations-4a966ebec129?source=rss-436e63d7b741------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a966ebec129</guid>
            <category><![CDATA[database-migration]]></category>
            <category><![CDATA[data-migration]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[gcp-security-operations]]></category>
            <category><![CDATA[cloud-migration]]></category>
            <dc:creator><![CDATA[Asaf Lev]]></dc:creator>
            <pubDate>Thu, 19 Mar 2026 08:33:25 GMT</pubDate>
            <atom:updated>2026-03-22T13:33:33.669Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>By Asaf Lev | Google Cloud</strong></p><p>In my conversations with customers, I often hear that heterogeneous database migration isn’t just about moving data — it’s about modernizing your infrastructure. And part of that modernization is stepping away from outdated security practices.</p><p>When configuring a migration destination, I often hear:</p><p><em>“Asaf, I love how automated DMS is, but I still have to generate, store, and manage a static username and password for the destination database. It complicates my security reviews and adds overhead. Can’t we just use IAM?”</em></p><p>You love the reliability of DMS, but for enterprises with strict security postures, managing static database credentials for a migration tool is a friction point you want to eliminate.</p><p>Today, I want to share a streamlined, more secure approach: enabling <strong>IAM authentication</strong> for your heterogeneous migration destinations (AlloyDB and Cloud SQL for PostgreSQL) using the DMS service account.</p><p>While the Google Cloud Console UI for this specific feature is <strong>coming soon</strong>, you can unlock this passwordless workflow today using the gcloud CLI. Here is how to do it.</p><h3>Step 1: Identify your DMS Service Account</h3><p>Instead of a traditional username and password, DMS will use its Google-managed service account to authenticate with your destination database.</p><p>First, you need to identify this service account. It follows a standard format based on your Google Cloud Project Number:</p><blockquote>service-&lt;PROJECT_NUMBER&gt;@gcp-sa-datamigration.iam.gserviceaccount.com</blockquote><h3>Step 2: Add the Service Account as an IAM User</h3><p>Next, we need to tell your destination database to trust this service account.</p><ol><li>Go to your <strong>AlloyDB</strong> or <strong>Cloud SQL</strong> instance in the Google Cloud Console.</li><li>Navigate to <strong>Users</strong> -&gt; <strong>Add User</strong>.</li><li>Choose <strong>Cloud IAM</strong> authentication.</li><li>Add your DMS service account (service-&lt;PROJECT_NUMBER&gt;@…).</li></ol><h3>Step 3: Create the Passwordless Connection Profile</h3><p>Now, we can create our destination connection profile in DMS.</p><p><em>Before you begin, make sure you have downloaded or updated to the latest gcloud SDK version (version 556.0 is the first version where we have introduced this feature).</em></p><p>We are going to use a simple gcloud command to create the profile, bypassing the need for — username and — password flags entirely.</p><p>Instead, we use the magic flag:</p><pre>-- enable-iam-authentication.</pre><p>gcloud example:</p><pre># Set your variables<br>export PROJECT_ID=&quot;your-migration-project&quot;<br>export REGION=&quot;us-central1&quot;<br>export DEST_HOST=&quot;your-destination-ip-or-psc-endpoint&quot;<br>export CLUSTER_ID=&quot;your-alloydb-cluster-id&quot; # If using AlloyDB<br><br># Create the Connection Profile using IAM Auth<br>gcloud database-migration connection-profiles create postgresql my-demo-dest \<br>        --project=$PROJECT_ID \<br>        --region=$REGION \<br>        --display-name=&quot;DestinationProfile - IAM Auth&quot; \<br>        --host=$DEST_HOST \<br>        --port=5432 \<br>        --alloydb-cluster=$CLUSTER_ID \<br>        --enable-iam-authentication \<br>        --role=DESTINATION</pre><p><em>(Note: If migrating to Cloud SQL, simply omit the — alloydb-cluster flag and adjust your host accordingly).</em></p><h3>Need to Roll Back?</h3><p>Flexibility is key. If for any reason your security topology changes and you need to revert to standard authentication for an existing connection profile, you can easily update it via gcloud:</p><pre>gcloud database-migration connection-profiles update postgresql my-demo-dest \<br>        --project=$PROJECT_ID \<br>        --region=$REGION \<br>        --disable-iam-authentication \<br>        --username=&quot;your-db-user&quot; \<br>        --password=&quot;your-db-password&quot;</pre><h3>The Clean Landing</h3><p>No more hardcoded credentials in scripts, no more password rotation headaches, and much smoother security reviews.</p><p>As a PM, my goal is to make sure DMS doesn’t just “move” your database, but helps you improve your engineering and security practices along the way.</p><p>Ready to drop the passwords? Update your gcloud SDK and give IAM authentication a try for your next heterogeneous migration.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a966ebec129" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/passwordless-migrations-how-to-enable-iam-authentication-for-google-dms-destinations-4a966ebec129">Passwordless Migrations: How to Enable IAM Authentication for Google DMS Destinations</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Conversion Workspace to Code Repo: Managing Google DMS Schema & Code Exports in Git]]></title>
            <link>https://medium.com/google-cloud/from-conversion-workspace-to-code-repo-managing-google-dms-schema-code-exports-in-git-6f3559327d57?source=rss-436e63d7b741------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f3559327d57</guid>
            <category><![CDATA[cloud-migration]]></category>
            <category><![CDATA[data-migration]]></category>
            <category><![CDATA[migration]]></category>
            <category><![CDATA[database-migration]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <dc:creator><![CDATA[Asaf Lev]]></dc:creator>
            <pubDate>Sun, 22 Feb 2026 11:54:57 GMT</pubDate>
            <atom:updated>2026-02-23T04:47:44.101Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>By Asaf Lev | Google Cloud</strong></p><p>Hi everyone, I’m a Product Manager for Google Cloud’s Database Migration Service (DMS). In my conversations with customers, I often hear that heterogeneous database migration isn’t just about translating code from one engine to another. It’s about how to take the translated code in the DMS Conversion Workspace and transform it into assets that your team can manage effectively in a code repository like Git.</p><p>When you use the DMS Conversion Workspace to migrate from, say, SQL Server or Oracle to AlloyDB for PostgreSQL, the engine does the heavy lifting of converting your DDLs. But what happens next?</p><p>Typically, the output is a single conversion.sql file containing thousands of lines of CREATE, ALTER, and DROP statements, alongside an issues.log detailing conversion warnings.</p><p>If you’ve ever tried to track schema changes of this magnitude in a single file via Git, you know the pain. Code reviews become a nightmare. Finding which specific table triggered an ACTION_REQUIRED status and managing its lifecycle in your repository feels like looking for a needle in a haystack.</p><p>You loved the automated conversion of DMS, but you need more granular control to integrate those schema objects into your existing engineering workflows.</p><p>Today, I want to share a practical approach and a set of automation scripts we’ve put together. By leveraging gcloud and a custom Python/Bash splitter tool, you can automatically export your DMS conversion workspace and organize it into modular, Git-friendly assets.</p><h3>Step 1: Exporting the Workspace with gcloud</h3><p>The best way to manage your infrastructure is as code. Instead of manually downloading files from the Google Cloud Console, we can extract our Database Definition Language (DDL) and our conversion issues programmatically using the Google Cloud CLI.</p><p>We’ve created a simple script, export_dms.sh, to handle this:</p><pre># export_dms.sh<br>export REGION=&lt;CW_Region&gt;<br>export CWS=&lt;Conversion_Workspace_Name&gt;<br># Extract the conversion issues<br>gcloud database-migration conversion-workspaces describe-entities \ <br>$CWS --region=$REGION --tree-type=DRAFT &gt; issues.log<br><br># Extract the monolithic DDL<br>gcloud database-migration conversion-workspaces describe-ddls $CWS \ <br>--region=$REGION &gt; conversion.sql</pre><p>Running this script fetches two critical pieces of information:</p><ol><li><strong>conversion.sql</strong>: The single file containing all your translated schema code.</li><li><strong>issues.log</strong>: A clean, tabular view of your entities and their conversion status (e.g., NO_ISSUES vs. ACTION_REQUIRED).</li></ol><h3>Step 2: Transforming Outputs into Git-Ready Assets</h3><p>Now we have our conversion.sql output, but it’s still a single massive file. To make this manageable in your code repository, we’ve built the <strong>SQL Entity Splitter</strong> — a Python script (split_sql_entities.py) wrapped in a convenient bash script (split_sql.sh).</p><p>This tool parses the PostgreSQL dump and intelligently splits it into smaller, manageable files. It recognizes standard PostgreSQL DDL entities: Tables, Views, Functions, Procedures, Indexes, and Constraints.</p><p>We designed this with two distinct output modes to fit how your team prefers to review code in Git:</p><h4>Mode A: Individual Entity Files (The Default)</h4><p>If your team likes extreme granularity for their Git commits, the default mode isolates every single DDL statement into its own file. A table goes into one file, its primary key constraint into another, and its indexes into yet another.</p><pre>./split_sql.sh conversion.sql</pre><p><strong>The Result:</strong> A clean sqls/ directory full of atomic assets.</p><ul><li>table_dbo_categories.sql</li><li>index_pk_categories_on_dbo_categories.sql</li><li>function_custorderhist.sql</li></ul><h4>Mode B: Unified Entity Files (My Personal Favorite)</h4><p>Often, you want to review an entire logical entity at once in your Pull Requests. By passing the — unified flag, the script groups a table, its constraints, and its indexes into a single, consolidated .sql file.</p><pre>./split_sql.sh conversion.sql --unified</pre><p><strong>The Result:</strong> A <strong>sqls-unified/ directory</strong> containing comprehensive views of your database objects. For example, your unified_entity_dbo_categories.sql will elegantly package the table definition alongside its indexes and constraints:</p><pre>CREATE TABLE dbo.categories (<br> categoryid INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,<br> categoryname VARCHAR(15) NOT NULL,<br> description VARCHAR,<br> picture BYTEA<br>);<br>CREATE INDEX IF NOT EXISTS categoryname ON dbo.categories (categoryname);<br>CREATE UNIQUE INDEX IF NOT EXISTS pk_categories ON dbo.categories (categoryid);<br>ALTER TABLE dbo.categories ADD CONSTRAINT pk_categories PRIMARY KEY (categoryid);</pre><h3>Why This Matters</h3><p>By organizing your converted schema into modular assets, we are changing how your database team collaborates during a migration:</p><ul><li><strong>Painless Code Reviews:</strong> You can now open a Pull Request in Git and review the custorderhist function completely independently of the dbo.categories table.</li><li><strong>Targeted Issue Resolution:</strong> When your issues.log flags dbo.products as ACTION_REQUIRED, your engineers know exactly which asset (table_dbo_products.sql) to open, fix, and commit.</li><li><strong>Modular Deployments:</strong> You now have the flexibility to deploy specific schema objects through your CI/CD pipelines directly from your repository.</li></ul><h3>It’s All About the Clean Landing</h3><p>As a PM, my goal is to make sure DMS doesn’t just “move” your database, but helps you improve your engineering practices along the way. These scripts put the architect’s pen back in your hand, allowing you to seamlessly bridge the gap between automated schema conversion and modern, GitOps-driven deployment workflows.</p><p>The scripts — export_dms.sh, split_sql.sh, and split_sql_entities.py — are available here:</p><p><strong>export_dms.sh</strong></p><pre># export_dms.sh<br>export REGION=&lt;CW_Region&gt;<br>export CWS=&lt;Conversion_Workspace_Name&gt;<br># Extract the conversion issues<br>gcloud database-migration conversion-workspaces describe-entities \ <br>$CWS --region=$REGION --tree-type=DRAFT &gt; issues.log<br><br># Extract the monolithic DDL<br>gcloud database-migration conversion-workspaces describe-ddls $CWS \ <br>--region=$REGION &gt; conversion.sql</pre><p><strong>split_sql.sh</strong></p><pre>#!/bin/bash<br><br># Check if an SQL file is provided as an argument<br>if [ -z &quot;$1&quot; ]; then<br>  echo &quot;Usage: $0 &lt;sql_file_path&gt; [--unified] [output_directory]&quot;<br>  exit 1<br>fi<br><br>SQL_FILE=&quot;$1&quot;<br>shift # Remove the SQL_FILE from arguments<br><br># Default values<br>UNIFIED_MODE=&quot;false&quot;<br>OUTPUT_DIR=&quot;sqls&quot;<br>UNIFIED_OUTPUT_DIR=&quot;sqls-unified&quot;<br><br># Parse command-line arguments<br>while (( &quot;$#&quot; )); do<br>  case &quot;$1&quot; in<br>    --unified)<br>      UNIFIED_MODE=&quot;true&quot;<br>      shift<br>      ;;<br>    -o|--output-dir) # Allowing for explicit output directory<br>      if [ -n &quot;$2&quot; ] &amp;&amp; [ &quot;${2:0:1}&quot; != &quot;-&quot; ]; then<br>        OUTPUT_DIR=&quot;$2&quot;<br>        shift 2<br>      else<br>        echo &quot;Error: Argument for $1 is missing&quot; &gt;&amp;2<br>        exit 1<br>      fi<br>      ;;<br>    -uo|--unified-output-dir) # Allowing for explicit unified output directory<br>      if [ -n &quot;$2&quot; ] &amp;&amp; [ &quot;${2:0:1}&quot; != &quot;-&quot; ]; then<br>        UNIFIED_OUTPUT_DIR=&quot;$2&quot;<br>        shift 2<br>      else<br>        echo &quot;Error: Argument for $1 is missing&quot; &gt;&amp;2<br>        exit 1<br>      fi<br>      ;;<br>    *) # Preserve other arguments for future expansion or Python script<br>      ARGS_FOR_PYTHON+=(&quot;$1&quot;)<br>      shift<br>      ;;<br>  esac<br>done<br><br># Reconstruct args for python script<br>PYTHON_ARGS=(&quot;$SQL_FILE&quot;)<br><br>if [ &quot;$UNIFIED_MODE&quot; = &quot;true&quot; ]; then<br>  PYTHON_ARGS+=(&quot;--unified&quot;)<br>  PYTHON_ARGS+=(&quot;--unified_output_dir&quot; &quot;$UNIFIED_OUTPUT_DIR&quot;)<br>else<br>  PYTHON_ARGS+=(&quot;--output_dir&quot; &quot;$OUTPUT_DIR&quot;)<br>fi<br><br># Ensure the Python script is in the same directory or specify its path<br>PYTHON_SCRIPT=&quot;./split_sql_entities.py&quot;<br><br># Execute the Python script<br>python3 &quot;$PYTHON_SCRIPT&quot; &quot;${PYTHON_ARGS[@]}&quot;<br><br>if [ $? -eq 0 ]; then<br>  if [ &quot;$UNIFIED_MODE&quot; = &quot;true&quot; ]; then<br>    echo &quot;SQL file &#39;$SQL_FILE&#39; successfully split into unified entities in &#39;$UNIFIED_OUTPUT_DIR/&#39;&quot;<br>  else<br>    echo &quot;SQL file &#39;$SQL_FILE&#39; successfully split into individual entities in &#39;$OUTPUT_DIR/&#39;&quot;<br>  fi<br>else<br>  echo &quot;Error: Failed to split SQL file.&quot;<br>fi</pre><p><strong>split_sql_entities.py</strong></p><pre><br>import os<br>import re<br>import argparse<br><br>def split_sql_file(sql_file_path, output_dir=&quot;sqls&quot;, unified_mode=False, unified_output_dir=&quot;sqls-unified&quot;):<br>    &quot;&quot;&quot;<br>    Splits a PostgreSQL SQL file into individual files for each database entity<br>    or groups related entities into unified files.<br><br>    Args:<br>        sql_file_path (str): The path to the input SQL file.<br>        output_dir (str): The directory for individual SQL files (default mode).<br>        unified_mode (bool): If True, groups related entities into unified files.<br>        unified_output_dir (str): The directory for unified SQL files (unified mode).<br>    &quot;&quot;&quot;<br>    if unified_mode:<br>        target_output_dir = unified_output_dir<br>    else:<br>        target_output_dir = output_dir<br><br>    if not os.path.exists(target_output_dir):<br>        os.makedirs(target_output_dir)<br>        print(f&quot;Created output directory: {target_output_dir}&quot;)<br><br>    with open(sql_file_path, &#39;r&#39;) as f:<br>        sql_content = f.read()<br><br>    entity_patterns = [<br>        (re.compile(r&#39;CREATE\s+SCHEMA\s+(?:IF\s+NOT\s+EXISTS\s+)?((?:&quot;[^&quot;]+&quot;|[\w]+)(?:\.(?:&quot;[^&quot;]+&quot;|[\w]+))?)&#39;, re.IGNORECASE | re.DOTALL), &quot;schema&quot;, 1, None),<br>        (re.compile(r&#39;CREATE\s+(?:OR\s+REPLACE\s+)?FUNCTION\s+((?:&quot;[^&quot;]+&quot;|[\w]+)(?:\.(?:&quot;[^&quot;]+&quot;|[\w]+))?)(?:\s*\(.*?\))?&#39;, re.IGNORECASE | re.DOTALL), &quot;function&quot;, 1, None),<br>        (re.compile(r&#39;CREATE\s+VIEW\s+((?:&quot;[^&quot;]+&quot;|[\w]+)(?:\.(?:&quot;[^&quot;]+&quot;|[\w]+))?)(?:\s*\(.*?\))?\s+AS&#39;, re.IGNORECASE | re.DOTALL), &quot;view&quot;, 1, None),<br>        (re.compile(r&#39;CREATE\s+TABLE\s+((?:&quot;[^&quot;]+&quot;|[\w]+)(?:\.(?:&quot;[^&quot;]+&quot;|[\w]+))?)\s*\(&#39;, re.IGNORECASE | re.DOTALL), &quot;table&quot;, 1, None),<br>        (re.compile(r&#39;CREATE\s+(?:TEMPORARY|TEMP)\s+TABLE\s+((?:&quot;[^&quot;]+&quot;|[\w]+)(?:\.(?:&quot;[^&quot;]+&quot;|[\w]+))?)\s*\(&#39;, re.IGNORECASE | re.DOTALL), &quot;temp_table&quot;, 1, None),<br>        (re.compile(r&#39;CREATE\s+SEQUENCE\s+((?:&quot;[^&quot;]+&quot;|[\w]+)(?:\.(?:&quot;[^&quot;]+&quot;|[\w]+))?)&#39;, re.IGNORECASE | re.DOTALL), &quot;sequence&quot;, 1, None),<br>        (re.compile(r&#39;CREATE\s+(?:OR\s+REPLACE\s+)?PROCEDURE\s+((?:&quot;[^&quot;]+&quot;|[\w]+)(?:\.(?:&quot;[^&quot;]+&quot;|[\w]+))?)(?:\s*\(.*?\))?&#39;, re.IGNORECASE | re.DOTALL), &quot;procedure&quot;, 1, None),<br>        (re.compile(r&#39;CREATE\s+TRIGGER\s+((?:&quot;[^&quot;]+&quot;|[\w]+)(?:\.(?:&quot;[^&quot;]+&quot;|[\w]+))?)\s+ON\s+((?:&quot;[^&quot;]+&quot;|[\w]+)(?:\.(?:&quot;[^&quot;]+&quot;|[\w]+))?)&#39;, re.IGNORECASE | re.DOTALL), &quot;trigger&quot;, 1, 2),<br>        (re.compile(r&#39;DROP\s+TABLE\s+(?:IF\s+EXISTS\s+)?((?:&quot;[^&quot;]+&quot;|[\w]+)(?:\.(?:&quot;[^&quot;]+&quot;|[\w]+))?)&#39;, re.IGNORECASE | re.DOTALL), &quot;drop_table&quot;, 1, None),<br>        (re.compile(r&#39;CREATE\s+(?:UNIQUE\s+)?INDEX\s+(?:IF\s+NOT\s+EXISTS\s+)?((?:&quot;[^&quot;]+&quot;|[\w]+)(?:\.(?:&quot;[^&quot;]+&quot;|[\w]+))?)\s+ON\s+((?:&quot;[^&quot;]+&quot;|[\w]+)(?:\.(?:&quot;[^&quot;]+&quot;|[\w]+))?)&#39;, re.IGNORECASE | re.DOTALL), &quot;index&quot;, 1, 2),<br>        (re.compile(r&#39;ALTER\s+TABLE\s+((?:&quot;[^&quot;]+&quot;|[\w]+)(?:\.(?:&quot;[^&quot;]+&quot;|[\w]+))?)\s+ADD\s+CONSTRAINT\s+((?:&quot;[^&quot;]+&quot;|[\w]+)(?:\.(?:&quot;[^&quot;]+&quot;|[\w]+))?)&#39;, re.IGNORECASE | re.DOTALL), &quot;alter_constraint&quot;, 1, 2)<br>    ]<br><br>    # --- Parsing Phase ---<br>    parsed_entities = [] # Stores (start_index, entity_type, entity_name, related_to, content)<br><br>    for pattern_re, entity_type, name_idx1, name_idx2 in entity_patterns:<br>        for match in pattern_re.finditer(sql_content):<br>            name1_raw = match.group(name_idx1)<br>            name1 = name1_raw.replace(&#39;&quot;&#39;, &#39;&#39;).strip()<br>            entity_display_name = name1<br>            related_to = None<br><br>            base_name = name1.rstrip(&#39;;&#39;)<br><br>            if name_idx2:<br>                name2_raw = match.group(name_idx2)<br>                name2 = name2_raw.replace(&#39;&quot;&#39;, &#39;&#39;).strip()<br>                if entity_type == &quot;index&quot;:<br>                    entity_display_name = f&quot;{name1}_on_{name2.replace(&#39;.&#39;, &#39;_&#39;)}&quot;<br>                    related_to = name2<br>                elif entity_type == &quot;alter_constraint&quot;:<br>                    entity_display_name = f&quot;{name1.replace(&#39;.&#39;, &#39;_&#39;)}_constraint_{name2}&quot;<br>                    related_to = name1 # The table being altered<br><br>            # Extract actual content for this entity.<br>            # This is a bit tricky without a full SQL parser.<br>            # For now, we take from match.start() to the end of the statement (semicolon heuristic)<br>            # or until the next entity starts.<br><br>            # Find the actual end of the DDL statement using semicolon heuristic<br>            statement_end = -1<br>            temp_content = sql_content[match.start():]<br>            <br>            # Special handling for functions to find $$;<br>            if entity_type == &quot;function&quot;:<br>                func_end_match = re.search(r&quot;\$\$;&quot;, temp_content, re.IGNORECASE | re.DOTALL)<br>                if func_end_match:<br>                    statement_end = match.start() + func_end_match.end()<br>            <br>            if statement_end == -1: # For non-functions or if $$; not found<br>                # Find the first semicolon after the current match, but not inside comments<br>                # This is a very basic heuristic.<br>                semicolon_match = re.search(r&quot;;&quot;, temp_content)<br>                if semicolon_match:<br>                    statement_end = match.start() + semicolon_match.end()<br>                else:<br>                    statement_end = len(sql_content) # If no semicolon, take till end of file/next entity<br><br>            entity_content = sql_content[match.start():statement_end].strip()<br>            <br>            parsed_entities.append({<br>                &#39;start_index&#39;: match.start(),<br>                &#39;type&#39;: entity_type,<br>                &#39;display_name&#39;: entity_display_name,<br>                &#39;base_name&#39;: name1, # The primary name of the entity<br>                &#39;related_to&#39;: related_to,<br>                &#39;content&#39;: entity_content<br>            })<br><br>    parsed_entities.sort(key=lambda x: x[&#39;start_index&#39;])<br><br>    if unified_mode:<br>        # --- Grouping Logic for Unified Mode ---<br>        unified_blocks = {} # Key: primary_entity_name (e.g., &#39;dbo.categories&#39;), Value: list of contents<br><br>        for entity in parsed_entities:<br>            entity_type = entity[&#39;type&#39;]<br>            base_name = entity[&#39;base_name&#39;] # The name of the current entity (e.g., index name, table name)<br>            content = entity[&#39;content&#39;]<br>            related_to = entity[&#39;related_to&#39;] # The name of the parent entity if applicable<br><br>            # Determine the key for grouping.<br>            # If an entity is related to a parent, use the parent&#39;s name as the key.<br>            # Otherwise, use its own base_name.<br>            grouping_key = base_name<br>            if related_to:<br>                grouping_key = related_to<br>            <br>            # Special handling for schemas as they are top-level and don&#39;t have a &#39;related_to&#39;<br>            # but we want them grouped by their own name.<br>            if entity_type == &quot;schema&quot;:<br>                grouping_key = base_name<br><br>            if grouping_key not in unified_blocks:<br>                unified_blocks[grouping_key] = []<br>            <br>            # Decide where to place the content in the block<br>            # DROP statements for a specific object should come before its CREATE statement.<br>            # Other DDLs usually come after CREATE.<br>            if entity_type.startswith(&#39;drop_&#39;):<br>                unified_blocks[grouping_key].insert(0, content) # Prepend<br>            else:<br>                unified_blocks[grouping_key].append(content) # Append<br><br>        # --- Output Unified Files ---<br>        for base_name, contents in unified_blocks.items():<br>            full_content = &quot;\n\n&quot;.join(contents)<br>            save_entity_to_file(<br>                full_content, <br>                &quot;unified_entity&quot;, # A generic type for unified files<br>                base_name, <br>                target_output_dir, <br>                {} # No need for entity_map for unified, assuming unique base_names<br>            )<br><br>    else:<br>        # --- Output Individual Files (Current Behavior) ---<br>        entity_map = {} # To keep track of counts for duplicate filenames<br>        for entity in parsed_entities:<br>            save_entity_to_file(<br>                entity[&#39;content&#39;], <br>                entity[&#39;type&#39;], <br>                entity[&#39;display_name&#39;], <br>                target_output_dir, <br>                entity_map<br>            )<br><br><br>def save_entity_to_file(content, entity_type, entity_name, output_dir, entity_map):<br>    &quot;&quot;&quot;<br>    Saves a single SQL entity or a unified block to a file.<br>    &quot;&quot;&quot;<br>    clean_entity_name = re.sub(r&#39;[^a-zA-Z0-9_]&#39;, &#39;&#39;, entity_name).lower()<br>    base_name = f&quot;{entity_type}_{clean_entity_name}&quot;<br>    <br>    count = entity_map.get(base_name, 0)<br>    entity_map[base_name] = count + 1<br>    if count &gt; 0:<br>        file_name = f&quot;{base_name}_{count}.sql&quot;<br>    else:<br>        file_name = f&quot;{base_name}.sql&quot;<br><br>    output_path = os.path.join(output_dir, file_name)<br>    with open(output_path, &#39;w&#39;) as out_f:<br>        out_f.write(content.strip())<br>        if not content.strip().endswith(&#39;;&#39;):<br>            out_f.write(&#39;;&#39;)<br>        out_f.write(&#39;\n&#39;)<br>    print(f&quot;Saved {entity_type} &#39;{entity_name}&#39; to {output_path}&quot;)<br><br>if __name__ == &quot;__main__&quot;:<br>    parser = argparse.ArgumentParser(description=&quot;Split a PostgreSQL SQL file into individual or unified entity files.&quot;)<br>    parser.add_argument(&quot;sql_file_path&quot;, help=&quot;The path to the input SQL file.&quot;)<br>    parser.add_argument(&quot;--output_dir&quot;, default=&quot;sqls&quot;, help=&quot;Directory for individual SQL files (default mode).&quot;)<br>    parser.add_argument(&quot;--unified&quot;, action=&quot;store_true&quot;, help=&quot;Enable unified grouping mode.&quot;)<br>    parser.add_argument(&quot;--unified_output_dir&quot;, default=&quot;sqls-unified&quot;, help=&quot;Directory for unified SQL files (unified mode).&quot;)<br>    <br>    args = parser.parse_args()<br><br>    if not os.path.exists(args.sql_file_path):<br>        print(f&quot;Error: SQL file not found at {args.sql_file_path}&quot;)<br>        sys.exit(1)<br><br>    split_sql_file(<br>        args.sql_file_path, <br>        output_dir=args.output_dir, <br>        unified_mode=args.unified, <br>        unified_output_dir=args.unified_output_dir<br>    )</pre><p>The best way to understand technology isn’t just by reading documentation — it’s by getting your hands dirty. Try running the splitter against your next conversion workspace export, and let me know how it improves your repository management!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f3559327d57" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/from-conversion-workspace-to-code-repo-managing-google-dms-schema-code-exports-in-git-6f3559327d57">From Conversion Workspace to Code Repo: Managing Google DMS Schema &amp; Code Exports in Git</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Hidden Google Cloud Advantage: Master Database Migration for Free]]></title>
            <link>https://medium.com/google-cloud/the-hidden-google-cloud-advantage-master-database-migration-for-free-346209ad01ef?source=rss-436e63d7b741------2</link>
            <guid isPermaLink="false">https://medium.com/p/346209ad01ef</guid>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[data-migration]]></category>
            <category><![CDATA[database-migration]]></category>
            <category><![CDATA[cloud-migration]]></category>
            <category><![CDATA[migration]]></category>
            <dc:creator><![CDATA[Asaf Lev]]></dc:creator>
            <pubDate>Sat, 07 Feb 2026 16:32:41 GMT</pubDate>
            <atom:updated>2026-02-09T02:57:01.296Z</atom:updated>
            <content:encoded><![CDATA[<p>The best way to understand technology isn’t just by reading documentation — it’s by getting your hands dirty.</p><p>But let’s be honest: setting up a personal sandbox for cloud experimentation can be intimidating, especially when you’re worried about accidental costs or complex configurations.</p><p>That’s why I’m so excited to share a “pro-tip” that many professionals overlook: <strong>Google Cloud Skills Boost/Google Skills</strong>.</p><h3>The Hidden Gem: 35 Free Credits Every Month (Google Skills free tier)</h3><p>Before we dive into the lab, here is the real kicker. Did you know that the <a href="https://www.skills.google/subscriptions">Google Skills free tier</a> provides <strong>35 free credits every single month</strong>?</p><p>In a world where everything seems to be moving to a subscription model, having a recurring pool of credits to run actual hands-on labs at no cost is a massive advantage for anyone looking to up skill. Here is how the credit math works:</p><ul><li><strong>Introductory Labs:</strong> 1 credit (You could do 35 of these!)</li><li><strong>Intermediate Labs:</strong> 5 credits (Perfect for a deep dive)</li></ul><p>Today, I want to highlight a landmark new lab that is a total game-changer for database modernization.</p><h3>The Spotlight: Migrate from Cloud SQL for SQL Server to AlloyDB using DMS</h3><p>If you’ve ever dealt with “database lock-in,” you know the pain of moving from proprietary T-SQL (SQL Server) to an open-source compatible engine like PostgreSQL. Historically, this meant weeks of manual code rewriting and schema mapping.</p><p>This <a href="https://www.skills.google/focuses/146110?parent=catalog">Intermediate Migrate from Cloud SQL for SQL Server to AlloyDB for PostgreSQL using Database Migration Service Lab</a> shows you how to do it in hours, not weeks.</p><p><strong>Why this lab is different:</strong></p><p>It moves beyond simple data moving. In this lab, you’ll actually:</p><ol><li><strong>Execute a SQL Server to PostgreSQL Migration:</strong> Move a live database from <strong>Cloud SQL for SQL Server</strong> to <strong>AlloyDB for PostgreSQL</strong>.</li><li><strong>AI-Assisted Conversion:</strong> Use the <strong>DMS Conversion Workspace powered by Gemini</strong> to automatically fix incompatible code and explain the changes.</li><li><strong>Achieve Minimal-Downtime:</strong> Run a continuous migration job that keeps the source and destination in sync until the final cutover.</li></ol><h3>Why it Matters</h3><p>Modernizing legacy stacks is one of the highest-value activities a team can undertake, but the risk of downtime or “lost in translation” code often holds us back.</p><p>Understanding how <strong>Database Migration Service (DMS)</strong> uses AI to remediate schema issues is a superpower. It allows building more aggressive modernization roadmaps and helps bypass the “legacy toolchain” headache.</p><p><strong>The best part?</strong> Since this is an intermediate lab, it costs only <strong>5 credits</strong>. With your 35 monthly free credits, you can master the AI-driven database migration and still have 30 credits left to explore other parts of the Google Cloud ecosystem.</p><h3>Ready to boost your skills?</h3><p>Stop reading and start building. Use your monthly credit refresh to tackle this milestone lab today. It’s self-paced, hands-on, and — if you play your cards right — completely free.</p><p><a href="https://www.skills.google/focuses/146110?parent=catalog"><strong>Check out the Lab here!</strong></a></p><p><em>What other databases are you looking to migrate? Let me know in the comments!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=346209ad01ef" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/the-hidden-google-cloud-advantage-master-database-migration-for-free-346209ad01ef">The Hidden Google Cloud Advantage: Master Database Migration for Free</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Connecting DMS to Cloud SQL & AlloyDB on Private Service Access (PSA)]]></title>
            <link>https://medium.com/google-cloud/connecting-dms-to-cloud-sql-alloydb-on-private-service-access-psa-0a81c3f14482?source=rss-436e63d7b741------2</link>
            <guid isPermaLink="false">https://medium.com/p/0a81c3f14482</guid>
            <category><![CDATA[gcp-security-operations]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[database-migration]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[data-migration]]></category>
            <dc:creator><![CDATA[Asaf Lev]]></dc:creator>
            <pubDate>Mon, 02 Feb 2026 19:46:54 GMT</pubDate>
            <atom:updated>2026-02-03T02:42:39.540Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>By Asaf Lev</strong> | Google Cloud</p><p>Hi everyone, I’m a Product Manager for Google Cloud’s Database Migration Service (DMS).</p><p>In my<a href="https://medium.com/google-cloud/simplicity-meets-security-migrate-private-databases-with-google-dms-and-private-service-connect-353fae8a51b1"> previous posts</a>, I’ve talked about how <strong>Private Service Connect (PSC) Interface</strong> is changing the game for secure source database connectivity in heterogeneous migrations. It allows you to keep your traffic private and secure without the operational headaches of managing VPC Peering limits or complex VPN tunnels.</p><p>In my conversations with customers, I often hear a specific challenge regarding connectivity. It usually sounds something like this:</p><p><em>“Asaf, I want to use the secure connectivity method in DMS (Private Service Connect), but my destination Cloud SQL or AlloyDB instance is already configured with standard Private IP (PSA). I can’t change my database networking right now. How do I connect them?”</em></p><p>This is a very common scenario. <strong>Private Service Access (PSA)</strong> is the standard setup for many enterprises — it allows you to consume services on your own private IP addresses. However, when you want to migrate data <em>into</em> these instances using DMS, you might feel stuck between wanting the modern, serverless connectivity of DMS and the reality of your existing PSA network architecture.</p><p>I want to share a streamlined method to connect DMS to your existing PSA-based Cloud SQL or AlloyDB instances. We will use a lightweight <strong>Bastion (Proxy)</strong> to establish a secure path, ensuring you can migrate data without changing your database’s networking standard.</p><h3>The Challenge: Connecting to Private IP (PSA)</h3><p>Your destination database sits in a VPC (often a Shared VPC) and is reachable only via a private IP address (e.g., 10.218.208.3). DMS needs to reach this IP to write data.</p><p>We want to achieve this connectivity with two goals:</p><ol><li><strong>Private-Only Access:</strong> Keeping the database entirely shielded from the public web.</li><li><strong>Modular Connectivity:</strong> Leveraging endpoint-based connections to integrate DMS seamlessly. This preserves the independence of your corporate network.</li></ol><h3>The Solution: The Proxy Bridge Pattern</h3><p>To bridge the gap between DMS and your PSA database, we can deploy a small, temporary “Producer” network.</p><ol><li><strong>The Bastion Proxy:</strong> We create a small VM that acts as a bridge. It has two network interfaces:</li></ol><ul><li><strong>Interface A:</strong> Sits in an isolated network dedicated to DMS &amp; Cloud SQL / AlloyDB for PostgreSQL.</li><li><strong>Interface B:</strong> Sits in your existing VPC (or Shared VPC) where the database lives.</li></ul><p><strong>2. SOCKS Forwarding:</strong> The VM runs a standard SOCKS proxy (Dante) to forward traffic from DMS (Interface A) to your Database Private IP (Interface B).</p><p>This setup allows DMS to “tunnel” securely to your database without requiring you to reconfigure your existing PSA setup.</p><h3>Automating the Setup</h3><p>I’ve put together a script to automate this entire “Proxy Bridge” creation. It handles the networking, the VM creation, and the SOCKS configuration in one go.</p><p>Save the following code as setup_bastion.sh:</p><pre>#!/bin/bash<br>PROJECT_ID=dms-service-conn    # Your Service Project (where resources are created)<br>HOST_PROJECT_ID=dms-host-conn  # Your Host Project (where the DB network lives) if your network set up is not under shared VPC set it to the same value as PROJECT_ID<br>REGION=us-central1 # Choose your region <br>BASTION=dms-bastion # Name the VM for the bastion <br>ZONE=us-central1-a # Zone of the VM <br>DB_SUBNETWORK=dms-shared-subnet # The subnet where your Cloud SQL/AlloyDB resides<br>DB_SUBNETWORK_GATEWAY=10.20.0.1 # The gateway of the DB subnet<br>CLOUD_SQL_INSTANCE_PRIVATE_IP=10.218.208.3 # Your Target DB Private IP<br>PORT=5432 # 5432 for Postgres<br>DMS_PSC_CIDR=10.1.0.0/16<br><br># 1. Create a local VPC network for the PSC/Bastion infrastructure<br>gcloud compute networks create dms-psc-vpc \<br>--project=$PROJECT_ID \<br>--subnet-mode=custom<br><br># 2. Create a subnet for the bastion&#39;s primary interface<br>gcloud compute networks subnets create dms-psc-$REGION \<br>--project=$PROJECT_ID \<br>--range=10.0.0.0/16 --network=dms-psc-vpc \<br>--region=$REGION<br><br># 3. Create Cloud Router &amp; NAT (Required for the bastion to download packages)<br>gcloud compute routers create ex-router-$REGION \<br>--network dms-psc-vpc \<br>--project=$PROJECT_ID \<br>--region=$REGION<br><br>gcloud compute routers nats create ex-nat-$REGION \<br>--router=ex-router-$REGION \<br>--auto-allocate-nat-external-ips \<br>--nat-all-subnet-ip-ranges \<br>--enable-logging \<br>--project=$PROJECT_ID \<br>--region=$REGION<br><br># Cleanup any old local temporary script file<br>rm -f bastion_startup.sh<br><br># -----------------------------------------------------------------------------<br># DYNAMIC STARTUP SCRIPT GENERATION<br># -----------------------------------------------------------------------------<br>cat &lt;&lt;EOF &gt; bastion_startup.sh<br>#!/bin/bash<br><br># Route the private IP address using the gateway of the database subnetwork.<br>ip route add $CLOUD_SQL_INSTANCE_PRIVATE_IP via $DB_SUBNETWORK_GATEWAY<br><br># Install Dante SOCKS server.<br>apt-get update &amp;&amp; apt-get install -y dante-server<br><br># Create the Dante configuration file.<br>touch /etc/danted.conf<br>touch /proxy.log<br><br># Configure Dante<br>cat &gt; /etc/danted.conf &lt;&lt; DANTE_CONF<br>logoutput: /proxy.log<br>user.privileged: proxy<br>user.unprivileged: nobody<br><br>internal: 0.0.0.0 port = $PORT<br>external: ens5<br><br>clientmethod: none<br>socksmethod: none<br><br>client pass {<br>        from: 0.0.0.0/0<br>        to: 0.0.0.0/0<br>        log: connect error disconnect<br>}<br>client block {<br>        from: 0.0.0.0/0<br>        to: 0.0.0.0/0<br>        log: connect error<br>}<br>socks pass {<br>        from: 0.0.0.0/0<br>        to: $CLOUD_SQL_INSTANCE_PRIVATE_IP/32<br>        protocol: tcp<br>        log: connect error disconnect<br>}<br>socks block {<br>        from: 0.0.0.0/0<br>        to: 0.0.0.0/0<br>        log: connect error<br>}<br>DANTE_CONF<br><br># Start the Dante server.<br>systemctl restart danted<br>tail -f /proxy.log<br>EOF<br># -----------------------------------------------------------------------------<br><br># 4. Create the dual-homed Bastion VM<br># Notice the two --network-interface flags. <br># One connects to our local dms-psc-vpc (for DMS access).<br># The other connects to the HOST PROJECT subnet (for DB access).<br>gcloud compute instances create $BASTION \<br>    --project=$PROJECT_ID \<br>    --zone=$ZONE \<br>    --image-family=debian-11 \<br>    --image-project=debian-cloud \<br>    --network-interface subnet=dms-psc-$REGION,no-address \<br>    --shielded-secure-boot \<br>    --shielded-vtpm \<br>    --shielded-integrity-monitoring \<br>    --network-interface subnet=projects/$HOST_PROJECT_ID/regions/$REGION/subnetworks/$DB_SUBNETWORK,no-address \<br>    --metadata-from-file=startup-script=bastion_startup.sh<br><br># 5. Create the Target Instance (Load Balancer Backend)<br>gcloud compute target-instances create bastion-ti-$REGION \<br>--instance=$BASTION \<br>--project=$PROJECT_ID \<br>--instance-zone=$ZONE \<br>--network=dms-psc-vpc<br><br># 6. Create Internal Forwarding Rule<br>gcloud compute forwarding-rules create dms-psc-forwarder-$REGION \<br>--project=$PROJECT_ID \<br>--region=$REGION \<br>--load-balancing-scheme=internal \<br>--network=dms-psc-vpc \<br>--subnet=dms-psc-$REGION \<br>--ip-protocol=TCP \<br>--ports=all \<br>--target-instance=bastion-ti-$REGION \<br>--target-instance-zone=$ZONE<br><br># 7. Create PSC NAT Subnet (Required for Service Attachments)<br>gcloud compute networks subnets create dms-psc-nat-$REGION-tcp \<br>--network=dms-psc-vpc \<br>--project=$PROJECT_ID \<br>--region=$REGION \<br>--range=$DMS_PSC_CIDR \<br>--purpose=private-service-connect<br><br># 8. Create the Service Attachment<br>gcloud compute service-attachments create dms-psc-svc-att-$REGION \<br>--project=$PROJECT_ID \<br>--region=$REGION \<br>--producer-forwarding-rule=dms-psc-forwarder-$REGION \<br>--connection-preference=ACCEPT_AUTOMATIC \<br>--nat-subnets=dms-psc-nat-$REGION-tcp<br><br># 9. Create Firewall Rule to allow PSC traffic<br>gcloud compute \<br>--project=$PROJECT_ID firewall-rules create dms-allow-psc-tcp \<br>--direction=INGRESS \<br>--priority=1000 \<br>--network=dms-psc-vpc \<br>--action=ALLOW \<br>--rules=all \<br>--source-ranges=$DMS_PSC_CIDR \<br>--enable-logging<br><br># Print the result<br>echo &quot;Setup Complete. Use this Service Attachment URI in DMS:&quot;<br>gcloud compute service-attachments describe dms-psc-svc-att-$REGION \<br>--project=$PROJECT_ID \<br>--region=$REGION \<br>--format=&quot;value(selfLink)&quot;</pre><h3>Run the Script</h3><p><strong>Important:</strong> Make sure you update the variables at the top of the script with your specific details (IPs, project IDs, and subnets) and run it.</p><pre>chmod +x setup_bastion.sh<br>./setup_bastion.sh</pre><p>Once the script finishes, it will output a <strong>Service Attachment URI</strong>.</p><h3>Configure DMS (on the service project)</h3><p>Now that our “adapter” is running, we can configure the Database Migration Service.</p><ol><li>Go to the <strong>Database Migration Service</strong> in the Google Cloud Console.</li><li>Create a new <strong>Connection Profile</strong>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RdcQXQnbDlxL-i92osA2DQ.png" /><figcaption>Figure 1 — Create connection profile</figcaption></figure><p>3. Defining the connection profile <strong>Destination</strong>, select your Cloud SQL or AlloyDB instance.</p><p>4. On the connection details make sure to override the “Hostname or IP address” with the <strong>bastion VM</strong> IP address</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BZi6wnEOJcKY2fBkQCq6Tg.png" /><figcaption>Figure 2 — Connection profile: PostgreSQL connection details</figcaption></figure><p>5. Make sure to select under the Connectivity method: “Private IP” and select the newly created (part of the attached script) “Service attachment name”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZH6TBnow8DFU4sOoMj5ypQ.png" /><figcaption>Figure 3 — Connectivity method and service attachment set up</figcaption></figure><p>6. Test the connection</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OSCDhc3K_VM5S_mEuJ0hkw.png" /><figcaption>Figure 4 — Test connection profile</figcaption></figure><p><strong>Creating the destination connection profile with gcloud</strong></p><pre>gcloud database-migration connection-profiles create postgresql demo-psa \<br>    --region=[REGION] \<br>    --display-name=&quot;Demo PSA&quot; \<br>    --cloudsql-instance=[Cloud SQL Instance] \<br>    --username=[USERNAME] \<br>    --password=[PASSWORD] \<br>    --hostname=[BASTION VM IP] \<br>    --port=5432 \<br>--psc-service-attachment=projects/[PROJECT-ID]/regions/[REGION]/serviceAttachments/dms-psc-svc-att-us-[REGION]<br>    --role=DESTINATION</pre><h3>Why this works</h3><p>By using this method, DMS connects to the Service Attachment in the isolated VPC. The traffic is load-balanced to the bastion, which then uses its second network interface (the “leg” in the Shared VPC) to route traffic directly to your database’s Private IP.</p><p>This setup keeps your database purely on Private IP while giving you all the security and management benefits of PSC for the migration data path.</p><p>Happy Migrating!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0a81c3f14482" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/connecting-dms-to-cloud-sql-alloydb-on-private-service-access-psa-0a81c3f14482">Connecting DMS to Cloud SQL &amp; AlloyDB on Private Service Access (PSA)</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your Schema, Your Rules: Control Database Migrations with New Directives]]></title>
            <link>https://medium.com/google-cloud/your-schema-your-rules-control-database-migrations-with-new-directives-c257613e9699?source=rss-436e63d7b741------2</link>
            <guid isPermaLink="false">https://medium.com/p/c257613e9699</guid>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[cloud-migration]]></category>
            <category><![CDATA[database-migration]]></category>
            <category><![CDATA[data-migration]]></category>
            <dc:creator><![CDATA[Asaf Lev]]></dc:creator>
            <pubDate>Sun, 07 Dec 2025 12:12:38 GMT</pubDate>
            <atom:updated>2025-12-08T08:50:22.688Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>By Asaf Lev | Google Cloud</strong></p><p>Hi everyone, I’m a Product Manager for Google Cloud’s Database Migration Service (DMS).</p><p>In my conversations with customers, I often hear that migration isn’t just about “lifting and shifting” data. It’s often the perfect opportunity to clean the house. But sometimes, “cleaning house” causes more problems than it solves.</p><p>You’ve told me: <em>“My legacy application is hardcoded to query tables in UPPERCASE. If DMS converts everything to lowercase by default, my app breaks. I need the destination to look exactly like the source.”</em></p><p>Previously, achieving this level of customization required post-migration scripting. You loved the reliability of DMS, but you needed more granular control over how your schema objects land in the destination.</p><p>That’s why I am thrilled to announce a comprehensive new set of <strong>Directives</strong> for DMS. We are moving beyond simple table replacements to give you total control over <strong>Case Handling</strong>, <strong>Renaming</strong>, and <strong>Moving</strong> almost every object in your database.</p><h3>1. The end of the case sensitivity struggle</h3><p>One of the most frequent friction points in heterogeneous migrations is case sensitivity. By default, DMS converts your schema to lowercase to align with PostgreSQL standards. While standard unquoted SQL is generally forgiving, this conversion becomes a critical blocker for applications, ORMs, and tools that rely on <strong>quoted identifiers</strong>.</p><p>In some environments, generated SQL often wraps identifiers in quotes (e.g., SELECT “FOO” FROM “BAR”). When migrated to a lowercase PostgreSQL schema, these strictly case-sensitive queries break instantly. You shouldn’t have to reconfigure your SQL generators or rewrite application code just to move your database.</p><p>We are announcing a global, intuitive directive: <strong>CASE_HANDLING</strong>. This directive allows you to set the rules for the entire conversion job. If your app relies on quoted identifiers and needs the destination to mirror the source casing exactly, you can now enforce that with a single line.</p><ul><li><strong>Syntax:</strong> CASE_HANDLING:&lt;UPPERCASE | LOWERCASE | PRESERVE_ORIGINAL&gt;</li></ul><p><strong>See it in action:</strong> To ensure your PostgreSQL schema retains the exact casing of your Oracle source (keeping your legacy apps happy):</p><pre>CASE_HANDLING PRESERVE_ORIGINAL</pre><h3>2. Rename everything — and keep your code working</h3><p>Migration is the best time to fix typo-ridden table names, confusing legacy identifiers, or simply to adopt a new naming convention. However, renaming objects usually comes with a risk: breaking the business logic that depends on them.</p><p><strong>This is where DMS stands apart.</strong> While other tools might simply rename a table or column, DMS performs <strong>intelligent code resolution</strong>. When you rename or move an object using our RENAME_* directives, we automatically parse and update your target code objects (stored procedures, views, functions, packages) to reference the new names/locations. You get a cleaner schema <em>and</em> functional code.</p><p>We now support renaming almost every database object:</p><ul><li><strong>Tables &amp; columns:</strong> (RENAME_TABLES, RENAME_COLUMNS)</li><li><strong>Logic:</strong> (RENAME_FUNCTIONS, RENAME_STORED_PROCEDURES, RENAME_TRIGGERS, RENAME_PACKAGES)</li><li><strong>Structures:</strong> (RENAME_VIEWS, RENAME_MATERIALIZED_VIEWS, RENAME_SEQUENCES, RENAME_USER_DEFINED_TYPES)</li></ul><h4>Standardizing your naming conventions</h4><p>It’s not just about avoiding errors; it’s about readability. Legacy databases often have column names like C_NM or DT_CRT. With RENAME_COLUMNS, you can expand these to customer_name and created_date during the migration, making your new database self-documenting.</p><p>Similarly, you might want to rename views to differentiate them from tables explicitly.</p><pre>EXPORT_SCHEMA 1<br>SCHEMA Sales<br><br># Clarify column names<br>RENAME_COLUMNS Orders.DT_CRT:created_date Orders.C_NM:customer_name<br><br># Standardize View names<br>RENAME_VIEWS Q1_RPT:view_q1_report</pre><h4>Spotlight: Solving package collisions with RENAME_PACKAGES</h4><p>I want to dive deeper into one specific directive that solves a potential headache for Oracle to PostgreSQL migrations: <strong>RENAME_PACKAGES</strong>.</p><p>In Oracle, packages are namespaces. You can easily have a package named UTILS inside the SALES schema, and another package named UTILS inside the HR schema. They are completely distinct objects: SALES.UTILS and HR.UTILS.</p><p>However, when you migrate to PostgreSQL, since PostgreSQL does not have an equivalent package functionality and in order to maintain the structure of the code name, DMS converts the packages into specific schemas. If you try to map both of these simply to utils, you get a <strong>naming collision</strong>. The conversion fails, or worse, one overwrites the other.</p><p>Previously, you had to manually refactor your code before migrating. Now, you can fix this directly in the DMS mapping.</p><p><strong>The scenario:</strong> You have two source packages that conflict:</p><ol><li>SALES.REPORTING_PKG</li><li>HR.REPORTING_PKG</li></ol><p><strong>The solution:</strong> Use RENAME_PACKAGES to assign them distinct, descriptive names in the destination.</p><pre>EXPORT_SCHEMA 1<br><br># Rename the Sales package to be distinct<br>RENAME_PACKAGES SALES.REPORTING_PKG:SALES_REPORTING_PKG<br><br># Rename the HR package to be distinct<br>RENAME_PACKAGES HR.REPORTING_PKG:HR_REPORTING_PKG</pre><p>RENAME_PACKAGES HR.REPORTING_PKG:HR_REPORTING_PKG</p><p><strong>The result:</strong> DMS reads the directive and automatically transforms all references.</p><ul><li>Calls to SALES.REPORTING_PKG.calculate_revenue become sales_reporting_pkg.calculate_revenue.</li><li>Calls to HR.REPORTING_PKG.calculate_bonus become hr_reporting_pkg.calculate_bonus.</li></ul><p>You get a clean, conflict-free PostgreSQL database without touching a single line of source code.</p><h3>3. Reorganize logic and sata with MOVE_*</h3><p>Sometimes you don’t just want to rename an object; you want to change where it lives. If you are consolidating five different source schemas into a single public schema in Cloud SQL, or splitting a monolith into microservice schemas, the new <strong>MOVE_*</strong> directives are your best friend.</p><p>We’ve expanded this beyond just tables. You can now move logic and views to new schemas as well.</p><ul><li><strong>Directives:</strong> MOVE_TABLES, MOVE_VIEWS, MOVE_SEQUENCES, MOVE_STORED_PROCEDURES, MOVE_FUNCTIONS, MOVE_USER_DEFINED_TYPES, MOVE_MATERIALIZED_VIEWS.</li></ul><h4>Organizing your logic</h4><p>A common pattern I see is customers wanting to separate their data from their business logic. You might want all your tables in a data schema, but all your stored procedures in an api schema.</p><p><strong>See it in action:</strong></p><pre>EXPORT_SCHEMA 1<br>SCHEMA LegacyApp<br><br># Move tables to a &#39;data&#39; schema<br>MOVE_TABLES Users:data Orders:data<br><br># Move Stored Procedures to an &#39;api&#39; schema<br>MOVE_STORED_PROCEDURES CreateUser:api ProcessOrder:api<br><br># Move Views to a &#39;reporting&#39; schema<br>MOVE_VIEWS SalesSummary:reporting</pre><p>This capability allows you to fundamentally re-architect your application’s backend structure during the migration itself, rather than treating it as a separate, painful project.</p><h3>It’s all about the clean landing</h3><p>As a PM, my goal is to make sure DMS doesn’t just “move” your database, but helps you <strong>improve</strong> it. These new directives put the architect’s pen back in your hand, allowing you to define exactly what your target database looks like — clean, organized, and modern.</p><p>Whether you are fixing casing, resolving package collisions, or completely re-architecting your schema layout, these tools are built to make your heterogeneous migration seamless.</p><p>Let us know what you think!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c257613e9699" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/your-schema-your-rules-control-database-migrations-with-new-directives-c257613e9699">Your Schema, Your Rules: Control Database Migrations with New Directives</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simplicity Meets Speed: Expanding One-Time Migrations to Heterogeneous Workloads in Google DMS]]></title>
            <link>https://medium.com/google-cloud/simplicity-meets-speed-expanding-one-time-migrations-to-heterogeneous-workloads-in-google-dms-8da0ceab2d8a?source=rss-436e63d7b741------2</link>
            <guid isPermaLink="false">https://medium.com/p/8da0ceab2d8a</guid>
            <category><![CDATA[database]]></category>
            <category><![CDATA[data-migration]]></category>
            <category><![CDATA[cloud-migration]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Asaf Lev]]></dc:creator>
            <pubDate>Thu, 13 Nov 2025 14:49:17 GMT</pubDate>
            <atom:updated>2025-11-16T12:36:55.541Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>By Asaf Lev | Google Cloud</strong></p><p>Hi everyone, I’m a Product Manager for Google Cloud’s Database Migration Service (DMS). In my conversations with customers, I often hear about the need for robust, continuous replication for mission-critical applications. We’ve built DMS to excel at that — keeping your source and destination in sync via Change Data Capture (CDC) until you’re ready to cut over with minimal downtime.</p><p>But recently, I’ve been hearing a different story. Some of you have told me: <em>“Asaf, I just want to move a development database or a specific schema. I don’t need the complexity of CDC, and I definitely don’t want to reconfigure my source database just to move it.”</em></p><p>You love the reliability of DMS, but for scenarios where downtime is acceptable, fulfilling the prerequisites for continuous replication — like enabling ARCHIVELOG on Oracle or configuring change tables on SQL Server — can be a major blocker.</p><p>That’s why I am thrilled to announce that we are expanding our <strong>One-Time Migration</strong> capability to support <strong>heterogeneous migrations</strong>.</p><p>Previously available only for homogeneous MySQL migrations, this functionality is now coming to your cross-engine migrations.</p><p>With One-Time Migration, we are introducing a straightforward “dump and load” workflow. Unlike a Continuous job that captures ongoing changes, this new mode strictly performs a full dump of your source data and loads it into the destination.</p><p>It is not a storage snapshot and it is not a backup file restoration; it is a managed data extraction and load process that transitions directly from “Full Dump” to “Ready to Promote”, bypassing the CDC replication phase entirely.</p><h3>Breaking the CDC Barrier</h3><p>The biggest advantage of this new mode is <strong>Simplicity</strong>. By removing the need for CDC, we remove the friction associated with it.</p><ul><li><strong>No CDC Prerequisites:</strong> You no longer need to configure logging on your source. This is huge for databases where it’s just a development database without the storage needed for transaction logs or for databases where enabling logging implies a performance penalty.</li><li><strong>Support for “Unsupported” Sources:</strong> We can now support sources that simply <em>cannot</em> do CDC.</li><li><strong>Oracle:</strong> Migrate databases not configured with ARCHIVELOG (common in test environments).</li><li><strong>SQL Server:</strong> Migrate databases that CDC cannot be enabled or configured.</li><li><strong>Unlock Complex Data Types:</strong> Some data types are difficult or impossible to replicate via CDC logs. With a One-Time Migration, we can read these directly from the table and copy them across.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yrM8rSSM7f5Gvs9H-vfFQQ.gif" /><figcaption>One-Time Migration in Action</figcaption></figure><h3>🤔 When is a One-Time Migration a good fit?</h3><p>“One-Time” Migrations assume that no changes are happening on the source during the process, as it does not guarantee point-in-time consistency across active tables. It is the perfect tool for:</p><ul><li><strong>Development and Test Environments:</strong> Quickly set up non-production environments where downtime is not a concern.</li><li><strong>Locked-Down Sources:</strong> When you cannot enable the necessary logging/permissions required for CDC on the source database.</li><li><strong>Non-Critical Applications:</strong> Ideal for internal tools that can tolerate a planned outage during the load window.</li><li><strong>Data Warehousing/Archiving:</strong> Moving static datasets where ongoing synchronization isn’t required.</li></ul><h3>It’s all about the right tool for the job</h3><p>As a PM, there’s nothing more satisfying than giving customers the flexibility to choose the path that fits their specific needs. Your team shouldn’t have to configure complex replication pipes or struggle with ARCHIVELOG or CDC settings for a simple development database move.</p><p>We are committed to making DMS the comprehensive solution for <em>all</em> your migration needs, whether that’s a zero-downtime move for a global app or a quick, barrier-free dump and load for your heterogeneous workloads.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8da0ceab2d8a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/simplicity-meets-speed-expanding-one-time-migrations-to-heterogeneous-workloads-in-google-dms-8da0ceab2d8a">Simplicity Meets Speed: Expanding One-Time Migrations to Heterogeneous Workloads in Google DMS</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simplicity Meets Security: Migrate Private Databases with Google DMS and Private Service Connect…]]></title>
            <link>https://medium.com/google-cloud/simplicity-meets-security-migrate-private-databases-with-google-dms-and-private-service-connect-353fae8a51b1?source=rss-436e63d7b741------2</link>
            <guid isPermaLink="false">https://medium.com/p/353fae8a51b1</guid>
            <category><![CDATA[migration]]></category>
            <category><![CDATA[database-migration]]></category>
            <category><![CDATA[data-migration]]></category>
            <category><![CDATA[cloud-migration]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <dc:creator><![CDATA[Asaf Lev]]></dc:creator>
            <pubDate>Thu, 30 Oct 2025 20:40:18 GMT</pubDate>
            <atom:updated>2025-11-03T03:02:11.606Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Simplicity Meets Security: Migrate Private Databases with Google DMS and Private Service Connect Interface (PSC Interface)</strong></h3><p>Hi everyone, I’m a Product Manager for Google Cloud’s Database Migration Service (DMS), and I want to share a story about a challenge I’ve heard from many of you — and the new, simpler way we’ve built to solve it.</p><h3>The Private Connectivity Challenge</h3><p>I’ve had countless conversations with customers who are ready to migrate their critical Oracle or SQL Server databases, but they encountered a common hurdle. Not with the database logic, but with the network.</p><p>Their most important databases are — rightfully so — locked down, hosted privately in their VPC or on-premises. To connect DMS, they were faced with a list of complex options:</p><ul><li><strong>VPC Peering:</strong> This works, but often fails if your network’s IP ranges overlap with the DMS service’s ranges, forcing a costly re-architecting.</li><li><strong>VPN Tunnels:</strong> These are effective but add operational overhead. You have to configure them, maintain them, and worry about their stability.</li><li><strong>Reverse SSH Tunnels:</strong> This is a complex, brittle setup that many security teams are not comfortable with.</li></ul><blockquote>One customer described it perfectly: “We spent more time getting the network connectivity approved and configured than on the actual migration itself. It just felt too complex for what we wanted to achieve.”</blockquote><p>This wasn’t a one-off story. We heard this feedback time and time again. You love the simplicity of DMS, but you need a simple and secure way to connect to your private sources.</p><h3>Our Solution: A Secure, Private-Only Connection</h3><p>That’s why I am so thrilled to announce a major enhancement: <strong>general availability of Private Service Connect (PSC) Interfaces for heterogeneous migrations of Oracle and SQL Server sources.</strong></p><p>This powerful feature allows DMS to establish a secure, private, and direct connection to your source database’s private IP address from the DMS service, without ever exposing your database to the public internet.</p><figure><img alt="Migration networking example: private IP source connectivity with Private Service Connect interfaces and Cloud VPN for sources that reside in other cloud offerings." src="https://cdn-images-1.medium.com/max/1024/1*m3IGSe-vfe-TlkigA-PLmg.png" /><figcaption><em>Migration networking example: private IP source connectivity with Private Service Connect interfaces and Cloud VPN for sources that reside in other cloud offerings.</em></figcaption></figure><p>It uses a Private Service Connect interface in the DMS (producer) network to connect to a service attachment in your (consumer) VPC. All traffic stays within the Google Cloud network, providing producer-initiated communication that is secure by default.</p><h3>What this really means for you</h3><p>By moving beyond complex tunnels and peering, we’re changing how you manage your private migrations.</p><ul><li><strong>Enhance Your Security Posture:</strong> Keep your critical source databases completely private. All migration traffic stays within the Google Cloud network, with no need to expose anything to the public internet.</li><li><strong>Simplify Network Configuration:</strong> No need to configure and maintain VPNs and SSH tunnels. PSC provides a streamlined, Google-managed private connection that is far simpler to set up.</li><li><strong>Avoid IP Overlap Conflicts:</strong> PSC Interfaces do not require non-overlapping IP ranges, making it far easier to connect DMS to your existing network infrastructure.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_x8WR2qZyY4V-MsMPH4TwA.gif" /><figcaption>DMS Private Connectivity via PSC Interface in Action</figcaption></figure><h3>Available now for your key migrations</h3><p>PSC Interface connectivity is now enabled and generally available for migrations from your private Oracle and SQL Server sources, including:</p><ul><li><strong>Oracle</strong> (Self-hosted in Google Cloud VPC, or on-premises via Interconnect/VPN)</li><li><strong>SQL Server</strong> (Self-hosted in Google Cloud VPC, or on-premises via Interconnect/VPN)</li></ul><h3>It’s all about focusing on what matters</h3><p>As a PM, there’s nothing more satisfying than shipping a feature that removes a major roadblock for our customers. Your team should be focused on your data and your migration, not on managing network plumbing.</p><p>Ready to simplify your private database migrations with this new level of security and simplicity? Explore our documentation to learn how to configure PSC Interfaces for your sources today.</p><ul><li><a href="https://cloud.google.com/database-migration/docs/oracle-to-alloydb/networking-methods-source#private-connectivity-psci">Networking for Oracle to AlloyDB for PostgreSQL migrations</a></li><li><a href="https://cloud.google.com/database-migration/docs/oracle-to-postgresql/networking-methods-source#private-connectivity-psci">Networking for Oracle to PostgreSQL migrations</a></li><li><a href="https://cloud.google.com/database-migration/docs/sqlserver-to-alloydb/networking-methods-source#private-connectivity-psci">Networking for SQL Server to AlloyDB for PostgreSQL migrations</a></li><li><a href="https://cloud.google.com/database-migration/docs/sqlserver-to-csql-pgsql/networking-methods-source#private-connectivity-psci">Networking for SQL Server to PostgreSQL migrations</a></li></ul><p>The Private Service Connect (PSC) interface can also be created using the gcloud command-line tool. A step-by-step guide for this process is provided below.</p><pre># Create Network Attachment <br>gcloud compute network-attachments create al-dms-test \<br>    --region=&lt;REGION&gt; \<br>    --subnets=&lt;SUBNET&gt; \<br>    --connection-preference=ACCEPT_AUTOMATIC<br><br>gcloud database-migration private-connections create al-oracle-dms-psc \<br> --region=&lt;REGION&gt; \<br> --display-name=al-oracle-dms-psc \ --network-attachment=projects/&lt;PROJECT_ID&gt;/regions/&lt;REGION&gt;/networkAttachments/al-dms-test \<br> --validate-only<br><br># returns the operation ID:  <br>projects/&lt;PROJECT_ID&gt;/locations/&lt;REGION&gt;/operations/&lt;OP_ID&gt;<br><br># Query the operation ID and check if created it&#39;s<br>gcloud database-migration operations describe projects/&lt;PROJECT_ID&gt;/locations/&lt;REGION&gt;/operations/&lt;OP_ID&gt; --region=&lt;REGION&gt;<br><br># Create private connectivity that is poining out the the network attachment<br>gcloud database-migration private-connections create al-oracle-dms-psc-pc \<br> --region=&lt;REGION&gt; \<br> --display-name=al-oracle-dms-psc-pc \<br>--network-attachment=projects/&lt;PROJECT_ID&gt;/regions/&lt;REGION&gt;/networkAttachments/al-dms-test \<br># Required for Shared VPC <br> --skip-validation<br><br>#returns an operation ID, check if created / done<br>gcloud database-migration operations describe &lt;OPERATION_ID&gt; --region=&lt;REGION&gt;<br><br># Once created you can now create the Connection Profile and use the newly created PSC Interface for it&#39;s private connectivity</pre><p>Let us know what you think!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=353fae8a51b1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/simplicity-meets-security-migrate-private-databases-with-google-dms-and-private-service-connect-353fae8a51b1">Simplicity Meets Security: Migrate Private Databases with Google DMS and Private Service Connect…</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>