Docs Menu
Docs Home
/
Relational Migrator
/

Connect to SQL Server

On this page

  • About this Task
  • Steps
  • Database Connection String
  • Connect to SQL Server
  • Learn More

This page shows how to save a new SQL Server connection from the Connections page. You can use a saved connection for any Relational Migrator task that requires connecting to a database.

To save a new SQL Server connection in Relational Migrator, you must:

  • Identify your database connection string or database information.

  • Connect to SQL Server.

Important

To plan your migration and map your SQL Server schema to a MongoDB schema, you must connect using an account with the correct read permissions.

To migrate data, you must connect to your SQL Server database using a service account with the required permissions.

For information on database configuration and required permissions, see Configure SQL Server.

The SQL Server connection string looks like:

jdbc:sqlserver://[serverName[\instanceName][:portNumber]][;property=value[;property=value]]

For example, the test SQL Server database running on localhost at port 1433 uses the following connection string:

jdbc:sqlserver://localhost:1433;databaseName=test

To enable Windows Integrated Authentication, add integratedSecurity=true; to the URI options. Leave the Username and Password fields blank. Windows Integrated Authentication connects to the database using the credentials of the user who launched the Relational Migrator executable.

JDBC connections to SQL Server use Transport Layer Security (TLS) by default. The encrypt property controls TLS. To disable it, set encrypt=false;. When TLS is enabled, the driver tries to validate the server's certificate by default. To implicitly trust the server certificate, set trustServerCertificate=true;.

Note

To learn more about SQL Server connection strings, see:

  • Setting Connection Properties

  • SQL Docs: Building the Connection URL.

  • Connecting to SQL Server with the JDBC Driver

In a SQL Server connection string, use the databaseName property to specify the database to connect to. If you omit the databaseName property, the connection still succeeds but you can only see objects in the default dbo schema in all databases.

If you specify the databaseName property, you can see tables from all schemas within the specified database.

1

In the list of Relational connections, click + Add connection.

2

In the Database type drop-down, select SQL Server.

3
  1. Above JDBC URI, enable the Enter URI manually toggle.

  2. Paste your connection string into the JDBC URI.

4
Field
Value

Host

The host IP or DNS name.

Port

The port number.

Database

The database name. If blank, you only see objects in the default dbo schema in all databases.

Authentication

By default, this is set to SQL Server. Set to Windows to enable Windows Integrated Authentication, using the credentials of the user who launched the Relational Migrator executable. This disables the Username and Password fields.

Username and Password

The credentials to use for authentication. Disabled if Authentication is set to Windows.

Checking Save password saves the password securely on your machine, so you don't have to enter the Username and Password again when using the saved connection.

General / SSL toggle

View SSL settings for the connection.

To use SSL, you must first uncomment and update the server.ssl configuration properties in your user.properties file.

SSL: Use SSL

Enable or disable SSL.

SSL: Trust server certificate

With SSL enabled, check this to trust the stored certificate. Leave unchecked to verify the server certificate against a trusted Certificate Authority.

5

Enter a Connection name and optional Environment tag.

Environment tags color code and organize connections for convenience. Leaving the drop-down empty is the same as selecting the "None" tag.

6

Relational Migrator attempts to authenticate and connect to the database.

7

The saved connection is available for use in all jobs and projects.

  • Relational Migrator relies on the open-source Debezium connector to capture row-level changes. For more details, see Debezium MySQL.

Back

Configure PostgreSQL