Importing a Discourse backup into a PostGreSQL DB

Dear Discourse team,

Please could you advise me how can I import a backup into PostGreSQL DB.

I am using

psql  --username=xx--password=xx  mydb < C:\...\backup.tar

but I get a weird message:

orden \Y¾³s'ìfu7}Ø$M²ÏñT?ýï>/ no válida
ERROR:  secuencia de bytes no válida para codificación «UTF8»: 0x8b

Thanks so much for your help!

Best regards,

Alexandra.

First extract the tar file

tar xf backup.tar

Then
zcat dump.sql.gz | psql -u username mydb

On Windows, you might have to use a tool like Winrar multiple times to go from backup.tar.gz to backup.tar to dump.sql.gz to dump.sql and then

psql -u username mydb < dump.sql

4 Likes

Thanks so much Richard!