Unable to restore backup in web_only installation


(Melroy Neil Dsouza) #1

After taking so many pains and strains, I finally got web_only docker configured. I wanted to import my backup from the development env I have and when I tried to restore, I get this error

pg_dump -s -x -O -f /var/www/discours
e/db/structure.sql discourse failed

Of course this command will and should fail because the the postgres db is on another machine. Is there a way to fix this?


(Matt Palmer) #2

Please describe the full process you followed, including all commands and their outputs.


(Melroy Neil Dsouza) #3

I tried installing discourse using web_only.yml app.yml sample but failed. Then according to this article, Running Discourse with a separate PostgreSQL server , I mutated the standalone app.yml sample and it worked.
Now I try to import an old backup but I get this error.


(Matt Palmer) #4

“including all commands and their outputs.”


(Melroy Neil Dsouza) #5

cd /var; git clone GitHub - discourse/discourse_docker: A Docker image for Discourse discourse

Then
cd discourse ; cp ./samples/web_only.yml ./containers/app.yml
Edit the config
Run
./launcher bootstrap app
Fails with a weird error of trying to remove container data
cp ./samples/standalone.yml ./containers/app.yml
Edit the config: remove redis and postgres templates and give the hosts and password.
./launcher bootstrap app
Runs fine and uses external db

Download the backup and put it in the /var/discourse/shared/standalone/backups/default/
Do ./launcher enter app
Run
discourse allow_restore
discourse restore filename
The command gives output of finding the file, extracting it, some postgres process runs some alter table and create index output and then fails
Command pg_dump -s -x -O -f /var/www/discours
e/db/structure.sql discourse failed
Make sure pg_dump is installed
I run the command pg_dump to make sure the command exists and it does