<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="https://wiseoneup.clickvalley.in/rss/xslt"?>
<rss xmlns:a10="http://www.w3.org/2005/Atom" version="2.0">
  <channel>
    <title>wiseonup</title>
    <link>https://wiseoneup.clickvalley.in/</link>
    <description>for knowledge and fun</description>
    <generator>Articulate, blogging built on Umbraco</generator>
    <item>
      <guid isPermaLink="false">1243</guid>
      <link>https://wiseoneup.clickvalley.in/articles/how-to-back-up-and-restore-remote-monogo-db-to-local-server/</link>
      <category>Technology</category>
      <title>How to back-up and restore remote monogo db to local server</title>
      <description>&lt;p&gt;It may sound difficult at first but it is very easy to backup and restore a mongodb database. Here are the steps to achieve this –&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Download and install Mongodb CLI db tools from this link on both remote server as well as local machine –&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;a href="https://www.mongodb.com/try/download/database-tools?tck=docs_databasetools"&gt;       https://www.mongodb.com/try/download/database-tools?tck=docs_databasetools&lt;/a&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;While installing remember the path where this installer is placing its files. For windows the default &lt;strong&gt;mongo db tools&lt;/strong&gt; &lt;strong&gt;path&lt;/strong&gt; that it took was C:\Program Files\MongoDB\Tools\100\bin&lt;/p&gt;
&lt;ol start="2"&gt;
&lt;li&gt;On server, open terminal and make the &lt;strong&gt;mongo db tools&lt;/strong&gt; &lt;strong&gt;path&lt;/strong&gt; as your present working directory and run this command –&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;em&gt;mongodump&lt;/em&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Since we are not passing any attributes to this command, it will create back up of all running databases under a dump folder which you can now see in present working directory.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Copy the database folder that you want to restore on local and transfer it to your local system.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;ol start="3"&gt;
&lt;li&gt;On your local machine, create a new folder called dump under &lt;strong&gt;mongo db tools&lt;/strong&gt; &lt;strong&gt;path &lt;/strong&gt;and paste the copied folder.&lt;/li&gt;
&lt;li&gt;On your local machine, open terminal and make the &lt;strong&gt;mongo db tools&lt;/strong&gt; &lt;strong&gt;path&lt;/strong&gt; as your present working directory and run this command&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;em&gt;mongorestore&lt;/em&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;This will restore/create a database in your local mongodb server.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;P.S&lt;/p&gt;
&lt;p&gt;Before running these commands, make sure your mongo db server is running.&lt;/p&gt;</description>
      <pubDate>Sun, 29 May 2022 12:00:00 +0530</pubDate>
      <a10:updated>2022-05-29T12:00:00+05:30</a10:updated>
    </item>
  </channel>
</rss>