External Database

testgrinder service will be discontinued on January 31, 2025

testgrinder SMPC was discontinued as of February 1, 2024

When deploying tg-prod testgrinder, you will configure tg-app servers to shutdown preinstalled MongoDB database and configure them with a URL to an external MongoDB database. It may either be a database managed by mongodb.com (see steps below for setting it up) or your MongoDB database instance of a compatible version.

MongoDB database preinstalled on tg-app servers can be shutdown by setting DISABLE_LOCAL_MONGODB .env configuration file parameter to true. This will be covered in detail later when tg-app servers are launched.

If you choose to provide your own MongoDB database, make sure it can be accessed from the testgrinder VPC. Then specify the URI to the database in the .env configuration file by setting the value of the MONGODB_URI parameter.

To use a database hosted by mongodb.com, follow these steps:

  1. Sign up for an account with mongodb.com

  2. Sign up for a cluster:

    1. Type: Dedicated

    2. Cloud Provider: AWS

    3. Choose the same region as for testgrinder

    4. Cluster Tier: M10 with 10GB of storage

    5. Version: choose the version appropriate for the testgrinder version you are deploying

    6. Cluster Name: tg-prod

  3. Setup Peering Connection

    1. Once the database is up, choose it in mongodb.com console

    2. Select Network Access, then Peering

    3. Click Add Peering Connection and complete the process for peering with testgrinder VPC as instructed

To get the URI to your mongodb.com database, follow these steps:

  1. Select the database in mongodb.com console

  2. Click on Connect button

  3. Choose Connect your application

  4. In Driver choose Ruby, in version: 2.16 or later

  5. You will be shown an URI like this:

mongodb+srv://<user>:<password>@tg-prod.fzwr3.mongodb.net/?retryWrites=true&w=majority

To get the URI to the form usable by testgrinder, make sure the <user> and <password> are those you picked when setting up the database and add the database name tg_app_production after the last '/'.

For example if <user> is testgrinder and <password> is my-secret-password then URI will be:

mongodb+srv://testgrinder:my-secret-password@tg-prod.fzwr3.mongodb.net/tg_app_production?retryWrites=true&w=majority

Use this as the value for MONGODB_URI parameter in the .env configuration file (or set the value in the User Data). See Finalizing Configuration File .env.

Migrating Data from Another testgrinder deployment

If you wish to migrate the data from another testgrinder deployment, follow the steps in Backup and Restore Database

Last updated