Skip to content

Commit 51ac518

Browse files
DOCSP-39033 Database Connection Management (#178)
* Topic stubs * Rebuild * Rebuild * Copy edits * Draft * Tabbed procedure * Wording and syntax * Rendering fix * Checking link rendering * Rendering * Rendering check * Rendering * Rendering * Formatting * Test connection step * Partial tabbing * Tabs * Whitespace * Typo * Typo * Whitespace * Wording from sync job to migration job * self hosted wording to on premises * Step nesting * Typo fix * Rendering check after splitting out service user procedure * Wording and indentation fixes * Fixed permissions typo * Fixed broken syntax example * Rendering test for step includes * Moved credentials into table includes for clarity * Clarified Atlas cluster steps * Indentation * Removed unused file, updated relational connection topic * Copy edits * Updated SQL fields with database field behavior * Updated wording * Changed markup to procedure * Updated ref to saved relational connection * Copy edits * Tab UI copy edits * Removed extra step in includes * Fixed orphaned topic * Moved SSL steps into settings tables * SSL cert field descriptions * SSL cert field descriptions * SSL cert field descriptions * Pointed users towards SSL config properties * Copy edits * Updated a ref to be more specific * Updated saved password behavior * External review feedback * Updated overview screenshot * Updated summaries of when users create new connections * Removed Atlas tab from the include version of MDB connection steps * Fixing build warning * Consistent wording * Cleaned up connect step * Iconography * Fixing some ref line breaks * Clarified effect of deleting a relational connection * Clarified effect of deleting a relational connection * Clarified effect of deleting a relational connection * Note around available database types for existing projects * Updated relational connection management to point out use case for staging to prod environments * Internal review feedback * Fixed broken link * Rebuild after merging in upstream * Fixed a few lingering mentions of sync jobs * Updated UI description for connection bar * Internal review feedback
1 parent 2ea7b17 commit 51ac518

30 files changed

+927
-321
lines changed

snooty.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ toc_landing_pages = [
1818
"installation/install-on-an-unattended-server/rhel-centos-server-installation/rhel-centos-server-installation",
1919
"installation/kafka-deployments/migrator-with-kafka",
2020
"installation/file-location",
21+
"database-connections/database-connections",
2122
"projects/projects",
2223
"mapping-rules/mapping-rules",
2324
"mapping-rules/mapping-rule-options/mapping-rule-options",

source/connection-strings/connection-strings.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ Connection Strings
1010
:depth: 1
1111
:class: singlecol
1212

13-
Relational Migrator uses connection strings to connect to both
13+
Database connections use connection strings to connect to both
1414
the relational and MongoDB databases. You can create connection strings:
1515

16+
- Using the UI when you create a MongoDB or relational :ref:`Database Connection <rm-database-connections>`.
1617
- Using the UI when you create a project.
1718
- Using the UI when you create a migration job.
1819
- By manually providing the Uniform Resource Identifier (URI).

source/connection-strings/mongodb-database-connection-strings.txt

Lines changed: 23 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -12,129 +12,45 @@ MongoDB Database Connection Strings
1212

1313
.. include:: /includes/uri-usage-disclaimer.rst
1414

15-
To start a migration job, Relational Migrator must connect to your MongoDB
16-
database. Relational Migrator requires a username and password which has ``readWrite``
17-
access in the target database. This page describes
18-
the procedure to make an authenticated user account and the Uniform Resource
19-
Identifier (URI) formats for defining connections to your target
20-
MongoDB database.
15+
This page describes the Uniform Resource Identifier (URI) formats for defining
16+
connections to your MongoDB database.
2117

22-
About this Task
23-
---------------
18+
Relational Migrator supports all connection string options except
19+
:urioption:`appName`. It overrides ``appName`` when connecting to your MongoDB
20+
deployment. For details on MongoDB connection string options, see
21+
:manual:`Connection Strings <mongodb-uri>`.
2422

25-
- Relational Migrator supports all connection string options except
26-
:urioption:`appName`. Relational Migrator overrides the ``appName``
27-
connection string option when connecting to your MongoDB deployment.
28-
For details on MongoDB connection string options, see
29-
:ref:`<mongodb-uri>`.
23+
MongoDB User
24+
------------
3025

31-
- Relational Migrator can use both Atlas and on-premises URIs. This page
32-
provides separate instructions for each deployment type.
26+
For both Atlas and on-premises deployments, create a separate
27+
:ref:`MongoDB user <rm-mongodb-service-user>` for Relational Migrator with
28+
:authrole:`readWrite` access to your MongoDB database.
3329

34-
Atlas
35-
-----
36-
37-
Connect to Your Deployment
38-
~~~~~~~~~~~~~~~~~~~~~~~~~~
39-
40-
To provision user accounts in Atlas you need to be
41-
`logged in to the Atlas GUI <https://cloud.mongodb.com/v2/>`__.
42-
43-
Create a New User
44-
~~~~~~~~~~~~~~~~~
45-
46-
#. In the :guilabel:`Security` section of the left navigation, click :guilabel:`Database Access`.
47-
#. Click :guilabel:`Add New Database User`.
48-
#. In the :guilabel:`Authentication Method` section of the :guilabel:`Add New Database User` modal window, select the box labeled :guilabel:`Password`.
49-
#. Under :guilabel:`Password Authentication`, enter the username ``migrator-service`` for the new user in the top text field.
50-
#. Enter the password ``password`` for the new user in the lower text field.
51-
#. Under :guilabel:`Database User Privileges`, click :guilabel:`Built-in Role`.
52-
#. Select :guilabel:`Read and write to any database`.
53-
#. Click :guilabel:`Add User`.
54-
55-
Connection URI
56-
~~~~~~~~~~~~~~
57-
58-
Using the previously created account credentials, format the connection
59-
URI for the target database. In this case ``MongoEnterprises``.
60-
61-
.. code-block::
62-
63-
mongodb+srv://migrator-service:[email protected]/MongoEnterprises
64-
65-
On-Premises
66-
-----------
67-
68-
In this example, use ``mongosh`` to provision a user account that
69-
connects to the ``MongoEnterprises`` database.
70-
71-
This examples assume your deployment is running on ``localhost`` and the
72-
default port of ``27017``.
73-
74-
Connect to Your Deployment
75-
~~~~~~~~~~~~~~~~~~~~~~~~~~
76-
77-
When connecting to your deployment, your user account requires the
78-
`createRole <https://www.mongodb.com/docs/manual/reference/method/db.createRole/>`__
79-
permission in both the ``admin`` and ``MongoEnterprises`` databases.
80-
Copy the following code with your admin credentials into a terminal to
81-
connect to your deployment with ``mongosh``.
30+
Atlas Connection URI
31+
--------------------
8232

8333
.. code-block::
8434

85-
mongosh "mongodb://myadminuser:myadminpassword@localhost:27017/admin"
35+
mongodb+srv://username:[email protected]/database
8636

87-
For details on ``mongosh`` connections see :
88-
`Connecting to your MongoDB Deployment <https://www.mongodb.com/docs/mongodb-shell/connect/>`__.
89-
90-
Create a New User
91-
~~~~~~~~~~~~~~~~~
92-
93-
In ``mongosh``, run the following command to create a
94-
user in the ``admin`` database:
37+
For example, to use an account named ``migrator-service`` to connect to the
38+
``MongoEnterprises`` database:
9539

9640
.. code-block::
9741

98-
use admin
99-
100-
db.createUser(
101-
{ user: "migrator-service",
102-
pwd: "password",
103-
roles:[{role: "readWrite" , db:"MongoEnterprises"}]
104-
}
105-
)
42+
mongodb+srv://migrator-service:[email protected]/MongoEnterprises
10643

107-
Create the same user in the user in the ``MongoEnterprises`` database:
44+
On-Premises Connection URI
45+
--------------------------
10846

10947
.. code-block::
11048

111-
use MongoEnterprises
112-
db.createUser(
113-
{ user: "migrator-service",
114-
pwd: "password",
115-
roles:[{role: "readWrite" , db:"MongoEnterprises"}]
116-
}
117-
)
118-
119-
These commands:
120-
121-
- Create a new user ``migrator-service`` with the password ``password``
122-
in the ``admin`` and ``MongoEnterprises`` databases.
123-
- Apply the ``readWrite`` system role to the ``MongoEnterprises``
124-
database for the user ``migrator-service``.
49+
mongodb://username:password@host:port/database
12550

126-
Connection URI
127-
~~~~~~~~~~~~~~
128-
129-
Using the previously created account credentials, format the connection
130-
URI for the target database. In this case ``MongoEnterprises``.
51+
For example, to use an account named ``migrator-service`` to connect to the
52+
``MongoEnterprises`` database:
13153

13254
.. code-block::
13355

134-
mongodb://migrator-service:password@localhost:27017/MongoEnterprises
135-
136-
Results
137-
-------
138-
139-
The MongoDB connection URI is optionally specified as part of the process for
140-
creating a Relational Migrator project or when creating a migration job.
56+
mongodb://migrator-service:password@localhost:27017/MongoEnterprises

source/connection-strings/relational-database-connection-strings.txt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ Relational Migrator's connection form contains fields where you can specify a
3131
username and password for the connection. The form obscures passwords
3232
and is more secure than specifying plaintext credentials in the URI.
3333

34+
.. _rm-mysql-connection-string:
35+
3436
MySQL
3537
-----
3638

@@ -68,6 +70,8 @@ details:
6870
- `MySQL Connection URL Syntax <https://dev.mysql.com/doc/connector-j/en/connector-j-reference-jdbc-url-format.html>`__
6971
- `Connection Configuration Properties <https://dev.mysql.com/doc/connector-j/en/connector-j-reference-configuration-properties.html>`__
7072

73+
.. _rm-oracle-connection-string:
74+
7175
Oracle
7276
------
7377

@@ -104,6 +108,8 @@ details:
104108

105109
- `Oracle JDBC Developer's Guide and Reference <https://docs.oracle.com/en/database/oracle/oracle-database/23/jjdbc/JDBC-Thin-features.html>`__
106110
- `Connection String Attributes <https://docs.oracle.com/cd/E85694_01/ODPNT/ConnectionConnectionString.htm#GUID-DF4ED9A3-1AAF-445D-AEEF-016E6CD5A0C0__BABBAGJJ>`__
111+
112+
.. _rm-postgresql-connection-string:
107113

108114
PostgreSQL
109115
----------
@@ -140,6 +146,8 @@ The preceding connection string specifies these connection details:
140146

141147
- `PostgreSQL Connection Configuration Properties <https://jdbc.postgresql.org/documentation/use/>`__
142148

149+
.. _rm-sql-connection-string:
150+
143151
SQL Server
144152
----------
145153

@@ -201,6 +209,8 @@ the default ``dbo`` schema in all databases.
201209
If you specify the ``databaseName`` property, you can see tables from
202210
all schemas within the specified database.
203211

212+
.. _rm-sybase-connection-string:
213+
204214
Sybase ASE
205215
----------
206216

@@ -215,7 +225,9 @@ The general form for a Sybase ASE connection string is:
215225
To learn more about Sybase ASE connection strings, see:
216226

217227
- `Sybase ASE Connection String Docs <https://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc01776.1601/doc/html/san1357754914053.html>`__
218-
- `Connectingstrings.com <https://www.connectionstrings.com/sybase-adaptive/>`__
228+
- `ConnectionStrings.com <https://www.connectionstrings.com/sybase-adaptive/>`__
229+
230+
.. _rm-db2-connection-string:
219231

220232
DB2
221233
---
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
.. _rm-database-connections:
2+
3+
====================
4+
Database Connections
5+
====================
6+
7+
.. default-domain:: mongodb
8+
9+
.. contents:: On this page
10+
:local:
11+
:backlinks: none
12+
:depth: 1
13+
:class: singlecol
14+
15+
Relational Migrator uses JDBC connection strings and associated user
16+
credentials to access your relational database and MongoDB deployment.
17+
You can save this information as a database connection.
18+
19+
Use Cases
20+
---------
21+
22+
You can save connection settings for relational and MongoDB databases
23+
when creating projects and migration jobs. You can use these saved database
24+
connections for any task that requires connecting to a relational or MongoDB
25+
database.
26+
27+
Get Started
28+
-----------
29+
30+
To create, view, and manage saved connections, go to the Relational
31+
Migrator :guilabel:`Connections` page.
32+
33+
- :ref:`rm-create-project-live`
34+
- :ref:`rm-create-jobs`
35+
- :ref:`rm-save-relational-connection`
36+
- :ref:`rm-save-mongodb-connection`
37+
38+
39+
.. toctree::
40+
:titlesonly:
41+
:hidden:
42+
43+
Save a MongoDB Connection </database-connections/save-mongodb-connection>
44+
Save a Relational Connection </database-connections/save-relational-connection>
45+
Manage Connections </database-connections/manage-database-connections>
46+
Connection Strings </connection-strings/connection-strings>
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
.. _rm-manage-connections:
2+
3+
===========================
4+
Manage Database Connections
5+
===========================
6+
7+
.. default-domain:: mongodb
8+
9+
.. contents:: On this page
10+
:local:
11+
:backlinks: none
12+
:depth: 1
13+
:class: singlecol
14+
15+
You can copy, edit, or delete database connections from the Relational Migrator
16+
:guilabel:`Connections` page. Saved connections are listed by their environment
17+
tag. You can mouse over the :icon-fa5:`info-circle` icon for a connection to
18+
see a list of projects that use that connection.
19+
20+
Copy a Connection
21+
-----------------
22+
23+
You can copy an existing connection. This can be useful if you want multiple
24+
connections to the same server that each connect to different databases, or if
25+
you have similar connection information for a staging database and a
26+
production database.
27+
28+
Copying a connection creates a duplicate with ``-Copy`` appended to the
29+
connection name.
30+
31+
32+
Steps
33+
~~~~~
34+
35+
To copy a connection:
36+
37+
#. Click the :icon-fa4:`copy` button.
38+
39+
#. Make any desired changes.
40+
41+
#. Click :guilabel:`Save`.
42+
43+
44+
45+
Edit a Connection
46+
-----------------
47+
48+
You can edit an existing connection to change any settings except for the
49+
database type. This can be useful for:
50+
51+
- Renaming the connection
52+
- Adding changing, or removing the :guilabel:`Environment tag`
53+
- Changing authentication credentials or SSL settings
54+
55+
56+
Steps
57+
~~~~~
58+
59+
To edit a connection:
60+
61+
#. Click the :icon-lg:`Edit` button.
62+
63+
#. Make any desired changes, such as renaming the connection or changing the database.
64+
65+
#. Click :guilabel:`Save`.
66+
67+
68+
69+
Delete a Connection
70+
-------------------
71+
72+
You can delete a connection that you no longer need. Deleting a relational
73+
database connection causes any projects using that connection to fall back to
74+
Relational Migrator's last copy of the database contents. Mapping rules remain
75+
in place.
76+
77+
Steps
78+
~~~~~
79+
80+
To delete a connection:
81+
82+
#. Click the :icon-fa5:`trash` button.
83+
84+
A warning dialog displays and lists any projects that use the connection.
85+
86+
#. Click :guilabel:`Delete` to confirm.

0 commit comments

Comments
 (0)