Although I saw a topic with the same symptom, the resulting posts didn’t appear to align with our circumstances. When restoring a backup tar.gz from one Discourse instance to another, we received this error:
As part of troubleshooting, I entered the container and executed the following command to verify that what the restorer is doing to extract the meta.json file is working.
# tar --extract --file ./shared/backups/default/discussion-forums-pilot-meta-2015-10-01-215138.tar.gz meta.json
Tried to muddle through further troubleshooting by executing the restore from the CLI, but failed in two attempt:
First, I encountered thor as a missing dependency. After performing a gem install thor as root, I attempted the restore again, but then it failed with:
/var/www/discourse$ script/discourse restore discussion-forums-pilot-meta-2015-10-02-113808
Starting restore: discussion-forums-pilot-meta-2015-10-02-113808
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/postgresql_adapter.rb:665:in `rescue in connect': FATAL: database "discourse_development" does not exist (ActiveRecord::NoDatabaseError)
from /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/postgresql_adapter.rb:655:in `connect'
from /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/postgresql_adapter.rb:242:in `initialize'
from /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `new'
from /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `postgresql_connection'
Turns out that contrary to the name of the downloaded file being tar.gz, it was actually in tar format. Consequently, upon upload and attempting to restore, the restore process failed. Entered the container, made the tar.gz a real tar.gz and the restore process proceeded.