Restoring backups for development


(Dave McClure) #1

What’s the best way to get a backup loaded locally for development these days?

Here’s what I ended up trying today:

I tried the following:

  1. Downloaded the backup from our site (about 200 MB)
  2. Got my local repo sync’d up with master and started up the server and sidekiq
  3. Tried to uploaded the backup

The backup did not appear. I can see that all the “part” files were still hanging around…

So then I tried just copying the backup into the public/backups/default/ folder.

It showed up in the list, so I tried to restore it…

But I was just getting a lot of noisy log output (I’m trying to find the logs… not sure where they are).

Finally, I just did it manually using these instructions, which mostly worked, except that I ended up without any public schema. Renaming the backup schema back to public seemed to work though.


(Jeff Atwood) #2

Any ideas here @tgxworld?


(Rafael dos Santos Silva) #3

Was sidekick running?


(Dave McClure) #4

yeah, sidekiq was running


(Erick Guan) #5

Your db schema should better lower than your backup before started. Writing a script, checkout to the commit where you take the backup, restore and then bump the version. How does that helps?


(Dave McClure) #6

I think my local schema was at least as up to date as the backup… I was up to date with master locally and had run migrations and had the server running…

Before we dive too deep into the troubleshooting, what is the recommended procedure for doing this?

Should it be as simple as following these instructions?


(Alan Tan) #7

There should be a PM created by the system with all the logs.

The normal.procedure of uploading and restoring should work fine though. Are you able to reproduce it consistently?


(Erick Guan) #8

That is recommended but you are talking dev so… It’s a copy and rename job as of uploading backup files in the admin UI.

It’s your local env so I believe you are close. But restorer seems to rename public to backup and restore to public. And they are all executed in a transaction. From your description, it should be broken before that point. Try redis-cli and type FLUSHALL? Sometimes I run into problems caused by a hanging sidekiq.


(Dave McClure) #9

Oh, hmm… maybe this is where I went wrong. Locally I was probably ahead of the commit where the backup was created… Is that not supported?

I cancelled it before it completed because it looked like things were going haywire.[quote=“tgxworld, post:7, topic:48930”]
The normal.procedure of uploading and restoring should work fine though.
[/quote]

Thanks for confirming! I can try a few to further narrow down the issue and get more details for you guys.


(Kane York) #10

The psql < backup.sql, rename schema, db:migrate should work even if the versions are different…

You may want to consider just moving the backup into the backups directory and restoring from the UI.


(Dave McClure) #11

So, the upload worked this past time… And @fantasticfears redis-cli / FLUSHALL workaround seemed to get things “unstuck” after previous restores failed.

But when I try to restore through the UI, I get this:

