How to restore from pgdump on local development docker install?

I was previously using the macOS environment, but I got tired of rails code breaking after Discourse updates, so I’m trying the docker setup.

Everything worked up to the point where I see the wizard welcome screen, but I’m trying to restore my old development database content with this command:

psql -d discourse_development -f my_old_pg_dump.sql

Which isn’t making a difference because it’s not targeting the DB in the docker container. I’ve also tried using d/psql but then it can’t access the sql file.

I feel like there’s something obvious I’m missing.

I figured out that the docker image maps the current folder, so I moved the sql file there and was able to access it:

d/shell_root
su postgres -c "psql -d discourse_development -f my_old_pg_dump.sql"
3 Likes