Mongodb data backup and recovery

Source: Internet
Author: User
Mongodb differs greatly from other relational databases. Basically, mongodb stores json-type data. relational database tables are called collections in mongodb, in mongo, what we originally called a column is called a Document. This article shares some basic information about mongo data backup (export) and restoration (import ).

Mongodb differs greatly from other relational databases. Basically, mongodb stores json-type data. relational database tables are called collections in mongodb, in mongo, what we originally called a column is called a Document. This article shares some basic information about mongo data backup (export) and restoration (import ).

Mongodb differs greatly from other relational databases. Basically, mongodb stores json-type data. relational database tables are called collections in mongodb, in mongo, what we originally called a column is called a Document. This article shares some basic knowledge about mongo data backup (export) and restoration (import ).

1. Data Backup (as exported)

This operation is actually relatively simple. The command is the name of mongodump-d database. After you press enter, a folder named dump will be generated in the current directory, which contains the exported data.

2. Restore or import data

Command: mongorestore-h Host ip: 27017-d target database name -- directoryperdb -- drop backup data directory

For the sake of privacy, I hope I don't mind. Next time I will share with you the basic syntax of groovy.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.