Skip to content

Add to readme instructions on restoring DB #801

@ghost

Description

Restores backup taken by pg_dump

Run in first terminal window (with or without -d, as you prefer, just make sure it's running):

COMPRESS_ENABLED=1 docker compose -f docker-compose.dev.yml up

Run in second terminal window:

docker compose -f docker-compose.dev.yml exec web psql -h postgres -U postgres

In Postgres shell:

create database temp;
(If it already exists that's fine, carry on)
\connect temp
drop database postgres;
create database postgres;
\q

Back on command line:

docker compose -f docker-compose.dev.yml exec web pg_restore -v -h postgres -U postgres -d postgres /usr/src/app/filename.dump 

At the end, a whole range of "role ?? does not exist" errors are fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions