From fe9a43851d28e605d9e0fc27f63ea658cd189811 Mon Sep 17 00:00:00 2001 From: "Engelbart Kai Sven (PEA4-Fe)" Date: Mon, 18 Jan 2021 13:53:23 +0100 Subject: [PATCH] Improve Database Documentation --- .../documentation-database.component.html | 70 ++++++++++++------- .../documentation-database.component.scss | 7 ++ 2 files changed, 50 insertions(+), 27 deletions(-) diff --git a/src/app/documentation/documentation-database/documentation-database.component.html b/src/app/documentation/documentation-database/documentation-database.component.html index 02c9a4d..c5e9b1a 100644 --- a/src/app/documentation/documentation-database/documentation-database.component.html +++ b/src/app/documentation/documentation-database/documentation-database.component.html @@ -1,52 +1,68 @@

- The used database instance is a MongoDB instance running on the BIC, storing all application data. The admin database - management page can be accessed - - https://definma-db.apps.de1.bosch-iot-cloud.com/api-doc/ - . - However, it is recommended to use a dedicated MongoDB application for anything apart from a quick look. The two tested - applications are MongoDB Compass and - Robo 3T (recommended for trying queries).
+ The used database instance is a MongoDB instance running on the BIC, storing all application data. + The admin database management page can be accessed here. + However, it is recommended to use a dedicated MongoDB application for anything apart from a quick look. + The two tested applications are MongoDB Compass and + Robo 3T (recommended for trying queries). +

+

To connect to the BIC instance from your local application follow the BIC guide. -
TLDR: +
+ TL;DR:

-For the first time: + +

For the first time:

-Every time: +

Every time:

-
Backup
+

Backup Instructions

+

- For creating a database backup, you must follow the same steps from above (except the last one). Additionally you need - the mongodump installed. - Open the MongoDB bin folder - (normally at C:\Program Files\MongoDB\Server\4.2\bin) in a PowerShell and execute following command for backup, - adjust parameters and credentials as needed:

- .\mongodump.exe /port:1120 /db:"6ebe4c5d-0da3-4347-b484-66894dcf3f27" /username:"<username>" - /password:"<username>" /out:"C:\Path\to\backup\folder"

- Restoring the database from a backup is done with mongorestore.exe, more information can be found at the + For creating a database backup, you must follow the same steps from above (except the last one). + Additionally you need the MongoDB Tools installed. + Extract the ZIP file to a location on your hard drive and launch a Git Bash in that directory. +

+ +

To back up the database from the BIC:

+
+./mongodump --port 1120 -d <database> -u <username> -p <password> --gzip -o 'C:\path\to\backup\folder'
+
+ +

To restore the database to the BIC:

+
+./mongorestore --port 1120 -d <database> -u <username> -p <password> --gzip --drop 'C:\path\to\backup\folder'
+
To restore the database to your local MongoDB instance:

+
+./mongorestore -d dfopdb --gzip --drop 'C:\path\to\backup\folder\<database>'
+
+ +

+ More information can be found inside the documentation.
- The BIC service also creates internal backup, which can be requested to restore, see + The BIC service also creates an internal backup, which can be requested to restore, see MongoDB FAQ

-

Database model

+

Database Model

-

Field reference

+

Field Reference

samplesExample diff --git a/src/app/documentation/documentation-database/documentation-database.component.scss b/src/app/documentation/documentation-database/documentation-database.component.scss index 247c3ea..2c80228 100644 --- a/src/app/documentation/documentation-database/documentation-database.component.scss +++ b/src/app/documentation/documentation-database/documentation-database.component.scss @@ -5,3 +5,10 @@ span.name { font-style: italic; } + +pre { + padding: 1rem; + color: #212529; + background: #e6e6e6; + white-space: pre-wrap; +}