Connecting to Source database
Spanner migration tool allows users to connect to the source database via three connection mechanisms:
- Directly connect to source database.
- Use a database dump.
- Load a session file.
Table of contents
Connect to Database
In this connection mechanism the user needs to first select the type of source database engine and then specify the source database connection details like host, port, username , password and database name. Currently, Spanner Migration Tool UI supports the following source databases - MySQL, PostgreSQL, Oracle and SQLServer. User also needs to specify the spanner dialect, it specifies the query language used. Spanner provides support for two dialects - Google Standard SQL and PostgreSQL.
Sharded migrations
Spanner migration tool supports sharded database migrations for MySQL source database. The procedure to connect to the source database is identical to a non-sharded migration, with minor differences:
- Select
MySQL
as the source database. - Select
Yes
in the form field for this migration being a sharded migration. - Enter the connection details of the schema source of your sharded MySQL database. Please refer to the linked page to understand Spanner migration tool specific terminology for sharded migrations.
- Click Test connection.
- If the connection is successful, click on connect to proceed.
Users can connect to local, cloud and on-prem instances.
Load database dump
The user needs to generate a dump of their source database and then provide a path to the generated dump file in the input along with the type of database engine. Spanner Migration Tool supports dump file migration for MySQL and PostgreSQL. User also needs to specify the spanner dialect, it specifies the query language used. Spanner provides support for two dialects - Google Standard SQL and PostgreSQL. Dump files for MySQL and PostgreSQL can be generated by using mysqldump and pg_dump commands respectively. Please note that the dump file should be present in the same machine on which Spanner Migration Tool is running.
Load session file
In cases where the user would want to save the schema modifications and come back to them later , for instance in case of complex databases or if multiple users are working on the same database they can do so with the help of session files. Users just need to select the database engine and specify the file path for the saved session file to resume the migration process. Please note that the session file should be present in the same machine on which Spanner Migration Tool is running.