What you will need:
- PostgreSQL server
- Docker (optional if you already have a pg instance)
- Database dump file (
backup.dump
) - PostgreSQL client tools (
psql
,pg_restore
)
docker run --name postgres-db \
-e POSTGRES_PASSWORD=your_password \
-e POSTGRES_USER=your_username \
-e POSTGRES_DB=indexer \
-p 5432:5432 \
-d postgres:latest
psql -h your_host -U your_username -d indexer -c "CREATE ROLE grantexplorer;"
pg_restore \
--host=your_host \
--username=your_username \
--dbname=indexer \
--no-owner \
--no-acl \
--verbose \
--clean \
--no-privileges \
backup.dump
PS: Might get a warning like pg_restore: warning: errors ignored on restore: 106
. You can ignore it.
psql -h your_host -U your_username -d indexer -c "\dt"
psql -h your_host -U your_username -d indexer