{"id":4123,"date":"2022-04-16T06:16:59","date_gmt":"2022-04-16T06:16:59","guid":{"rendered":"https:\/\/www.wikitechy.com\/interview-questions\/?p=4123"},"modified":"2022-04-16T06:22:59","modified_gmt":"2022-04-16T06:22:59","slug":"how-to-back-up-and-restore-mongodb-database","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/interview-questions\/mongodb\/how-to-back-up-and-restore-mongodb-database\/","title":{"rendered":"How to Back up and restore MongoDB Database ?"},"content":{"rendered":"<ul>\n<li>The mongo shell does not include functions for\u00a0importing, exporting, restore or backup.<\/li>\n<li>MongoDB has created methods for accomplishing this, so that no scripting work or complex GUIs are needed.<\/li>\n<li>Several utility scripts are used to get data in or out of the database in bulk.<\/li>\n<li>These utility scripts are used to back up and restore data in MongoDB:<\/li>\n<\/ul>\n<h4 id=\"mongoimport\">Mongoimport :<\/h4>\n<ul>\n<li>In MongoDB, it provides a special tool that is used to import data.<\/li>\n<\/ul>\n<p><strong>Syntax :<\/strong><br \/>\n<code>mongoimport-jsonarray-db database_name-collection collection_name-file file_location<\/code><\/p>\n<h4 id=\"mongoexport\">Mongoexport :<\/h4>\n<ul>\n<li>In MongoDB it allows you to export its data into other file formats like JSON or CSV.<\/li>\n<\/ul>\n<p><code>mongoexport-db database_name-collection collection_name-outpath_or_name_of_the_file<\/code><\/p>\n<h4 id=\"mongodump\">Mongodump :<\/h4>\n<ul>\n<li>In MongoDB it is used creating a binary export of the contents and export data from either\u00a0<strong>mongod<\/strong> or\u00a0<strong>mongos<\/strong><\/li>\n<\/ul>\n<h4 id=\"mongorestore\">Mongorestore :<\/h4>\n<ul>\n<li>This program loads data from either a binary database dump created by mongodump or the standard input into a mongod or mongos instance.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>The mongo shell does not include functions for\u00a0importing, exporting, restore or backup. MongoDB has created methods for accomplishing this, so that no scripting work or complex GUIs are needed. Several utility scripts are used to get data in or out of the database in bulk. These utility scripts are used to back up and restore [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16831],"tags":[17022,17021,17038,17027,17030,17032,17039,17040,17033,17037,17036,17025,17028,17026,17029,17031,17024,17035,17034,17023],"class_list":["post-4123","post","type-post","status-publish","format-standard","hentry","category-mongodb","tag-back-up-and-restore-with-mongodb-tools","tag-how-to-back-up-and-restore-mongodb","tag-how-to-backup-and-restore-database","tag-how-to-backup-and-restore-mongodb-database","tag-how-to-backup-mongodb-database","tag-how-to-backup-mongodb-database-on-windows","tag-how-to-create-mongodb-database-backup","tag-how-to-recover-mongodb-database","tag-how-to-restore-mongodb-dump-in-windows","tag-how-to-take-all-database-backup-in-mongodb","tag-how-to-take-backup-from-mongodb","tag-mongodb-backup-and-restoration","tag-mongodb-create-backup","tag-mongodb-backup-and-restore","tag-mongodb-backup-and-restore-command","tag-mongodb-backup-command","tag-mongodb-database-backup-and-restore","tag-mongodb-dump-command-in-linux","tag-recover-mongodb-database","tag-restore-a-single-database-or-collection"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Back up and restore MongoDB Database ? - Mongodb - Wikitechy<\/title>\n<meta name=\"description\" content=\"How to Back up and restore MongoDB Database ? - The mongo shell does not include functions for\u00a0importing, exporting, restore or backup.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wikitechy.com\/interview-questions\/mongodb\/how-to-back-up-and-restore-mongodb-database\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Back up and restore MongoDB Database ? - Mongodb - Wikitechy\" \/>\n<meta property=\"og:description\" content=\"How to Back up and restore MongoDB Database ? - The mongo shell does not include functions for\u00a0importing, exporting, restore or backup.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wikitechy.com\/interview-questions\/mongodb\/how-to-back-up-and-restore-mongodb-database\/\" \/>\n<meta property=\"og:site_name\" content=\"Wikitechy\" \/>\n<meta property=\"article:published_time\" content=\"2022-04-16T06:16:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-04-16T06:22:59+00:00\" \/>\n<meta name=\"author\" content=\"webmaster\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"webmaster\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/mongodb\\\/how-to-back-up-and-restore-mongodb-database\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/mongodb\\\/how-to-back-up-and-restore-mongodb-database\\\/\"},\"author\":{\"name\":\"webmaster\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#\\\/schema\\\/person\\\/f785ba3ecc599133e65ab6138042a3e4\"},\"headline\":\"How to Back up and restore MongoDB Database ?\",\"datePublished\":\"2022-04-16T06:16:59+00:00\",\"dateModified\":\"2022-04-16T06:22:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/mongodb\\\/how-to-back-up-and-restore-mongodb-database\\\/\"},\"wordCount\":145,\"commentCount\":0,\"keywords\":[\"Back Up and Restore with MongoDB Tools\",\"How To Back Up And Restore MongoDB\",\"how to backup and restore database\",\"How to Backup and Restore MongoDB Database\",\"how to backup mongodb database\",\"how to backup mongodb database on windows\",\"how to create mongodb database backup\",\"how to recover mongodb database\",\"how to restore mongodb dump in windows\",\"how to take all database backup in mongodb\",\"how to take backup from mongodb\",\"MongoDB - Backup and Restoration\",\"MongoDB - Create Backup\",\"MongoDB Backup and Restore\",\"mongodb backup and restore command\",\"mongodb backup command\",\"MongoDB Database Backup And Restore\",\"mongodb dump command in linux\",\"recover mongodb database\",\"Restore a Single Database or Collection\"],\"articleSection\":[\"mongodb\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/mongodb\\\/how-to-back-up-and-restore-mongodb-database\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/mongodb\\\/how-to-back-up-and-restore-mongodb-database\\\/\",\"url\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/mongodb\\\/how-to-back-up-and-restore-mongodb-database\\\/\",\"name\":\"How to Back up and restore MongoDB Database ? - Mongodb - Wikitechy\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#website\"},\"datePublished\":\"2022-04-16T06:16:59+00:00\",\"dateModified\":\"2022-04-16T06:22:59+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#\\\/schema\\\/person\\\/f785ba3ecc599133e65ab6138042a3e4\"},\"description\":\"How to Back up and restore MongoDB Database ? - The mongo shell does not include functions for\u00a0importing, exporting, restore or backup.\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/mongodb\\\/how-to-back-up-and-restore-mongodb-database\\\/\"]}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#website\",\"url\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/\",\"name\":\"Wikitechy\",\"description\":\"Interview Questions\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#\\\/schema\\\/person\\\/f785ba3ecc599133e65ab6138042a3e4\",\"name\":\"webmaster\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/155b77fd8cdda3d0913fcb7e7ee63543b0c345d2d8f6dcebda5b0583ab61f967?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/155b77fd8cdda3d0913fcb7e7ee63543b0c345d2d8f6dcebda5b0583ab61f967?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/155b77fd8cdda3d0913fcb7e7ee63543b0c345d2d8f6dcebda5b0583ab61f967?s=96&d=mm&r=g\",\"caption\":\"webmaster\"},\"sameAs\":[\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\"],\"url\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/author\\\/webmaster\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Back up and restore MongoDB Database ? - Mongodb - Wikitechy","description":"How to Back up and restore MongoDB Database ? - The mongo shell does not include functions for\u00a0importing, exporting, restore or backup.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wikitechy.com\/interview-questions\/mongodb\/how-to-back-up-and-restore-mongodb-database\/","og_locale":"en_US","og_type":"article","og_title":"How to Back up and restore MongoDB Database ? - Mongodb - Wikitechy","og_description":"How to Back up and restore MongoDB Database ? - The mongo shell does not include functions for\u00a0importing, exporting, restore or backup.","og_url":"https:\/\/www.wikitechy.com\/interview-questions\/mongodb\/how-to-back-up-and-restore-mongodb-database\/","og_site_name":"Wikitechy","article_published_time":"2022-04-16T06:16:59+00:00","article_modified_time":"2022-04-16T06:22:59+00:00","author":"webmaster","twitter_card":"summary_large_image","twitter_misc":{"Written by":"webmaster","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.wikitechy.com\/interview-questions\/mongodb\/how-to-back-up-and-restore-mongodb-database\/#article","isPartOf":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/mongodb\/how-to-back-up-and-restore-mongodb-database\/"},"author":{"name":"webmaster","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/f785ba3ecc599133e65ab6138042a3e4"},"headline":"How to Back up and restore MongoDB Database ?","datePublished":"2022-04-16T06:16:59+00:00","dateModified":"2022-04-16T06:22:59+00:00","mainEntityOfPage":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/mongodb\/how-to-back-up-and-restore-mongodb-database\/"},"wordCount":145,"commentCount":0,"keywords":["Back Up and Restore with MongoDB Tools","How To Back Up And Restore MongoDB","how to backup and restore database","How to Backup and Restore MongoDB Database","how to backup mongodb database","how to backup mongodb database on windows","how to create mongodb database backup","how to recover mongodb database","how to restore mongodb dump in windows","how to take all database backup in mongodb","how to take backup from mongodb","MongoDB - Backup and Restoration","MongoDB - Create Backup","MongoDB Backup and Restore","mongodb backup and restore command","mongodb backup command","MongoDB Database Backup And Restore","mongodb dump command in linux","recover mongodb database","Restore a Single Database or Collection"],"articleSection":["mongodb"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.wikitechy.com\/interview-questions\/mongodb\/how-to-back-up-and-restore-mongodb-database\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.wikitechy.com\/interview-questions\/mongodb\/how-to-back-up-and-restore-mongodb-database\/","url":"https:\/\/www.wikitechy.com\/interview-questions\/mongodb\/how-to-back-up-and-restore-mongodb-database\/","name":"How to Back up and restore MongoDB Database ? - Mongodb - Wikitechy","isPartOf":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#website"},"datePublished":"2022-04-16T06:16:59+00:00","dateModified":"2022-04-16T06:22:59+00:00","author":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/f785ba3ecc599133e65ab6138042a3e4"},"description":"How to Back up and restore MongoDB Database ? - The mongo shell does not include functions for\u00a0importing, exporting, restore or backup.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wikitechy.com\/interview-questions\/mongodb\/how-to-back-up-and-restore-mongodb-database\/"]}]},{"@type":"WebSite","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#website","url":"https:\/\/www.wikitechy.com\/interview-questions\/","name":"Wikitechy","description":"Interview Questions","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wikitechy.com\/interview-questions\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/f785ba3ecc599133e65ab6138042a3e4","name":"webmaster","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/155b77fd8cdda3d0913fcb7e7ee63543b0c345d2d8f6dcebda5b0583ab61f967?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/155b77fd8cdda3d0913fcb7e7ee63543b0c345d2d8f6dcebda5b0583ab61f967?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/155b77fd8cdda3d0913fcb7e7ee63543b0c345d2d8f6dcebda5b0583ab61f967?s=96&d=mm&r=g","caption":"webmaster"},"sameAs":["https:\/\/www.wikitechy.com\/interview-questions"],"url":"https:\/\/www.wikitechy.com\/interview-questions\/author\/webmaster\/"}]}},"_links":{"self":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/4123","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/comments?post=4123"}],"version-history":[{"count":7,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/4123\/revisions"}],"predecessor-version":[{"id":4133,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/4123\/revisions\/4133"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/media?parent=4123"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/categories?post=4123"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/tags?post=4123"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}