So I blew it all away and started from scratch.
My mistake was running bash <(wget -qO- https://raw.githubusercontent.com/techAPJ/install-rails/master/linux)
as root, against the stated directions.
Now I can get as far as trying to Restore my backup and get this in the logs:
[2018-05-06 22:46:19] 'magic' has started the restore!
[2018-05-06 22:46:19] Marking restore as running...
[2018-05-06 22:46:19] Making sure /home/discourse/discourse/tmp/restores/default/2018-05-06-224617 exists...
[2018-05-06 22:46:19] Copying archive to tmp directory...
[2018-05-06 22:46:19] Unzipping archive, this may take a while...
[2018-05-06 22:46:19] No metadata file to extract.
[2018-05-06 22:46:19] Validating metadata...
[2018-05-06 22:46:19] Current version: 20180504000531
[2018-05-06 22:46:19] Restored version: 20180504000531
[2018-05-06 22:46:19] Extracting dump file...
[2018-05-06 22:46:19] Cannot restore into different schema, restoring in-place
[2018-05-06 22:46:19] Enabling readonly mode...
[2018-05-06 22:46:19] Pausing sidekiq...
[2018-05-06 22:46:19] Waiting for sidekiq to finish running jobs...
[2018-05-06 22:46:20] Restoring dump file... (can be quite long)
[2018-05-06 22:46:20] SET
[2018-05-06 22:46:20] SET
[2018-05-06 22:46:20] ERROR: unrecognized configuration parameter "idle_in_transaction_session_timeout"
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:20] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:20] LINE 2: AS integer
[2018-05-06 22:46:20] ^
[2018-05-06 22:46:20] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:21] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:21] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:21] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:21] LINE 2: AS integer
[2018-05-06 22:46:21] ^
[2018-05-06 22:46:21] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:21] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:21] LINE 2: AS integer
[2018-05-06 22:46:21] ^
[2018-05-06 22:46:21] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:21] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:21] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:21] LINE 2: AS integer
[2018-05-06 22:46:21] ^
[2018-05-06 22:46:21] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:21] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:21] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:21] LINE 2: AS integer
[2018-05-06 22:46:21] ^
[2018-05-06 22:46:21] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:21] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:21] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:21] LINE 2: AS integer
[2018-05-06 22:46:21] ^
[2018-05-06 22:46:21] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:21] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:21] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:21] LINE 2: AS integer
[2018-05-06 22:46:21] ^
[2018-05-06 22:46:21] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:21] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:21] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:21] LINE 2: AS integer
[2018-05-06 22:46:21] ^
[2018-05-06 22:46:21] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:21] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:21] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:21] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:21] LINE 2: AS integer
[2018-05-06 22:46:21] ^
[2018-05-06 22:46:21] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:21] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:21] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:21] LINE 2: AS integer
[2018-05-06 22:46:21] ^
[2018-05-06 22:46:21] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:21] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:21] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:21] LINE 2: AS integer
[2018-05-06 22:46:21] ^
[2018-05-06 22:46:21] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:21] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:21] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:21] LINE 2: AS integer
[2018-05-06 22:46:21] ^
[2018-05-06 22:46:21] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:21] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:21] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:21] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:21] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:21] LINE 2: AS integer
[2018-05-06 22:46:21] ^
[2018-05-06 22:46:21] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:21] ERROR: current transaction is aborted, commands ignored until end of transaction block
[2018-05-06 22:46:21] ERROR: syntax error at or near "AS"
[2018-05-06 22:46:21] LINE 2: AS integer
[2018-05-06 22:46:21] ^
[2018-05-06 22:46:21] EXCEPTION: psql failed
[2018-05-06 22:46:21] /home/discourse/discourse/lib/backup_restore/restorer.rb:327:in 'restore_dump'
/home/discourse/discourse/lib/backup_restore/restorer.rb:68:in 'run'
/home/discourse/discourse/lib/backup_restore/backup_restore.rb:167:in 'block in start!'
/home/discourse/discourse/lib/backup_restore/backup_restore.rb:164:in 'fork'
/home/discourse/discourse/lib/backup_restore/backup_restore.rb:164:in 'start!'
/home/discourse/discourse/lib/backup_restore/backup_restore.rb:23:in 'restore!'
/home/discourse/discourse/app/controllers/admin/backups_controller.rb:103:in 'restore'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/action_controller/metal/basic_implicit_render.rb:4:in 'send_action'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/abstract_controller/base.rb:186:in 'process_action'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/action_controller/metal/rendering.rb:30:in 'process_action'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/abstract_controller/callbacks.rb:20:in 'block in process_action'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:131:in 'run_callbacks'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/abstract_controller/callbacks.rb:19:in 'process_action'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/action_controller/metal/rescue.rb:20:in 'process_action'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/action_controller/metal/instrumentation.rb:32:in 'block in process_action'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/activesupport-5.1.4/lib/active_support/notifications.rb:166:in 'block in instrument'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/activesupport-5.1.4/lib/active_support/notifications/instrumenter.rb:21:in 'instrument'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/activesupport-5.1.4/lib/active_support/notifications.rb:166:in 'instrument'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/action_controller/metal/instrumentation.rb:30:in 'process_action'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/action_controller/metal/params_wrapper.rb:252:in 'process_action'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/activerecord-5.1.4/lib/active_record/railties/controller_runtime.rb:22:in 'process_action'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/abstract_controller/base.rb:124:in 'process'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/actionview-5.1.4/lib/action_view/rendering.rb:30:in 'process'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/rack-mini-profiler-1.0.0/lib/mini_profiler/profiling_methods.rb:104:in 'block in profile_method'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/action_controller/metal.rb:189:in 'dispatch'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/action_controller/metal.rb:253:in 'dispatch'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/routing/route_set.rb:49:in 'dispatch'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/routing/route_set.rb:31:in 'serve'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/routing/mapper.rb:16:in 'block in <class:Constraints>'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/routing/mapper.rb:46:in 'serve'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/journey/router.rb:50:in 'block in serve'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/journey/router.rb:33:in 'each'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/journey/router.rb:33:in 'serve'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/routing/route_set.rb:834:in 'call'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/rack-protection-2.0.1/lib/rack/protection/frame_options.rb:31:in 'call'
/home/discourse/discourse/lib/middleware/omniauth_bypass_middleware.rb:24:in 'call'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/rack-2.0.4/lib/rack/conditional_get.rb:38:in 'call'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/rack-2.0.4/lib/rack/head.rb:12:in 'call'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/rack-2.0.4/lib/rack/session/abstract/id.rb:232:in 'context'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/rack-2.0.4/lib/rack/session/abstract/id.rb:226:in 'call'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/cookies.rb:613:in 'call'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:556:in 'call'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/callbacks.rb:26:in 'block in call'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:97:in 'run_callbacks'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/callbacks.rb:24:in 'call'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/executor.rb:12:in 'call'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/better_errors-2.1.1/lib/better_errors/middleware.rb:84:in 'protected_app_call'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/better_errors-2.1.1/lib/better_errors/middleware.rb:79:in 'better_errors_call'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/better_errors-2.1.1/lib/better_errors/middleware.rb:57:in 'call'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/debug_exceptions.rb:59:in 'call'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/show_exceptions.rb:31:in 'call'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/logster-1.2.9/lib/logster/middleware/reporter.rb:31:in 'call'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/rack/logger.rb:36:in 'call_app'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/rack/logger.rb:26:in 'call'
/home/discourse/discourse/config/initializers/100-quiet_logger.rb:16:in 'call'
/home/discourse/discourse/config/initializers/100-silence_logger.rb:29:in 'call'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/remote_ip.rb:79:in 'call'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/request_id.rb:25:in 'call'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/rack-2.0.4/lib/rack/method_override.rb:22:in 'call'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/executor.rb:12:in 'call'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/static.rb:125:in 'call'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/rack-2.0.4/lib/rack/sendfile.rb:111:in 'call'
/home/discourse/discourse/lib/middleware/missing_avatars.rb:21:in 'call'
/home/discourse/discourse/lib/middleware/turbo_dev.rb:34:in 'call'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/rack-mini-profiler-1.0.0/lib/mini_profiler/profiler.rb:285:in 'call'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/message_bus-2.1.4/lib/message_bus/rack/middleware.rb:63:in 'call'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/engine.rb:522:in 'call'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/railtie.rb:185:in 'public_send'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/railtie.rb:185:in 'method_missing'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/rack-2.0.4/lib/rack/urlmap.rb:68:in 'block in call'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/rack-2.0.4/lib/rack/urlmap.rb:53:in 'each'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/rack-2.0.4/lib/rack/urlmap.rb:53:in 'call'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/puma-3.9.1/lib/puma/configuration.rb:224:in 'call'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/puma-3.9.1/lib/puma/server.rb:602:in 'handle_request'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/puma-3.9.1/lib/puma/server.rb:435:in 'process_client'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/puma-3.9.1/lib/puma/server.rb:299:in 'block in run'
/home/discourse/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/puma-3.9.1/lib/puma/thread_pool.rb:120:in 'block in spawn_thread'
[2018-05-06 22:46:21] Trying to rollback...
[2018-05-06 22:46:21] Rolling back...
[2018-05-06 22:46:21] Notifying 'magic' of the end of the restore...
[2018-05-06 22:46:28] Cleaning stuff up...
[2018-05-06 22:46:28] Removing tmp '/home/discourse/discourse/tmp/restores/default/2018-05-06-224617' directory...
[2018-05-06 22:46:28] Unpausing sidekiq...
[2018-05-06 22:46:28] Disabling readonly mode...
[2018-05-06 22:46:28] Marking restore as finished...
[2018-05-06 22:46:28] Finished!
The first ERROR seems to be because the SQL is invalid for postgres 9.5: psql - Postgresql - unrecognized configuration parameter - Stack Overflow
What version of postgresql is in the Docker image? 9.6?