Skip to content

Load and manage database dumps

xavierfav edited this page Sep 2, 2021 · 3 revisions

ANONYMIZE

create db

psql postgres create database fsdatasets_dump;

load db

psql fsdatasets_dump < fsdatasets.sql

anonymize

psql postgres \connect fsdatasets_dump Copy the lines from anonymize_db.sql ...

dump pg_dump fsdatasets_dump | gzip > fsdatasets_ANON.sql.gz

LOAD NEW DATABSE DUMP

start db service

docker-compose up db

connect to psql inside container

docker-compose run --rm db psql -h db -U postgres

drop existing db

drop database freesound_datasets

create new one

create database freesound_datasets

exit Ctl+D

load dump into new empty database

docker-compose run --rm db psql -h db -U postgres freesound_datasets < fsdatasets.sql

stop db service Ctl+C

start app: Maybe it will fail the first time, just start stop it and start again

docker-compose up

Clone this wiki locally