How to restore backup tar.gz file from console command?


#1

How to restore backup tar.gz file from console command?


(Martial) #2

You can find your answer

Full command line :

cd /var/discourse
./launcher enter app
discourse restore <filename.of.the.backup.tar.gz>


(Vu Hoang) #3

hi guys,

i had the error like this:

> /usr/local/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file -- thor (LoadError)
> 
> from /usr/local/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:59:in `require'

    from script/discourse:3:in `&lt;main&gt;'

any idea for this?
Thanks!


(Anton) #4

I just tried restoring from console and had experienced the same issue.


(Jeff Atwood) #5

Is this still working @techapj can we verify?


(Sam Saffron) #7

Can you confirm you saw this exact text? What command did you run?

Also … I think the command is discourse not script/discourse


(Jay Pfaffman) #8

I can confirm that from inside a production container you want to run discourse restore, not script/discourse.

Also, you can run it without the filename and it’ll suggest the available files, which makes it easy to copy and paste the filename.


(Anton) #9

Unfortunately, all sessions closed, and backup restored from UI, can’t tell for sure now.

The only thing I remember is there was a ‘cannot load such file’ string.

I was definitely trying script/discourse, so that might be the issue.


(Arpit Jalan) #10

I just ran the restore successfully on my sandbox using these commands:

cd /var/discourse
./launcher enter app
discourse enable_restore
discourse restore discourse-2018-01-08-044921-v20171228122834.tar.gz