{"id":55374,"date":"2018-02-14T15:00:48","date_gmt":"2018-02-14T13:00:48","guid":{"rendered":"http:\/\/examples.javacodegeeks.com\/?p=55374"},"modified":"2018-02-14T12:16:10","modified_gmt":"2018-02-14T10:16:10","slug":"mongodb-backup-restore-example","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/mongodb-backup-restore-example\/","title":{"rendered":"MongoDB Backup and Restore Example"},"content":{"rendered":"<p>Hello readers, these days it is very important to protect the data against any damage if a disaster or the unforeseen outages. Thus, irrespective of the database type, it is important to keep up the regular data backups to make data available during the server crash or data corruption. In this tutorial, we will see how to use the <em>Backup<\/em> and <em>Restore<\/em> features of the MongoDB database.<\/p>\n<h2>1. Introduction<\/h2>\n<p>If you have installed the MongoDB application on Windows or Ubuntu operating system and you wish to learn about backing up and restore features of MongoDB then follow the below steps to prevent loss of data. It&#8217;s very simple to use these utilities, but before moving further let&#8217;s take a look at MongoDB and its features.<\/p>\n<h3>1.1 What is MongoDB?<\/h3>\n<ul>\n<li>MongoDB is a high-performance <em>NoSQL database<\/em> where each database has collections which in turn contains documents. Each document has a different number of fields, size, content, and is stored in a JSON-like format (i.e. Binary JSON (<a href=\"https:\/\/en.wikipedia.org\/wiki\/BSON\" target=\"_blank\" rel=\"noopener\">BSN<\/a>)<\/li>\n<li>The documents in MongoDB doesn\u2019t need to have a schema defined beforehand. Instead, the fields (i.e. <em>records<\/em>) can be created on the go<\/li>\n<li>Data model available within the MongoDB allows developers to represent the hierarchical relationships, store arrays, and other more complex structures easily<\/li>\n<li>This NoSQL solution often comes with embedding, auto-sharding, and onboard replication for better scalability and high availability<\/li>\n<\/ul>\n<h3>1.2 Why MongoDB?<\/h3>\n<ul>\n<li>As a NoSQL type database, MongoDB stores the data in the form of a document. Thus, MongoDB offers more flexibility<\/li>\n<li>This database supports search by field-name, range queries, and the regular expressions. It often provides queries to return the particular fields inside the documents<\/li>\n<li>MongoDB offers <em>indexes<\/em> in order to improve the <em>search performance<\/em> within the NoSQL database<\/li>\n<li>To offer horizontal scalability, MongoDB uses sharding by splitting the data across the numerous MongoDb occurrences<\/li>\n<li><strong>Replication<\/strong>: MongoDB can give high availability with the replica sets<\/li>\n<\/ul>\n<h2>2. MongoDB Backup and Restore Example<\/h2>\n<p>In this MongoDB tutorial, we will learn how to handle the <strong>Backup<\/strong> and <strong>Restore<\/strong> utilities provided by MongoDB.<\/p>\n<h3>2.1 Backing up the Data<\/h3>\n<p>In MongoDB, to create an entire database backup, developers should use the <a href=\"https:\/\/docs.mongodb.com\/manual\/reference\/program\/mongodump\/\" target=\"_blank\" rel=\"noopener\">mongodump<\/a> command. This command nicely takes a snapshot of the entire database and place it in the dump directory of the MongoDB. When the <code>mongodump<\/code> command runs without any input arguments, it connects to the local-host MongoDB instance on port <code>27017<\/code> and creates a database backup in the <em>dump<\/em> directory. Here is what the syntax will look like.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>Syntax<\/em><\/span><\/p>\n<pre class=\"brush:bash;wrap-lines:false;\">&gt; mongodump\r\n<\/pre>\n<p>Let&#8217;s understand this with the help of an example.<\/p>\n<h4>2.1.1 Start MongoDB<\/h4>\n<p>Start a standalone <a href=\"https:\/\/docs.mongodb.com\/manual\/reference\/program\/mongod\/#bin.mongod\" target=\"_blank\" rel=\"noopener\">mongod<\/a> instance as shown below.<\/p>\n<p><figure id=\"attachment_55375\" aria-describedby=\"caption-attachment-55375\" style=\"width: 849px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-1.jpg\"><img decoding=\"async\" class=\"size-full wp-image-55375\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-1.jpg\" alt=\"Fig. 1: Start MongoDB instance\" width=\"849\" height=\"613\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-1.jpg 849w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-1-300x217.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-1-768x555.jpg 768w\" sizes=\"(max-width: 849px) 100vw, 849px\" \/><\/a><figcaption id=\"caption-attachment-55375\" class=\"wp-caption-text\">Fig. 1: Start MongoDB instance<\/figcaption><\/figure><div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<h4>2.1.2 Connect to the Mongo Instance<\/h4>\n<p>Connect with the <a href=\"https:\/\/docs.mongodb.com\/manual\/reference\/program\/mongo\/#bin.mongo\" target=\"_blank\" rel=\"noopener\">mongo<\/a> shell to make a connection with the MongoDB instance on port <code>27017<\/code> as shown below.<\/p>\n<p><figure id=\"attachment_55376\" aria-describedby=\"caption-attachment-55376\" style=\"width: 849px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-2.jpg\"><img decoding=\"async\" class=\"size-full wp-image-55376\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-2.jpg\" alt=\"Fig. 2: Connect to MongoDB\" width=\"849\" height=\"362\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-2.jpg 849w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-2-300x128.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-2-768x327.jpg 768w\" sizes=\"(max-width: 849px) 100vw, 849px\" \/><\/a><figcaption id=\"caption-attachment-55376\" class=\"wp-caption-text\">Fig. 2: Connect to MongoDB<\/figcaption><\/figure><\/p>\n<h4>2.1.3 Check Databases<\/h4>\n<p>Check how many databases exist on the server by executing the <code>show dbs<\/code> command as shown below.<\/p>\n<p><figure id=\"attachment_55377\" aria-describedby=\"caption-attachment-55377\" style=\"width: 849px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-3.jpg\"><img decoding=\"async\" class=\"size-full wp-image-55377\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-3.jpg\" alt=\"Fig. 3: MongoDB databases\" width=\"849\" height=\"70\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-3.jpg 849w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-3-300x25.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-3-768x63.jpg 768w\" sizes=\"(max-width: 849px) 100vw, 849px\" \/><\/a><figcaption id=\"caption-attachment-55377\" class=\"wp-caption-text\">Fig. 3: MongoDB databases<\/figcaption><\/figure><\/p>\n<p>Here <em>udemy<\/em> and <em>employee<\/em> are the two sample databases that we have created and each of them has collections.<\/p>\n<h4>2.1.4 Data backup<\/h4>\n<p>Now, go back to the administration window and type the <code>mongodump<\/code> command to activate the data backup as shown below.<\/p>\n<p><figure id=\"attachment_55378\" aria-describedby=\"caption-attachment-55378\" style=\"width: 849px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-4.jpg\"><img decoding=\"async\" class=\"size-full wp-image-55378\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-4.jpg\" alt=\"Fig. 4: MongoDB backup utility\" width=\"849\" height=\"87\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-4.jpg 849w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-4-300x31.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-4-768x79.jpg 768w\" sizes=\"(max-width: 849px) 100vw, 849px\" \/><\/a><figcaption id=\"caption-attachment-55378\" class=\"wp-caption-text\">Fig. 4: MongoDB backup utility<\/figcaption><\/figure><\/p>\n<p>The <span style=\"text-decoration: underline;\">MongoDB backup utility<\/span> will create the database backup named <code>dump<\/code> in the current directory. In this folder, we will have one folder each for the databases that we have.<\/p>\n<p><figure id=\"attachment_55379\" aria-describedby=\"caption-attachment-55379\" style=\"width: 849px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-5.jpg\"><img decoding=\"async\" class=\"size-full wp-image-55379\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-5.jpg\" alt=\"Fig. 5: Backup directory\" width=\"849\" height=\"180\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-5.jpg 849w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-5-300x64.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-5-768x163.jpg 768w\" sizes=\"(max-width: 849px) 100vw, 849px\" \/><\/a><figcaption id=\"caption-attachment-55379\" class=\"wp-caption-text\">Fig. 5: Backup directory<\/figcaption><\/figure><\/p>\n<p>Do <strong>remember<\/strong>, this command overwrites the existing output files in the backup data folder. The below list shows the options that can be used with the <strong>mongodump<\/strong> command.<\/p>\n<table>\n<tbody>\n<tr>\n<th style=\"text-align: center;\"><strong>Syntax<\/strong><\/th>\n<th style=\"text-align: center;\"><strong>Description<\/strong><\/th>\n<th style=\"text-align: center;\"><strong>Example<\/strong><\/th>\n<\/tr>\n<tr>\n<td><code>mongodump --host HOST_NAME --port PORT_NUMBER<\/code><\/td>\n<td>This command takes the databases backup of the specified MongoDB instance.<\/td>\n<td><code>mongodump --host hp-PC --port 27017<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>mongodump --dbpath DB_PATH --out BACKUP_DIRECTORY<\/code><\/td>\n<td>This command will take the databases backup at the specified path.<\/td>\n<td><code>mongodump --dbpath \/data\/db\/ --out \/mongodb_backup\/data\/<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>mongodump --collection COLLECTION --db DB_NAME<\/code><\/td>\n<td>This command will take the backup of a specified collection of a particular database.<\/td>\n<td><code>mongodump --collection umongo --db udemy<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>mongodump --db DB_NAME<\/code><\/td>\n<td>This command will take the backup of a particular database only.<\/td>\n<td><code>mongodump --db udemy<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>2.2 Restoring the Data<\/h3>\n<p>Let\u2019s say something bad happened at night and the business data was deleted. In MongoDB, the <span style=\"text-decoration: underline;\">restore utility<\/span> restores the data created by the <a href=\"https:\/\/docs.mongodb.com\/manual\/reference\/program\/mongorestore\/\" target=\"_blank\" rel=\"noopener\">mongodump<\/a>. The <strong>mongorestore<\/strong> command restores an entire database or a subset of the backup and this command imports the database backup from the <code>dump<\/code> directory to the mongod instance. Here is what the syntax will look like.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>Syntax<\/em><\/span><\/p>\n<pre class=\"brush:bash;wrap-lines:false;\">&gt; mongorestore\r\n<\/pre>\n<p>Let&#8217;s understand this with the help of an example.<\/p>\n<h4>2.2.1 Drop Databases<\/h4>\n<p>Go to the mongo shell and drop the <em>udemy<\/em> and <em>employee<\/em> databases. We will drop the two databases by executing the <code>db.dropDatabase()<\/code> command as shown below.<\/p>\n<p><figure id=\"attachment_55380\" aria-describedby=\"caption-attachment-55380\" style=\"width: 849px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-6.jpg\"><img decoding=\"async\" class=\"size-full wp-image-55380\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-6.jpg\" alt=\"Fig. 6: Dropping the databases\" width=\"849\" height=\"148\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-6.jpg 849w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-6-300x52.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-6-768x134.jpg 768w\" sizes=\"(max-width: 849px) 100vw, 849px\" \/><\/a><figcaption id=\"caption-attachment-55380\" class=\"wp-caption-text\">Fig. 6: Dropping the databases<\/figcaption><\/figure><\/p>\n<h4>2.2.2 Restoring Databases<\/h4>\n<p>In this step, we will go ahead and restore the two databases. Go back to the administration window and type the <code>mongorestore<\/code> command to restore the databases from the backup directory.<\/p>\n<p><figure id=\"attachment_55381\" aria-describedby=\"caption-attachment-55381\" style=\"width: 849px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-7.jpg\"><img decoding=\"async\" class=\"size-full wp-image-55381\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-7.jpg\" alt=\"Fig. 7: Restoring the databases\" width=\"849\" height=\"139\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-7.jpg 849w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-7-300x49.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-7-768x126.jpg 768w\" sizes=\"(max-width: 849px) 100vw, 849px\" \/><\/a><figcaption id=\"caption-attachment-55381\" class=\"wp-caption-text\">Fig. 7: Restoring the databases<\/figcaption><\/figure><\/p>\n<p>This command goes inside the <code>dump<\/code> directory, checks for the databases and restores them to the mongod instance.<\/p>\n<h4>2.2.3 Check Restored Databases<\/h4>\n<p>Now, go back to the mongo shell and we will check the restored databases by executing the <code>show dbs<\/code> command as shown below.<\/p>\n<p><figure id=\"attachment_55382\" aria-describedby=\"caption-attachment-55382\" style=\"width: 849px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-8.jpg\"><img decoding=\"async\" class=\"size-full wp-image-55382\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-8.jpg\" alt=\"Fig. 8: Check databases\" width=\"849\" height=\"70\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-8.jpg 849w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-8-300x25.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/mongodb-br-project-guide-8-768x63.jpg 768w\" sizes=\"(max-width: 849px) 100vw, 849px\" \/><\/a><figcaption id=\"caption-attachment-55382\" class=\"wp-caption-text\">Fig. 8: Check databases<\/figcaption><\/figure><\/p>\n<p>The below list shows the options that can be used with the <strong>mongorestore<\/strong> command.<\/p>\n<table>\n<tbody>\n<tr>\n<th style=\"text-align: center;\"><strong>Syntax<\/strong><\/th>\n<th style=\"text-align: center;\"><strong>Description<\/strong><\/th>\n<th style=\"text-align: center;\"><strong>Example<\/strong><\/th>\n<\/tr>\n<tr>\n<td><code>mongorestore --db DB_NAME COLLECTION_PATH<\/code><\/td>\n<td>This command will restore a particular database from the backup location.<\/td>\n<td><code>mongorestore --db udemy dump\/udemy<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>mongorestore --db DB_NAME --collection COLLECTION_NAME COLLECTION_PATH<\/code><\/td>\n<td>This command will restore a particular collection of a specified database from the backup location.<\/td>\n<td><code>mongorestore --db udemy --collection umongo dump\/udemp\/umongo.bson<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>That\u2019s all for this post. Happy Learning!!<\/p>\n<h2>3. Conclusion<\/h2>\n<p>In this tutorial, we learned about the data backup and restore features of the MongoDB. Developers can download the sample commands in the <a href=\"#projectDownload\">Downloads<\/a> section.<\/p>\n<h2><a name=\"projectDownload\"><\/a>4. Download the Eclipse Project<\/h2>\n<p>This was an example of <em>Backup<\/em> and <em>Restore<\/em> utilities of the MongoDB.<\/p>\n<div class=\"download\"><strong>Download<\/strong><br \/>\nYou can download the full source code of this example here: <a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2018\/02\/MongoDbBackupAndRestoreEx.zip\" target=\"_blank\" rel=\"noopener\"><strong>MongoDbBackupAndRestoreEx<\/strong><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Hello readers, these days it is very important to protect the data against any damage if a disaster or the unforeseen outages. Thus, irrespective of the database type, it is important to keep up the regular data backups to make data available during the server crash or data corruption. In this tutorial, we will see &hellip;<\/p>\n","protected":false},"author":119,"featured_media":36154,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1447],"tags":[1194],"class_list":["post-55374","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mongodb","tag-mongodb"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>MongoDB Backup and Restore Example - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Hello readers, in this tutorial, we will learn and see how to implement the backup and restore features of the MongoDB database.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/mongodb-backup-restore-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MongoDB Backup and Restore Example - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Hello readers, in this tutorial, we will learn and see how to implement the backup and restore features of the MongoDB database.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/mongodb-backup-restore-example\/\" \/>\n<meta property=\"og:site_name\" content=\"Examples Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2018-02-14T13:00:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/mongodb-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Yatin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Yatin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/mongodb-backup-restore-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/mongodb-backup-restore-example\/\"},\"author\":{\"name\":\"Yatin\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/9874407a37b028e8be3276e2b5960d13\"},\"headline\":\"MongoDB Backup and Restore Example\",\"datePublished\":\"2018-02-14T13:00:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/mongodb-backup-restore-example\/\"},\"wordCount\":990,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/mongodb-backup-restore-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/mongodb-logo.jpg\",\"keywords\":[\"MongoDb\"],\"articleSection\":[\"MongoDB\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/mongodb-backup-restore-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/mongodb-backup-restore-example\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/mongodb-backup-restore-example\/\",\"name\":\"MongoDB Backup and Restore Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/mongodb-backup-restore-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/mongodb-backup-restore-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/mongodb-logo.jpg\",\"datePublished\":\"2018-02-14T13:00:48+00:00\",\"description\":\"Hello readers, in this tutorial, we will learn and see how to implement the backup and restore features of the MongoDB database.\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/mongodb-backup-restore-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/mongodb-backup-restore-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/mongodb-backup-restore-example\/#primaryimage\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/mongodb-logo.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/mongodb-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/mongodb-backup-restore-example\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/examples.javacodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Software Development\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/software-development\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"MongoDB\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/software-development\/mongodb\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"MongoDB Backup and Restore Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Examples and Code Snippets\",\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/javacodegeeks\",\"https:\/\/x.com\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/9874407a37b028e8be3276e2b5960d13\",\"name\":\"Yatin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2023\/09\/cropped-Yatin-Batra_avatar_1515758148-96x96.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2023\/09\/cropped-Yatin-Batra_avatar_1515758148-96x96.jpg\",\"caption\":\"Yatin\"},\"description\":\"An experience full-stack engineer well versed with Core Java, Spring\/Springboot, MVC, Security, AOP, Frontend (Angular &amp; React), and cloud technologies (such as AWS, GCP, Jenkins, Docker, K8).\",\"sameAs\":[\"https:\/\/www.javacodegeeks.com\"],\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/yatin-batra\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"MongoDB Backup and Restore Example - Java Code Geeks","description":"Hello readers, in this tutorial, we will learn and see how to implement the backup and restore features of the MongoDB database.","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:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/mongodb-backup-restore-example\/","og_locale":"en_US","og_type":"article","og_title":"MongoDB Backup and Restore Example - Java Code Geeks","og_description":"Hello readers, in this tutorial, we will learn and see how to implement the backup and restore features of the MongoDB database.","og_url":"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/mongodb-backup-restore-example\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2018-02-14T13:00:48+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/mongodb-logo.jpg","type":"image\/jpeg"}],"author":"Yatin","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Yatin","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/mongodb-backup-restore-example\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/mongodb-backup-restore-example\/"},"author":{"name":"Yatin","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/9874407a37b028e8be3276e2b5960d13"},"headline":"MongoDB Backup and Restore Example","datePublished":"2018-02-14T13:00:48+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/mongodb-backup-restore-example\/"},"wordCount":990,"commentCount":0,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/mongodb-backup-restore-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/mongodb-logo.jpg","keywords":["MongoDb"],"articleSection":["MongoDB"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/mongodb-backup-restore-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/mongodb-backup-restore-example\/","url":"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/mongodb-backup-restore-example\/","name":"MongoDB Backup and Restore Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/mongodb-backup-restore-example\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/mongodb-backup-restore-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/mongodb-logo.jpg","datePublished":"2018-02-14T13:00:48+00:00","description":"Hello readers, in this tutorial, we will learn and see how to implement the backup and restore features of the MongoDB database.","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/mongodb-backup-restore-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/mongodb-backup-restore-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/mongodb-backup-restore-example\/#primaryimage","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/mongodb-logo.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/04\/mongodb-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/examples.javacodegeeks.com\/software-development\/mongodb\/mongodb-backup-restore-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/examples.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Software Development","item":"https:\/\/examples.javacodegeeks.com\/category\/software-development\/"},{"@type":"ListItem","position":3,"name":"MongoDB","item":"https:\/\/examples.javacodegeeks.com\/category\/software-development\/mongodb\/"},{"@type":"ListItem","position":4,"name":"MongoDB Backup and Restore Example"}]},{"@type":"WebSite","@id":"https:\/\/examples.javacodegeeks.com\/#website","url":"https:\/\/examples.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Examples and Code Snippets","publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/examples.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/examples.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/9874407a37b028e8be3276e2b5960d13","name":"Yatin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2023\/09\/cropped-Yatin-Batra_avatar_1515758148-96x96.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2023\/09\/cropped-Yatin-Batra_avatar_1515758148-96x96.jpg","caption":"Yatin"},"description":"An experience full-stack engineer well versed with Core Java, Spring\/Springboot, MVC, Security, AOP, Frontend (Angular &amp; React), and cloud technologies (such as AWS, GCP, Jenkins, Docker, K8).","sameAs":["https:\/\/www.javacodegeeks.com"],"url":"https:\/\/examples.javacodegeeks.com\/author\/yatin-batra\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/55374","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/users\/119"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=55374"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/55374\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media\/36154"}],"wp:attachment":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=55374"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=55374"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=55374"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}