You can backup your forum database using standard PostgreSQL
Of course, PostgreSQL is already installed inside Docker container’s virtual machine, but it is convenient to access the database without diving into the virtual machine.
For dumping database, you need only to install PostgreSQL client tools, not a server.
On Debian / Ubuntu PostgreSQL client tools can be installed by command:
aptitude install postgresql-client
Set up authentication for
In contract to
mysqldump, you can not specify your database password as
I recommend to create
.pgpass file in your home directory with your PostgreSQL credentials.
It is a plain text file with single line:
You have already got a password if you followed the instruction How to access Discourse database.
Insert it in
.pgpass file in place of
Set access permissions for
.pgpass file to
0600 (it means read / write access for you and no access for others).
pg_dump --clean --create --schema=public --no-owner --no-privileges --host=localhost --port=<port> --username=postgres discourse > <filename>.sql
Set your database port in place of
<port> (you should set it in
Set your backup file name in place of