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
The [Relational Migrator](https://www.mongodb.com/products/tools/relational-migrator) is a free tool that streamlines migrating data from RDBMS to MongoDB, significantly lowering the effort and risk of a migration initiative.
Copy file name to clipboardExpand all lines: docs/10-dev-env/1-dev-env-setup.mdx
+13-10Lines changed: 13 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,11 @@ Let it run for a few minutes as it prepares a Docker container with all the requ
21
21
22
22
<details>
23
23
<summary>🦹 __Run this lab locally__</summary>
24
+
25
+
:::info
26
+
Again: during the lab, we will use GitHub Codespaces. The following instructions are here just in case you can't use Codespaces or if you really, really, really want to try a local installation.
27
+
:::
28
+
24
29
#
25
30
# 1. MongoDB Database
26
31
@@ -62,19 +67,17 @@ Let it run for a few minutes as it prepares a Docker container with all the requ
62
67
63
68
Download and install MongoDB Relational Migrator.
64
69
65
-
- Go to the [MongoDB Relational Migrator downloads page](https://www.mongodb.com/try/download/relational-migrator), select your OS and download it
66
-
- Install the MongoDB Relational Migrator
67
-
- Start it
70
+
- Open the [MongoDB Relational Migrator downloads page](https://www.mongodb.com/try/download/relational-migrator)
71
+
- Select your platform (OS / Architecture if applies) and download it.
72
+
- Install the MongoDB Relational Migrator.
73
+
- Launch it.
68
74
- It should open a browser at the address http://127.0.0.1:8278/
75
+
- You should see an icon to launch/quit the Relational Migrator.
69
76
70
-
<Screenshoturl="https://www.mongodb.com/products/tools/relational-migrator"src="img/download-relational-migrator.png"alt="Screenshot of the download page for Relational Migrator" />
77
+
<Screenshoturl="https://www.mongodb.com/try/download/relational-migrator"src="img/download-relational-migrator.png"alt="Screenshot of the download page for Relational Migrator" />
71
78
72
79
---
73
80
74
-
There are more advanced ways to install the MongoDB Relational Migrator. You can check them out in [the installation docs page](https://www.mongodb.com/docs/relational-migrator/installation/). These won't be covered during this Lab.
75
-
76
-
</details>
77
-
78
-
79
-
81
+
There are other, more advanced ways to install the MongoDB Relational Migrator. You can check them out in [the installation docs page](https://www.mongodb.com/docs/relational-migrator/installation/). These won't be covered during this Lab.
Copy file name to clipboardExpand all lines: docs/10-dev-env/10-postgres.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,7 +13,7 @@ In this lab you will be migrating data from a PostgreSQL relational database.
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
:::caution
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. The rest of the Lab assumes you have a PostgreSQL database running and accessible.
Copy file name to clipboardExpand all lines: docs/30-schema-in-postgresql.mdx
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,11 @@ import Screenshot from "@site/src/components/Screenshot";
2
2
3
3
# 📘 Schema in PostgreSQL
4
4
5
-
The following screenshot shows an entity-relationship diagram of the relational database we wish to migrate. This is a library management app that stores information about books, where a book can have many authors, an author can write many books, and users can borrow books and leave reviews. You can have many copies of the same book and those are what users borrow and return. All this is registered in the `operations` collection. A library user can have many addresses.
6
-
7
-
This is the sample schema we use during our [Developer Days's Intro Lab](https://mongodb-developer.github.io/intro-lab/docs/importing-data/intro).
5
+
The following screenshot shows an entity-relationship diagram of the relational database we wish to migrate. This is a library management app that stores information about books (table `books`), where a book can have many authors (table `authors`) and an author can write many books (`author_book` link table). Users can leave reviews (`reviews` table). You can have many copies of the same book. Users borrow and return books (this is registered in the `operations` table). A library user can have many addresses (`user_addresses` table).
8
6
9
7
[](/img/30-image-001.png)
10
-
_Click to enlarge in a new tab / window_
8
+
_Click to enlarge in a new tab / window_
9
+
10
+
:::info
11
+
This is the sample schema we use during our [Developer Days's Intro Lab](https://mongodb-developer.github.io/intro-lab/docs/importing-data/intro).
Ensure the Relational Migrator is installed and running (in your codespace or locally at http://127.0.0.1:8278/).
7
+
Ensure the Relational Migrator is installed and running (either in your codespace or locally at http://127.0.0.1:8278/).
6
8
9
+
## Create a New Project
7
10
8
-
## Click on New Project
11
+
<TabsgroupId="Create a New Project">
12
+
<TabItemvalue="FirstTime"label="First Time using Relational Migrator">
9
13
14
+
If you're running the Relational Migrator for the first time, you will see a welcome screen. We will `Start from scratch` and click on `Connect database`.
10
15
11
-
<Screenshoturl="http://127.0.0.1:8278"src="img/50-image-001.png"alt="Screenshot of the connect modal" />
16
+
<Screenshoturl="http://127.0.0.1:8278"src="img/50-image-000.png"alt="Create a New Project clicking on Connect database" />
17
+
18
+
19
+
</TabItem>
20
+
<TabItemvalue="AlreadyUsed"label="I already have a project!">
21
+
22
+
Click on the `New Project` button in the top right corner of the Relational Migrator UI.
23
+
24
+
<Screenshoturl="http://127.0.0.1:8278"src="img/50-image-001.png"alt="Create a New Project clicking on New Project" />
25
+
26
+
</TabItem>
27
+
</Tabs>
12
28
13
29
## Select one of the three options
14
30
- 👐 Click **Connect database** under "Connect to live database" if you are running the source database in the cloud, Docker or using your own hardware. This is what we will use during an instructor-led hands-on lab.
Copy file name to clipboardExpand all lines: docs/50-create-project/60-connect-database.mdx
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ import Screenshot from "@site/src/components/Screenshot";
4
4
5
5
## Add a new connection
6
6
7
-
We can store the credentials of our database so in the next session we can connect quickly. In this case, we'll create a new connection selecting "Add a new connection".
7
+
We can store the credentials of our database so in the next session we can quickly re-connect. In this case, we'll create a new connection selecting "Add a new connection".
8
8
9
9
## Select PostgreSQL as Database Type
10
10
@@ -16,15 +16,15 @@ Then we'll select PostgreSQL as our source database.
16
16
17
17
Enter the details for the PostgreSQL database you will be migrating from.
18
18
19
-
- It's important to click on the `SSL` tab and activate SSL (SSL mode Prefer is fine), otherwise we won't be able to connect to cloud hosted databases.
19
+
- It's important to click on the `SSL` tab and activate `Use SSL` (`SSL mode` Prefer is fine), otherwise we won't be able to connect to cloud hosted databases.
20
20
- If your instructors have configured a server for you to use, ask them for the host name, username and password.
21
+
:::info
22
+
👐 If you have followed the steps to configure PostgreSQL in Instruqt / GitHub Codespaces, the hostname will be `localhost`, username `postgres` and password `postgres`.
23
+
:::
21
24
- Click back on the `General` tab and enter the database name as `library`.
22
-
- Click `Test Connection` to ensure your details are correct.
25
+
- Check the `Save password` box if you want to save the password for future connections.
26
+
- Click `Test Connection` to ensure your details are correct. You should see a message saying "PostgreSQL database connection successful."
23
27
- Click `Connect` to proceed to the next step.
24
-
- You can give your connection a name and a tag to make it simpler to remember later
28
+
- You can give your connection a name and a tag to make it simpler to remember later.
25
29
26
30
<Screenshoturl="http://127.0.0.1:8278"src="img/60-image-001.png"alt="Screenshot of the connect modal" />
27
-
28
-
:::info
29
-
🦸♂️ If you have followed the steps to configure PostgreSQL in a docker container, the hostname will be `localhost`, username `postgres` and password `postgres`.
Copy file name to clipboardExpand all lines: docs/50-create-project/80-define-initial-schema.mdx
+10-4Lines changed: 10 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,13 +2,19 @@ import Screenshot from "@site/src/components/Screenshot";
2
2
3
3
# 👐 Define the Initial Schema
4
4
5
-
Relational Migrator gives you three options on how your MongoDB schema should be created. Regardless of which option you choose, you can manually modify your schema later.
5
+
Relational Migrator gives you three options on how your initial MongoDB schema will be created. Regardless of which option you choose, you can manually modify your schema later.
6
+
7
+
| Option | What it does |
8
+
| :------------- | :---------- |
9
+
| Start with a MongoDB schema that matches your relational schema | Maps each table exactly to one collection, including link tables (for 1:n relationships). We're just replicating the existing schema, which won't take advantage of the Document Model. |
10
+
| Start with a recommended MongoDB schema | Will try to understand your schema and embed 1:n relationships. |
11
+
| Start with an empty MongoDB schema | Your MongoDB schema will be empty. You'll create all the mappings yourself. |
6
12
7
13
Select `Start with a recommended MongoDB schema`
8
14
9
-
You are asked which tables should represented as a collection in MongoDB.
15
+
You can see which tables will be mapped to a collection in MongoDB: those marked as `TOP-LEVEL`.
10
16
11
-
Select the following six collections as they are the main entities in our schema:
17
+
Select the following six collections as `TOP-LEVEL` since they are the main entities in our schema:
12
18
13
19
- authors
14
20
- books
@@ -19,7 +25,7 @@ Select the following six collections as they are the main entities in our schema
19
25
20
26
Any tables you did not check will be embedded in other collections.
21
27
22
-
<Screenshoturl="http://127.0.0.1:8278"src="img/80-image-001.png"alt="Screenshot of the connect modal" />
28
+
<Screenshoturl="http://127.0.0.1:8278"src="img/80-image-001.png"alt="Defining the initial schema" />
23
29
24
30
Select the casing you'd like for your collections - the default is camelCase.
0 commit comments