Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(mdb): new docs #3776

Merged
merged 11 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 110 additions & 0 deletions managed-databases/mongodb/api-cli/backup-and-restore.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
---
meta:
title: Back up and restore MongoDB™ Databases with MongoDB® tools
description: This page shows you how to back up and restore MongoDB™ Databases with MongoDB® command line tools
content:
h1: Back up and restore MongoDB™ Databases with MongoDB® tools
paragraph: This page shows you how to back up and restore MongoDB™ Databases with MongoDB® command line tools
tags: databases mongodb mongodb document backup database-nodes
categories:
- managed-databases
- postgresql-and-mysql
---

Managed MongoDB™ Databases provide fully-managed document Database Instances, with a MongoDB®-compatible API layer over a PostgreSQL engine to store and retrieve data.

This means you can use MongoDB® command line tools to use and manage your MongoDB™ Databases.

This tutorial shows how to backup and restore your MongoDB™ Databases with the MongoDB® `mongodump` and `mongorestore` command line database tools.

<Macro id="requirements" />

<Message type="requirement">
- You have an account and are logged into the [Scaleway console](https://console.scaleway.com/)
- You have a [MongoDB®-compatible client](https://www.mongodb.com/try/download/shell) installed
- You have [created a MongoDB™ Database Instance](/managed-databases/mongodb/how-to/create-a-database-instance)
ldecarvalho-doc marked this conversation as resolved.
Show resolved Hide resolved
- You have [mongodump and mongorestore tools](https://www.mongodb.com/docs/database-tools/installation/installation/) installed
</Message>

<Message type="important">
This tutorial shows you basic restore and backup operations. If you need additional options for the operations, refer to the [official MongoDB® documentation](https://www.mongodb.com/docs/manual/tutorial/backup-and-restore-tools/).

Make sure you keep the `--ssl` and `--sslCAFile=<file.pem>` options in your commands, as you will need to authenticate using the default SSL certificate when you connect to your Database Instance.
</Message>

## How to back up a MongoDB™ Database Instance

To create backups, we will use the `mongodump` tool, which can create backups for an entire Database Instance, logical database or collection. It can also use a query to back up part of a collection.

1. Navigate to the [Scaleway console](https://console.scaleway.com/).
2. Click **MongoDB™ Databases** under **Managed Databases** on the side menu. A list of your Database Instances displays.
3. Click the database name or <Icon name="more" /> > **More info** to access the Database Instance information page.
4. Download the Database Instance's SSL certificate.
<Message type="important">
Make sure you know the path to the certificate in your local machine, as it will be used in a later step.
ldecarvalho-doc marked this conversation as resolved.
Show resolved Hide resolved
</Message>
5. Run the following command, replacing the values according to the table below.
```
mongodump \
--host=<ip-address> \
--port=<port> \
--username=<username> \
--password="<password>" \
--out=/path/to/backup \
--ssl \
--sslCAFile=<file.pem> \
--authenticationMechanism=PLAIN
```

`host`
: the IP address of your Database Instance

`port`
: the connection port of your Database Instance

`username`
: the username of the database user created upon Database Instance creation

`password`
: the password of the database user created upon Database Instance creation

`out`
: the path to the folder where you want the backups to be stored on your machine

`sslCAFile`
: the path to where your SSL certificate is stored

`authenticationMechanism`
: the list of authentication mechanisms the server accepts

If no response is returned, the operation was successful. You can make sure the backup occurred by checking if new files were added to the destination folder.
ldecarvalho-doc marked this conversation as resolved.
Show resolved Hide resolved

## How to restore from a backup

You can restore either an entire database backup or a subset of a backup using `mongorestore`.

The tool restores binary backups created using `mongodump`.

You can restore the backed up data to any database within any Database Instance.

Run the following command, replacing the values according to the table above. You must specify the name of the destination `db`.
```
mongorestore \
--host=<ip-address> \
--port=<port> \
--username=<username> \
--password=<password> \
/path/to/backup \
--db=rdb \
--ssl \
--sslCAFile=<file.pem> \
--authenticationMechanism=PLAIN
```
`db`
: the name of the database to which you want to restore the backup

If the procedure was successful, you will see an output like the following:

```
2023-09-04T17:50:29.893+0200 1 document(s) restored successfully. 0 document(s) failed to restore.
```
8 changes: 8 additions & 0 deletions managed-databases/mongodb/api-cli/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
meta:
title: Managed MongoDB™ Databases - API/CLI Documentation
description: Managed MongoDB™ Databases API/CLI Documentation
content:
h1: Managed MongoDB™ Databases - API/CLI Documentation
paragraph: Managed MongoDB™ Databases API/CLI Documentation
---
65 changes: 65 additions & 0 deletions managed-databases/mongodb/concepts.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
meta:
title: Managed MongoDB™ Databases - Concepts
description: This page explains all the concepts related to Managed MongoDB™ Databases.
content:
h1: Managed MongoDB™ Databases - Concepts
paragraph: This page explains all the concepts related to Managed MongoDB™ Databases.
tags: concepts managed-databases ferredb mongodb document
categories:
- managed-databases
---

## Block Storage Low Latency

Block Storage Low Latency is a storage type similar to [Basic Block Storage](#basic-block-storage) that provides lower latency and high resiliency through 5k IOPS. You can increase your volume size to up to 10 TB.

Refer to the [Block Storage Low Latency documentation section](/storage/block/concepts/) to learn more about this volume type.

<Message type="note">
Block Low Latency volumes are only available with new-generation node types and in the PAR and AMS regions.
</Message>

## Database Instance

A Database Instance is made up of multiple (at least 1) dedicated compute nodes, and is running a single Database Engine. Exactly one database engine is running on each node.

## Database snapshot

A [Snapshot](/managed-databases/mongodb/how-to/manage-snapshots/) is a consistent, instantaneous copy of the Block Storage volume of your Database Instance at a certain point in time. They are designed to recover your data in case of failure or accidental alterations of the data by a user. They allow you to quickly create a new Instance from a previous state of your database, regardless of the size of the volume. Snapshots can only be stored in the same location as the original data.

## Document database

Document databases enable users to store and retrieve data in a document format, such as json. Compared to traditional relational databases where data is stored in a table-like format, document-type storage supports storing multiple nested keys and values in each document key.

## Endpoint

A point of connection to a database. The endpoint is associated with an IPv4 address and a port, and determines whether the endpoint is read-write or not.

## Engine

A database engine is the software component that stores and retrieves your data from a database. Currently, MongoDB™ 7.0.11 and 7.0.12 are available.

## Logs

Logs can contain useful information for debugging or to know more about the behavior and activity of your databases.

## Managed Database

Compared to traditional database management, which requires customers to provision their infrastructure and resources to manage their databases, managed databases offer the user access to a Database Instance without setting up the hardware or configuring the software.

## Region and Availability Zone

<Macro id="region-and-az" />

<Message type="requirement">
During the MongoDB™ Private Beta, only the France region is available.
</Message>

## Replica-set 1-node

An Instance of MongoDB™ that runs as a single server and does not provide redundancy or high availability.

## Replica-set 3-nodes

A group of 3 MongoDB™ servers (1 primary and 2 standby nodes) that maintain the same data set. Replica sets provide redundancy and high availability and are the basis for all production deployments. If the main node fails for any reason, one of the remaining standby nodes is assigned and can take over requests, reducing downtime.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Loading