Configuring a remote MongoDB (AEN 4.1.3)
========================================

.. raw:: html

    <p>To configure your remote database to work with AEN server:</p>
    <ol class="arabic">
    <li><p class="first">Stop the server, gateway and compute nodes:</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>sudo service wakari-server stop
    sudo service wakari-gateway stop
    sudo service wakari-compute stop
    </pre></div>
    </div>
    </li>
    <li><p class="first">Open the <code class="docutils literal"><span class="pre">/opt/wakari/wakari-server/etc/wakari/config.json</span></code>
    file and create the MONGO_URL key. For the value parameter, add the
    database information.</p>
    <p>The final file should read:</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span><span class="o">{</span>
      <span class="s2">&quot;MONGO_URL&quot;</span>: <span class="s2">&quot;mongodb://MONGO-USER:MONGO-PASSWORD@MONGO-URL:MONGO-PORT&quot;</span>,
      <span class="s2">&quot;WAKARI_SERVER&quot;</span>: <span class="s2">&quot;http://YOUR-IP&quot;</span>,
      <span class="s2">&quot;USE_SES&quot;</span>: false,
      <span class="s2">&quot;CDN&quot;</span>: <span class="s2">&quot;http://YOUR-IP/static/&quot;</span>,
      <span class="s2">&quot;ANON_USER&quot;</span>: <span class="s2">&quot;anonymous&quot;</span>
    <span class="o">}</span>
    </pre></div>
    </div>
    <p>For more information about configuration keys, see
    <a class="reference internal" href="use-config-files.html"><span class="doc">Using configuration files</span></a>.</p>
    </li>
    <li><p class="first">Migrate the data from the former database into the new one.
    For more information, see the <a class="reference external" href="https://docs.mongodb.com/manual/tutorial/backup-and-restore-tools/">MongoDB documentation website</a>.</p>
    </li>
    <li><p class="first">After migration, restart the nodes:</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>sudo service wakari-server start
    sudo service wakari-gateway start
    sudo service wakari-compute start
    </pre></div>
    </div>
    </li>
    </ol>
