Environment Setup : PostgreSQL - richiedjohnson/vital2.0 GitHub Wiki

Environment Setup : PostgreSQL

PostgreSQL is the database server which is used for Vital 1.0 & 2.0 alike. However data models for each of these applications vary drastically. This entry is to help you setup database server and migrate existing data models.

Installation

  1. Use this only if you know what you are doing. Doing this in development environment is OK. Check before running this in production.
    sudo apt-get update

2.The below code installs and starts the database server
sudo apt-get install postgresql postgresql-contrib

Server setup
On installation postgreSQL creates an account called "postgres" on the server. We need to set the password of this PostgreSQL user (role) to allow us to connect to the database from outside of the server.

  1. Type sudo -u postgres psql postgres in the terminal. This connects to postgres database as postgres user.

  2. Then type in \password postgres to set a new password for postgres database account. It is advised not to create password for the corresponding unix account to allow login. To exit psql after this - type /q

  3. Change /etc/postgresql//main/pg_hba.conf similar to below

  1. Also change listen_addresses = '*' in /etc/postgresql//main/postgresql.conf

To check if this configuration worked
Use Navicat to remote access the database. Navicat setup
Note - To get navicat licence details, talk to the prof

[TODO : steps to copy existing database to new server]

⚠️ **GitHub.com Fallback** ⚠️