Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Reset back to HSQLDB database:

Code Block
dbmigration -r



Anchor
newdbpass
newdbpass
Changing the PostgreSQL password in the cloud


If the PostgreSQL database password is ever changed, you'll need to re-encrypt it and store it again in the cloud config files.

The way to do it is to call dbmigration with the -es flag and the new password:

Code Block
dbmigration -es THE_NEW_PASSWORD

The cloud will be restarted automatically.


Working with PostgreSQL on localhost

...

  • Stop the cloud server.

  • Install PostgreSQL (version 9.6 or above) on cloud server machine or database server.

  • Change maximum DB connections in PostgreSQL

  • Open command line tool with Administrator privileges (on Windows or Mac environment).

  • Navigate to Server folder under cloud installation folder.

  • Run dbmigration tool, provide database connection details: PostgreSQL installation location on cloud server machine, database connection string, (Database name should contain only lowercase letters) user and password,

  • for example:

    • Example for Windows environment:

      Code Block
      dbmigration -m "C:\Program Files\PostgreSQL\9.6" jdbc:postgresql://localhost:5432/cloudserver postgres 123456
    • Example for Mac environment:

      Code Block
      sudo ./dbmigration -m /Library/PostgreSQL/9.6 jdbc:postgresql://localhost:5432/cloudserver postgres 123456
  • Ensure that migration finished successfully in migration tool output.

  • Start the cloud server if it was not started automatically by migration tool.

  • Ensure that you can access Cloud UI.

...


How to allow remote connections to PostgreSQL database server


Warning

 Latency between the cloud server and its database of more than few milliseconds is not supported!

By default, PostgreSQL allows connections only from localhost.
DB configuration file files can be changed to allow connections from other hosts. 

The file is located in Postgres installation folder (PostgreSQL\9.6\10\data\postgresql.conf and PostgreSQL\10\data\pg_hba.conf)

In the following example, we've added the IP addresses range we Change listen address:

Open postgres.conf file located at PostgreSQL\10\data\postgresql.conf.

Search for listen_address, and set it to '*', or if you want to set connection restrictions to a few IP’s, you can use comma separated list of addresses.

Image Added


Allow Connections:

In this step, you need to allow remote connections to actually reach your PostgreSQL server.

Open pg_hba.conf file located at PostgreSQL\10\data\pg_hba.conf.

To allow connections from absolutely any address with password authentication add this line at the end of pg_hba.conf  file:

Image Added

 Or add the IP addresses range you want to allow a connection from:.

Image Removed

For more information go to: https://www.postgresql.org/docs/9.5/static/auth-pg-hba-conf.html

Backup:

When the database server is on a different machine - PostgreSQL should be installed on both database server and cloud server in order to be able to perform database backup from the cloud server.

...

Please follow these steps in order to change database back to HSQLDB (works only after migration to PostgreSQL database):

  • Stop the cloud server.

  • Open command line tool with Administrator privileges (on Windows or Mac environment).

  • Navigate to Server folder under cloud installation folder.

  • Run dbmigration tool in reset mode, example:

    Code Block
    dbmigration -r
  • Ensure that reset finished successfully in migration tool output.


  • Start the cloud server if it was not started automatically by migration tool.

  • Ensure that you can access Cloud UI.

...