MongoDB Tutorial for Beginners -- Backup and Restore

MongoDB Tutorial for Beginners -- Backup and Restore

MongoDB is one of the most popular databases we have right now. ... of how to backup and restore a database or a collection from mongodb.

This is a quick example to show how to easily backup and restore a MongoDB database from the command line, using the current date as the backup folder name (YYYYMMDD).

Backup MongoDB database using date for the folder name

The mongodump command will create a backup / dump of the MongoDB database with the name specified by the --db [DB NAME] argument.

The --out /var/backups/date +"%Y%m%d"argument specifies the output directory as/var/backups/[TODAY'S DATE]e.g./var/backups/20190903`.

sudo mongodump --db [DB NAME] --out /var/backups/`date +"%Y%m%d"`

Restore MongoDB database from backup

The mongorestore command restores a database to the destination --db [DB NAME] from the specified directory, e.g. /var/backups/20190903.

sudo mongorestore --db [DB NAME] /var/backups/[BACKUP FOLDER NAME]

mongodb database mongo

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

MongoDB Database and java applications

Enroll for free demo to acquire the best knowledge on the schema-less database from live industry experts through MongoDB training

MongoDB – Database, Collection, and Document

Our MongoDB Online Training provide you to learn about MongoDB strategies with realty. Our MongoDB Online Training also includes live sessions, live Projects, and much

MongoDB brings database product range under one cloudy roof

Enroll for free demo to acquire the best knowledge on the schema-less database from live industry experts through MongoDB training

Connecting MongoDB hosted in Mongo Atlas with PowerBI (including M0 clusters)

Enroll for free demo to acquire the best knowledge on the schema-less database from live industry experts through MongoDB training

How to Migrate Your Local MongoDB Database Between Computers

The complete guide to a MongoDB migration. How to Migrate Your Local MongoDB Database Between Computers. The complete guide to a MongoDB migration.