You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/20-prerequisites/10-postgres.mdx
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,31 +6,31 @@ import useBaseUrl from '@docusaurus/useBaseUrl';
6
6
7
7
# 👐 PostgreSQL Database
8
8
9
-
In this lab you will be migrating data from a PostgreSQL relational database. You have a few options to set up this database. __Choose one option for your PostgreSQL database__.
9
+
In this lab you will be migrating data from a PostgreSQL relational database. You have a few options to set up this database. __Choose just one option for your PostgreSQL database__.
10
10
11
11
## 👐 Option 1: Use a pre-configured database
12
12
13
13
If you are participating in an instructor-led lab, they may have already set up this database for you. Ask your instructor for the connection URI and credentials.
14
14
15
15
:::info
16
-
In an intructor-led lab you will use the provisioned PostgreSQL database, no need to do anything else
16
+
In an intructor-led lab you will use the provisioned PostgreSQL database, no need to do anything else.
17
17
:::
18
18
19
19
## 🦸 Option 2: Load the schema and data into your own PostgreSQL server
20
20
21
21
If you already have a PostgreSQL server set up, you can import the schema and data used in this lab. Download the file
4. Start the Docker container by running the command:
@@ -40,8 +40,8 @@ docker run -p 5432:5432 sample-postgres-library
40
40
The PostgreSQL server can be accessed at localhost:5432 with a username of `postgres` and a password of `postgres`.
41
41
42
42
## 🦸 Option 4: Load an SQL file
43
-
Choose this option if you just want a quick hands-on experience and you don't need to run actual migration.
43
+
Choose this option if you just want a quick hands-on experience and you don't need to run an actual migration.
44
44
Download the file [library-schema.sql](https://github.com/mongodb-developer/relational-migrator-lab/blob/main/resource/library-schema.sql)
45
-
and upload this file to the Relational Migrator later, at the **create a project** step.
45
+
and upload this file to the Relational Migrator later, at the [create a project](/docs/category/-create-a-project) step.
46
46
47
47
This is just the schema of the database, without actual data, so, you will not be able to perform an actual migration since you do not have a source database. But you can model the schema and play around with the Relational Migrator.
Copy file name to clipboardExpand all lines: docs/210-Migrate Data/20-view-migrated-data.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,4 +11,4 @@ MongoDB Compass, or MongoDB Atlas. This topic assumes you have migrated your dat
11
11
- Select the database you migrated data to
12
12
- Select each of the collections and view the documents, confirming they conform to the schema you created.
13
13
14
-
<Screenshoturl="https://www.mongodb.com/products/tools/relational-migrator"src="img/view-migrated-data-atlas.png"alt="Screenshot of the connect modal" />
14
+
<Screenshoturl="http://127.0.0.1:8278"src="img/view-migrated-data-atlas.png"alt="Screenshot of the connect modal" />
Copy file name to clipboardExpand all lines: docs/220-Generate code/10-generate-app-code.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,5 +13,5 @@ While this code is not production-ready, it can save developers significant time
13
13
- Under Template, select `Sample Documents`. Notice how you can view examples of how data in each collection will be structured.
14
14
- Under Template, select `JSON Schema (MongoDB)`. Notice how you can view and download JSON Schema validators which could be used to enforce schema compliance.
15
15
16
-
<Screenshoturl="https://www.mongodb.com/products/tools/relational-migrator"src="img/generate-app-code.png"alt="Screenshot of the connect modal" />
16
+
<Screenshoturl="http://127.0.0.1:8278"src="img/generate-app-code.png"alt="Screenshot of the connect modal" />
Copy file name to clipboardExpand all lines: docs/220-Generate code/40-testing-queries.mdx
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,26 +13,26 @@ Relation Migrator allows you to go a step further, and verify the converted quer
13
13
2. If you source data resides in the `public` schema in your PostgreSQL database, you may skip this step. Otherwise, you will need to add your source data schema into PostgreSQL's search path in order for the queries execute properly.
14
14
15
15
Go to **Manage Connections**:
16
-
<Screenshoturl="https://www.mongodb.com/products/tools/relational-migrator"src="img/testing-queries-001.png"alt="Screenshot to manage connection" />
16
+
<Screenshoturl="http://127.0.0.1:8278"src="img/testing-queries-001.png"alt="Screenshot to manage connection" />
17
17
18
18
Edit your **JDBC URI** to include the search path. For example, if your source schema is `library`, add `options=-c%20search_path%3Dlibrary` as a query parameter to your URI:
19
19
20
-
<Screenshoturl="https://www.mongodb.com/products/tools/relational-migrator"src="img/testing-queries-002.png"alt="Screenshot to add search path" />
20
+
<Screenshoturl="http://127.0.0.1:8278"src="img/testing-queries-002.png"alt="Screenshot to add search path" />
21
21
22
22
Click **Save** and you can use the browser's **back button** to navigate back to the Query Converter page.
23
23
24
24
3. After which, you may expand the test query panel to begin executing your source query or converted query.
25
25
26
-
<Screenshoturl="https://www.mongodb.com/products/tools/relational-migrator"src="img/testing-queries-003.png"alt="Screenshot to expand query test panel" />
26
+
<Screenshoturl="http://127.0.0.1:8278"src="img/testing-queries-003.png"alt="Screenshot to expand query test panel" />
27
27
28
28
## Executing queries for comparison
29
29
30
30
1. Select the source query you want to test on the left pane. As an example, we will select the `get_books_by_genre` stored procedure.
31
31
2. Convert the query to a MongoDB query if you have not done so, but note that the converted query may not always be correct.
32
32
3. If it is a stored procedure, you will need to replace the placeholder parameter with a test value. In this example, we will replace it with `'Literature'`.
33
-
<Screenshoturl="https://www.mongodb.com/products/tools/relational-migrator"src="img/testing-queries-004.png"alt="Screenshot to show placeholder replacement" />
33
+
<Screenshoturl="http://127.0.0.1:8278"src="img/testing-queries-004.png"alt="Screenshot to show placeholder replacement" />
34
34
4. Click **RUN SOURCE QUERY** and **RUN CONVERTED QUERY** to execute the queries and compare the results.
35
-
<Screenshoturl="https://www.mongodb.com/products/tools/relational-migrator"src="img/testing-queries-005.png"alt="Screenshot to show result comparison" />
35
+
<Screenshoturl="http://127.0.0.1:8278"src="img/testing-queries-005.png"alt="Screenshot to show result comparison" />
36
36
5. If the query results are different, check your MongoDB query. In this example, your MongoDB query should look like:
Copy file name to clipboardExpand all lines: docs/40-desired-schema-mongodb.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ that data that is frequently accessed together is stored together by using embed
8
8
9
9
The following screenshot shows the MongoDB schema we will be creating in this lab.
10
10
11
-
<Screenshoturl="https://www.mongodb.com/products/tools/relational-migrator"src="img/40-image-001.png"alt="Screenshot of the connect modal" />
11
+
<Screenshoturl="http://127.0.0.1:8278"src="img/40-image-001.png"alt="Screenshot of the connect modal" />
12
12
13
13
A few key points:
14
14
- Books will contain an array of authors with author id and name for fast retrieval. This is using the [Extended Reference pattern](https://www.mongodb.com/blog/post/building-with-patterns-the-extended-reference-pattern) to reference a separate collection (Authors) but having in books enough information aubout the author.
Copy file name to clipboardExpand all lines: docs/50-create-project/50-create-new-project.mdx
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@ import Screenshot from "@site/src/components/Screenshot";
2
2
3
3
# 👐 Creating a New Project
4
4
5
-
Ensure Relational Migrator is installed and running (usually at http://127.0.0.1:8278/).
5
+
Ensure the Relational Migrator is installed and running (usually at http://127.0.0.1:8278/).
6
6
7
7
8
8
@@ -12,8 +12,8 @@ Ensure Relational Migrator is installed and running (usually at http://127.0.0.1
12
12
<Screenshoturl="http://127.0.0.1:8278"src="img/50-image-001.png"alt="Screenshot of the connect modal" />
13
13
14
14
## Select one of the three options
15
-
- Click **Connect database** if you are running the origin DB in the cloud, Docker or using your own hardware.
16
-
- Click **Load schema from a file** if you don't have access to a source database and just want to work with the schema (you won't have any data to import though).
17
-
- Click **Use a sample schema** to play around with a test schema, without any data. This does not require connecting to a real DB. We won't use this one in this Lab.
15
+
-👐 Click **Connect database**under "Connect to live database" if you are running the source database in the cloud, Docker or using your own hardware.
16
+
-🦸♂️ Click **Import .SQL file** under "Load schema from a file" if you don't have access to a source database and just want to work with the schema (you won't have any data to import though).
17
+
-🦸♂️ Click **Create sample** under "Use a sample schema" to play around with a test schema, without any data. This does not require connecting to a real DB. We won't use this one in this Lab.
18
18
19
19
<Screenshoturl="http://127.0.0.1:8278"src="img/50-image-002.png"alt="Screenshot of the connect modal" />
Copy file name to clipboardExpand all lines: docs/50-create-project/60-connect-database.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ We can store the credentials of our database so in the next session we can conne
10
10
11
11
Then we'll select PostgreSQL as our source database.
12
12
13
-
<Screenshoturl="https://www.mongodb.com/products/tools/relational-migrator"src="img/60-image-000.png"alt="Selecting PostgreSQL as Database" />
13
+
<Screenshoturl="http://127.0.0.1:8278"src="img/60-image-000.png"alt="Selecting PostgreSQL as Database" />
14
14
15
15
## Enter connection details
16
16
@@ -23,7 +23,7 @@ Enter the details for the PostgreSQL database you will be migrating from.
23
23
- Click `Connect` to proceed to the next step.
24
24
- You can give your connection a name and a tag to make it simpler to remember later
25
25
26
-
<Screenshoturl="https://www.mongodb.com/products/tools/relational-migrator"src="img/60-image-001.png"alt="Screenshot of the connect modal" />
26
+
<Screenshoturl="http://127.0.0.1:8278"src="img/60-image-001.png"alt="Screenshot of the connect modal" />
27
27
28
28
:::info
29
29
🦸♂️ If you have followed the steps to configure PostgreSQL in a docker container, the hostname will be `localhost`, username `postgres` and password `postgres`.
0 commit comments