Environment Setup : PostgreSQL - richiedjohnson/vital2.0 GitHub Wiki
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
- 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.
-
Type
sudo -u postgres psql postgres
in the terminal. This connects to postgres database as postgres user. -
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 -
Change /etc/postgresql//main/pg_hba.conf similar to below

- 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]