Skip to main content

Creating a ./pgdata folder (Docker)

When Informer is installed via Docker on Linux, we recommend reconfiguring Postgres to use a ./pgdata folder on the host rather than the default location inside the Postgres container. This keeps your data from being erased when the Postgres container is replaced, for example during a version upgrade.

If you are upgrading from a version prior to 5.0.9, you need to create this directory and adjust some configuration manually. Follow the steps below.

Back up before you start

This procedure moves your database. Make a verified backup first.

  1. Create a ./pgdata folder in the same directory as your docker-compose.yml.

  2. Make a dump of the Postgres database:

    docker-compose exec postgres pg_dump -U i5 i5 > i5_backup.sql

    This may prompt for your postgres password (whatever you configured; the default is informer5). It can take a while depending on your data. When it finishes, verify that i5_backup.sql has contents (a file size greater than 0 KB).

  3. Edit docker-compose.yml and add a volume under postgres for the pgdata folder, for example:

    postgres:
    image: postgres:9.6
    environment:
    - POSTGRES_USER=i5
    volumes:
    - ./pgdata:/var/lib/postgresql/data
  4. Stop the Postgres container:

    docker-compose stop postgres
  5. Delete the Postgres container:

    docker-compose rm postgres
  6. Start the Postgres container:

    docker-compose up -d postgres
  7. Verify that the ./pgdata folder now has contents.

  8. Load the backup into Postgres:

    docker-compose exec postgres psql i5 -U i5 -f i5_backup.sql

If you run into any issues, contact Support at i5support@entrinsik.com.