EDIT: I should have started a new topic.
EDIT: Just want to make sure @sam sees this, apologies if it’s just on the back burner.
I think I have such an issue.
I’ve got an instance on GCP with PG on their PostgreSQL 11. I had to
- exec:
cd: $home
cmd:
- apt -y remove postgresql-client-10
- apt -y install postgresql-client-11
That seems to have worked. I get this in the container:
root@community-bootstrap-import:/var/www/discourse# psql --version
psql (PostgreSQL) 11.5 (Debian 11.5-1.pgdg100+1)
Oh, but wait!
postgres=> select version();
version
----------------------------------------------------------------------------------------
PostgreSQL 11.4 on x86_64-pc-linux-gnu, compiled by gcc (Debian 7.3.0-5) 7.3.0, 64-bit
(1 row)
Should the minor version matter?
I’d completed an import, did a backup, did some stuff, tried to restore the backup. It failed with some missing table stuff that I thought might have to do with my not understanding … something.
So I dropped/created the database, then
rake db:migrate
discourse backup
discourse enable_restore
discourse restore the-backup-filename
and then I get something like this:
...
No metadata file to extract.
Validating metadata...
Current version: 20190908234054
Restored version: 20190908234054
tar: dump.sql: Not found in archive
tar: Exiting with failure status due to previous errors
Extracting dump file...
Creating missing functions in the discourse_functions schema
Cannot restore into different schema, restoring in-place
Enabling readonly mode...
Pausing sidekiq...
Waiting for sidekiq to finish running jobs...
Restoring dump file... (can be quite long)
SET
SET
SET
SET
SET
set_config
------------
(1 row)
SET
SET
SET
SET
ERROR: schema "public" already exists
ERROR: current transaction is aborted, commands ignored until end of transaction block
ERROR: current transaction is aborted, commands ignored until end of transaction block
ERROR: current transaction is aborted, commands ignored until end of transaction block
ERROR: current transaction is aborted, commands ignored until end of transaction block
ERROR: current transaction is aborted, commands ignored until end of transaction block
and some stuff like
valid command \n
invalid command \n
invalid command \.
ERROR: syntax error at or near "1"
LINE 1: 1 20000225050318 AddSchemaMigrationDetails community-bootstr...
^
invalid command \.
ERROR: syntax error at or near "20000225050318"
LINE 1: 20000225050318
^
invalid command \.
ERROR: current transaction is aborted, commands ignored until end of transaction block
invalid command \N
invalid command \N
invalid command \N
invalid command \N
invalid command \N
invalid command \.
ERROR: syntax error at or near "1"
LINE 1: 1 10.0.0.0/8 2 0
^
invalid command \.
ERROR: current transaction is aborted, commands ignored until end of transaction block
invalid command \.
ERROR: current transaction is aborted, commands ignored until end of transaction block
invalid command \.
ERROR: current transaction is aborted, commands ignored until end of transaction block