[2016-08-20 18:46:42] 'dmcclure' has started the restore!
[2016-08-20 18:46:42] Marking restore as running...
[2016-08-20 18:46:42] Making sure /Users/mcwumbly/dev/discourse/tmp/restores/default/2016-08-20-184641 exists...
[2016-08-20 18:46:42] Copying archive to tmp directory...
[2016-08-20 18:46:43] Unzipping archive, this may take a while...
[2016-08-20 18:46:44] Extracting metadata file...
[2016-08-20 18:46:45] Validating metadata...
[2016-08-20 18:46:45]   Current version: 20160816063534
[2016-08-20 18:46:45]   Restored version: 20160816063534
[2016-08-20 18:46:45] Extracting dump file...
[2016-08-20 18:46:45] Restoring dump file... (can be quite long)
[2016-08-20 18:46:45] SET
[2016-08-20 18:46:45] SET
[2016-08-20 18:46:45] SET
[2016-08-20 18:46:45] SET
[2016-08-20 18:46:45] SET
[2016-08-20 18:46:45] SET
[2016-08-20 18:46:45] ERROR:  unrecognized configuration parameter "row_security"
[2016-08-20 18:46:45] ERROR:  current transaction is aborted, commands ignored until end of transaction block
...
[2016-08-20 18:46:46] ERROR:  current transaction is aborted, commands ignored until end of transaction block
[2016-08-20 18:46:46] ERROR:  current transaction is aborted, commands ignored until end of transaction block
[2016-08-20 18:46:46] ERROR:  current transaction is aborted, commands ignored until end of transaction block
[2016-08-20 18:46:46] invalid command \N
[2016-08-20 18:46:46] invalid command \.
[2016-08-20 18:46:46] ERROR:  syntax error at or near "1"
[2016-08-20 18:46:46] LINE 1: 1 9277b808d84119a05e2b37b28b5c9427ff89f44b560b379567bd77b19c...
[2016-08-20 18:46:46] ^
[2016-08-20 18:46:46] ERROR:  current transaction is aborted, commands ignored until end of transaction block
[2016-08-20 18:46:46] invalid command \.
[2016-08-20 18:46:46] ERROR:  syntax error at or near "92"
[2016-08-20 18:46:46] LINE 1: 92 2015-12-15 2 1943
[2016-08-20 18:46:46] ^
[2016-08-20 18:46:46] ERROR:  current transaction is aborted, commands ignored until end of transaction block
[2016-08-20 18:46:46] invalid command \N
[2016-08-20 18:46:46] invalid command \N
[2016-08-20 18:46:46] invalid command \N
[2016-08-20 18:46:46] invalid command \N
[2016-08-20 18:46:46] invalid command \N
[2016-08-20 18:46:46] invalid command \.
[2016-08-20 18:46:46] ERROR:  syntax error at or near "1"
[2016-08-20 18:46:46] LINE 1: 1 Getting Started
[2016-08-20 18:46:46] ^
[2016-08-20 18:46:46] ERROR:  current transaction is aborted, commands ignored until end of transaction block
[2016-08-20 18:46:46] invalid command \.
[2016-08-20 18:46:46] ERROR:  syntax error at or near "1"
[2016-08-20 18:46:46] LINE 1: 1 Gold 2015-11-30 07:18:32.108844 2015-11-30 07:18:32.108844
[2016-08-20 18:46:46] ^
[2016-08-20 18:46:46] ERROR:  current transaction is aborted, commands ignored until end of transaction block
[2016-08-20 18:46:46] invalid command \N
[2016-08-20 18:46:46] invalid command \N
...
[2016-08-20 18:46:46] invalid command \.
[2016-08-20 18:46:46] ERROR:  syntax error at or near "38"
[2016-08-20 18:46:46] LINE 1: 38 Thank You
[2016-08-20 18:46:46] ^
[2016-08-20 18:46:46] ERROR:  current transaction is aborted, commands ignored until end of transaction block
[2016-08-20 18:46:46] invalid command \N
[2016-08-20 18:46:46] invalid command \n
[2016-08-20 18:46:46] invalid command \N
[2016-08-20 18:46:46] invalid command \N
[2016-08-20 18:46:46] invalid command \N
[2016-08-20 18:46:46] invalid command \N
[2016-08-20 18:46:46] invalid command \N
[2016-08-20 18:46:46] invalid command \N
[2016-08-20 18:46:46] invalid command \N
[2016-08-20 18:46:46] invalid command \N
[2016-08-20 18:46:46] invalid command \.
[2016-08-20 18:46:46] ERROR:  syntax error at or near "19"
[2016-08-20 18:46:46] LINE 1: 19 Site Strategy F7941D 1491 8 2016-04-14 06:38:51.643621 20...
[2016-08-20 18:46:46] ^
[2016-08-20 18:46:46] ERROR:  current transaction is aborted, commands ignored until end of transaction block
[2016-08-20 18:46:46] invalid command \.
[2016-08-20 18:46:46] ERROR:  current transaction is aborted, commands ignored until end of transaction block
[2016-08-20 18:46:46] ERROR:  current transaction is aborted, commands ignored until end of transaction block
[2016-08-20 18:46:46] invalid command \.
[2016-08-20 18:46:46] ERROR:  syntax error at or near "7"
[2016-08-20 18:46:46] LINE 1: 7 2102 2016-08-20 06:29:55.656881 2016-08-20 06:29:55.656881...
[2016-08-20 18:46:46] ^
[2016-08-20 18:46:47] ERROR:  current transaction is aborted, commands ignored until end of transaction block
[2016-08-20 18:46:47] invalid command \.
[2016-08-20 18:46:47] ERROR:  syntax error at or near "2967"
[2016-08-20 18:46:47] LINE 1: 2967 12 1 2016-03-27 02:14:22.200127 2016-03-27 02:14:22.200...
[2016-08-20 18:46:47] ^
[2016-08-20 18:46:47] ERROR:  current transaction is aborted, commands ignored until end of transaction block
[2016-08-20 18:46:47] invalid command \.
[2016-08-20 18:46:47] ERROR:  syntax error at or near "3"
[2016-08-20 18:46:47] LINE 1: 3 4 3 2015-12-12 10:08:37.671954 2015-12-12 10:08:37.671954 ...
[2016-08-20 18:46:47] ^
[2016-08-20 18:46:47] ERROR:  current transaction is aborted, commands ignored until end of transaction block
[2016-08-20 18:46:47] invalid command \.
[2016-08-20 18:46:47] ERROR:  syntax error at or near "5"
[2016-08-20 18:46:47] LINE 1: 5 'process':1 Process en
[2016-08-20 18:46:47] ^
[2016-08-20 18:46:47] invalid command \.
[2016-08-20 18:46:47] ERROR:  current transaction is aborted, commands ignored until end of transaction block
[2016-08-20 18:46:47] ERROR:  current transaction is aborted, commands ignored until end of transaction block
[2016-08-20 18:46:47] invalid command \.
[2016-08-20 18:46:47] ERROR:  current transaction is aborted, commands ignored until end of transaction block
[2016-08-20 18:46:47] ERROR:  current transaction is aborted, commands ignored until end of transaction block
[2016-08-20 18:46:47] invalid command \.
[2016-08-20 18:46:47] ERROR:  syntax error at or near "1"
[2016-08-20 18:46:47] LINE 1: 1 6 1 1
[2016-08-20 18:46:47] ^
[2016-08-20 18:46:47] ERROR:  current transaction is aborted, commands ignored until end of transaction block
[2016-08-20 18:46:47] invalid command \.
[2016-08-20 18:46:47] ERROR:  syntax error at or near "1"
[2016-08-20 18:46:47] LINE 1: 1 primary 222222 1 2015-12-06 02:28:25.006489 2015-12-06 02:...
[2016-08-20 18:46:47] ^
[2016-08-20 18:46:47] ERROR:  current transaction is aborted, commands ignored until end of transaction block
[2016-08-20 18:46:47] invalid command \N
[2016-08-20 18:46:47] invalid command \.
[2016-08-20 18:46:47] ERROR:  syntax error at or near "2"
[2016-08-20 18:46:47] LINE 1: 2 mysitename f 1 1 2015-12-06 02:30:36.303212 2015-12-06 02:30...
[2016-08-20 18:46:47] ^
[2016-08-20 18:46:47] ERROR:  current transaction is aborted, commands ignored until end of transaction block
[2016-08-20 18:46:47] invalid command \.
[2016-08-20 18:46:47] ERROR:  current transaction is aborted, commands ignored until end of transaction block
[2016-08-20 18:46:47] ERROR:  current transaction is aborted, commands ignored until end of transaction block
[2016-08-20 18:46:47] invalid command \N
[2016-08-20 18:46:47] invalid command \N
...
[2016-08-20 18:46:51] invalid command \N
[2016-08-20 18:46:51] invalid command \N
[2016-08-20 18:46:51] EXCEPTION: psql failed
[2016-08-20 18:46:51] /Users/mcwumbly/dev/discourse/lib/backup_restore/restorer.rb:274:in `restore_dump'
/Users/mcwumbly/dev/discourse/lib/backup_restore/restorer.rb:42:in `run'
/Users/mcwumbly/dev/discourse/lib/backup_restore/backup_restore.rb:163:in `block in start!'
/Users/mcwumbly/dev/discourse/lib/backup_restore/backup_restore.rb:160:in `fork'
/Users/mcwumbly/dev/discourse/lib/backup_restore/backup_restore.rb:160:in `start!'
/Users/mcwumbly/dev/discourse/lib/backup_restore/backup_restore.rb:19:in `restore!'
/Users/mcwumbly/dev/discourse/app/controllers/admin/backups_controller.rb:81:in `restore'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/abstract_controller/base.rb:198:in `process_action'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_controller/metal/rendering.rb:10:in `process_action'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:117:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:505:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:92:in `__run_callbacks__'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:778:in `_run_process_action_callbacks'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:81:in `run_callbacks'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/abstract_controller/callbacks.rb:19:in `process_action'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_controller/metal/rescue.rb:29:in `process_action'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/notifications.rb:164:in `block in instrument'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/notifications.rb:164:in `instrument'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/abstract_controller/base.rb:137:in `process'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionview-4.2.7.1/lib/action_view/rendering.rb:30:in `process'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-mini-profiler-0.10.1/lib/mini_profiler/profiling_methods.rb:102:in `block in profile_method'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_controller/metal.rb:196:in `dispatch'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_controller/metal.rb:237:in `block in action'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/routing/route_set.rb:74:in `dispatch'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/routing/route_set.rb:43:in `serve'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/routing/mapper.rb:49:in `serve'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/journey/router.rb:43:in `block in serve'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/journey/router.rb:30:in `each'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/journey/router.rb:30:in `serve'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/routing/route_set.rb:817:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:186:in `call!'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:164:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:186:in `call!'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:164:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:186:in `call!'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:164:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:186:in `call!'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:164:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:186:in `call!'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:164:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:186:in `call!'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:164:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/omniauth-1.3.1/lib/omniauth/builder.rb:63:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/conditionalget.rb:38:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/head.rb:13:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/flash.rb:260:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/session/abstract/id.rb:225:in `context'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/session/abstract/id.rb:220:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/cookies.rb:560:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/query_cache.rb:36:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:377:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:88:in `__run_callbacks__'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:81:in `run_callbacks'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/reloader.rb:73:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/better_errors-2.1.1/lib/better_errors/middleware.rb:84:in `protected_app_call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/better_errors-2.1.1/lib/better_errors/middleware.rb:79:in `better_errors_call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/better_errors-2.1.1/lib/better_errors/middleware.rb:57:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/logster-1.2.5/lib/logster/middleware/reporter.rb:31:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.7.1/lib/rails/rack/logger.rb:38:in `call_app'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.7.1/lib/rails/rack/logger.rb:22:in `call'
/Users/mcwumbly/dev/discourse/config/initializers/100-quiet_logger.rb:13:in `call_with_quiet_assets'
/Users/mcwumbly/dev/discourse/config/initializers/100-silence_logger.rb:26:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/request_id.rb:21:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/methodoverride.rb:22:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/runtime.rb:18:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/static.rb:120:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/sendfile.rb:113:in `call'
/Users/mcwumbly/dev/discourse/lib/middleware/missing_avatars.rb:21:in `call'
/Users/mcwumbly/dev/discourse/lib/middleware/turbo_dev.rb:33:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-mini-profiler-0.10.1/lib/mini_profiler/profiler.rb:278:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/message_bus-2.0.1/lib/message_bus/rack/middleware.rb:62:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.7.1/lib/rails/engine.rb:518:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.7.1/lib/rails/application.rb:165:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.7.1/lib/rails/railtie.rb:194:in `public_send'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.7.1/lib/rails/railtie.rb:194:in `method_missing'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/urlmap.rb:66:in `block in call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/urlmap.rb:50:in `each'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/urlmap.rb:50:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/content_length.rb:15:in `call'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thin-1.6.4/lib/thin/connection.rb:86:in `block in pre_process'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thin-1.6.4/lib/thin/connection.rb:84:in `catch'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thin-1.6.4/lib/thin/connection.rb:84:in `pre_process'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thin-1.6.4/lib/thin/connection.rb:53:in `process'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thin-1.6.4/lib/thin/connection.rb:39:in `receive_data'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/eventmachine-1.2.0.1/lib/eventmachine.rb:194:in `run_machine'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/eventmachine-1.2.0.1/lib/eventmachine.rb:194:in `run'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thin-1.6.4/lib/thin/backends/base.rb:73:in `start'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thin-1.6.4/lib/thin/server.rb:162:in `start'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/handler/thin.rb:19:in `run'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/server.rb:286:in `start'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.7.1/lib/rails/commands/server.rb:80:in `start'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:80:in `block in server'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:75:in `tap'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:75:in `server'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
/Users/mcwumbly/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.7.1/lib/rails/commands.rb:17:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
[2016-08-20 18:46:51] Trying to rollback...
[2016-08-20 18:46:51] There was no need to rollback
[2016-08-20 18:46:52] Notifying 'dmcclure' of the end of the restore...

I’ve been able to do what I need using @riking’s manual steps, so I don’t need to keep trying things… but I’m happy to if it’s helpful to better understand a potential issue with the backup/restore feature.


(Kane York) #12

Upgrade your database to 9.5. If the database versions move backwards, you can’t restore a dump.


(Dave McClure) #13

Ran into a little trouble updating to 9.5 but this helped:

Also, note that if you installed the pg gem BEFORE fixing your path, it will use the wrong psql. If so, uninstall the pg gem and then reinstall it…

gem uninstall pg
bundle install

The next restore almost worked. I didn’t copy the logs before trying the next one, but there were many messages about png files which already exist (not obviously errors).

I then deleted the contents of these directories:

public/uploads/default/original
public/uploads/default/optimized

The next time, it worked!

Thanks all for the tips…