Connect a self-managed profiles database

Skill required
Advanced Web Programming

By default DjaoDjin creates a fully-managed separate profiles database for your site. In most you will prefer to let DjaoDjin manage the security, backup and upgrades of the profiles database, potentially downloading a copy of the most recent backup if necessary.

None-the-less you might want to connect a live self-managed profiles database under specific circumstances.

Create a database

The first step is to create a PostgreSQL database with an Internet accessible URL endpoint. There are many Database hosting services you can choose from, for example AWS RDS PostgreSQL instances.

Once set up, you should have:

  • Database name
  • URL endpoint to connect to the database
  • Username to connect to the database
  • Password to identify the username

The information sometimes comes in a form of a full URI endpoint as in:

bash
postgresql://username:password@endpoint/db_name

Initialize the database schema

Download the database schema for the version of djaoapp you are running (ex: latest db schema).

Then initialize the previously created database using the schema.

bash
$ psql -f schema.sql -U username --host=endpoint db_name

Connect the database to your site

In the DjaoDjin control panel, click on self-manage under Users and profiles database, enter the information gathered earlier.

Database host
URL endpoint to connect to the database
Database port
The port on the database host to connect to (defaults to 5432)
Database name
The name of the database
Database username
Username to connect to the database
Database password
Password to identify the username

Double-check the values entered, then click the button Use self-managed database.

Attention

You will have to populate the database with initial values if you want to be able to login to your site.

Restrict access further

DjaoDjin's connection to the database will only originate from the following IP addresses. If your database provider also you to restrict connection by IP addresses, it is recommended to do so.

RegionIP addresses
Europe18.185.158.97
North America34.208.16.40, 52.11.138.238