# Migrate db

**URL:** <https://forum.pritunl.com/t/migrate-db/462>\
**Category:** Pritunl VPN\
**Tags:** pritunl\
**Created:** [October 18, 2022, 8:53pm UTC](https://forum.pritunl.com/t/migrate-db/462 "2022-10-18T20:53:10Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![user101](https://forum.pritunl.com/letter_avatar_proxy/v4/letter/u/a9a28c/32.png) [@user101](https://forum.pritunl.com/u/user101)\
**Post date:** [October 18, 2022, 8:53pm UTC](https://forum.pritunl.com/t/migrate-db/462/1 "2022-10-18T20:53:10Z")

</div>

I’m currently using the enterprise version of pritunl. The VPN server and Mongo DB is installed on the same server. Let’s say this is in AWS US WEST.  
Now I have a need to deploy another VPN server in a different region, this time in AWS US EAST. What is the easiest way to connect this VPN server to the DB that is in US WEST.

---

<div class="post-metadata">

**Author:** ![zach](https://forum.pritunl.com/user_avatar/forum.pritunl.com/zach/32/1105_2.png) [@zach](https://forum.pritunl.com/u/zach)\
**Post date:** [October 19, 2022, 6:54pm UTC](https://forum.pritunl.com/t/migrate-db/462/2 "2022-10-19T18:54:12Z")

</div>

The Pritunl server will need a way to access the MongoDB server. If this is done over the internet the [**securing MongoDB documentation**](https://docs.pritunl.com/docs/securing-mongodb) has information on securing the database.

---

<div class="post-metadata">

**Author:** ![user101](https://forum.pritunl.com/letter_avatar_proxy/v4/letter/u/a9a28c/32.png) [@user101](https://forum.pritunl.com/u/user101)\
**Post date:** [October 19, 2022, 7:15pm UTC](https://forum.pritunl.com/t/migrate-db/462/3 "2022-10-19T19:15:33Z")

</div>

Are there instructions on how to connect a pritunl vpn server to a remote MongoDB server that lives on another printunl vpn server?

---

<div class="post-metadata">

**Author:** ![zach](https://forum.pritunl.com/user_avatar/forum.pritunl.com/zach/32/1105_2.png) [@zach](https://forum.pritunl.com/u/zach)\
**Post date:** [October 20, 2022, 3:14pm UTC](https://forum.pritunl.com/t/migrate-db/462/4 "2022-10-20T15:14:31Z")

</div>

Only the URI in `/etc/pritunl.conf` needs to be updated. The MongoDB server will need to be configured with `bindIp: 0.0.0.0` to accept remote traffic. Authentication should be enabled when doing this, the [**securing MongoDB documentation**](https://docs.pritunl.com/docs/securing-mongodb) has information on this.

---

<div class="post-metadata">

**Author:** ![user101](https://forum.pritunl.com/letter_avatar_proxy/v4/letter/u/a9a28c/32.png) [@user101](https://forum.pritunl.com/u/user101)\
**Post date:** [October 26, 2022, 11:44pm UTC](https://forum.pritunl.com/t/migrate-db/462/5 "2022-10-26T23:44:23Z")

</div>

I was able to follow the instructions and secure the MongoDB with a username and password. My local printul server (i.e. the same as the mongodb server) can now connect to MongoDB with authentication. I will also configure my remote pritunl server to connect to the same MongoDB. Since the remote pritunl vpn server will be traversing the internet, I would like to turn on SSL for the MongoDB. Since my printul server is already using Let’s Encrypt, is it possible for me to reuse the same certificate for MongoDB? If so, where is the private key located on Pritunl server? I need to reference this key in the mongoDB config file. Thx.

---

<div class="post-metadata">

**Author:** ![tranngoclai](https://forum.pritunl.com/user_avatar/forum.pritunl.com/tranngoclai/32/713_2.png) [@tranngoclai](https://forum.pritunl.com/u/tranngoclai)\
**Post date:** [January 24, 2024, 9:34am UTC](https://forum.pritunl.com/t/migrate-db/462/6 "2024-01-24T09:34:56Z")

</div>

I have the same question.

---

<div class="post-metadata">

**Author:** ![user101](https://forum.pritunl.com/letter_avatar_proxy/v4/letter/u/a9a28c/32.png) [@user101](https://forum.pritunl.com/u/user101)\
**Post date:** [January 24, 2024, 5:29pm UTC](https://forum.pritunl.com/t/migrate-db/462/7 "2024-01-24T17:29:42Z")

</div>

I wasn’t able to reuse the Let’s Encrypt cert. Instead, I used my own cert for MongoDB.
