Error when restore database

I tried to restore my database for the first time since using the discourse, but get an error like this:

Anyone can help? Thank you.

@VANHUSSEN

Did you try to restore from the command line in the container?

1 Like

Please don’t post the same issue multiple times.

1 Like

Yes, I have upload the backup file to /var/www/discourse/public/backups/default/ directory on the new server.

Go to the /var/www/discourse/ directory on the new server.

cd /var/www/discourse/

Install dependencies.

sudo gem install thor

Go to Discourse Admin dashboardSettingsBackups , tick on allow restore .

Next, run the following command to restore the site from backup.

RAILS_ENV=production script/discourse restore file-name-of-the-backup-file.tar.gz

Once the restore is finished, restart Discourse.

sudo systemctl restart discourse discourse-sidekiq

And refresh the Discourse web page.
But on step:

sudo gem install thor

I got the error. Why?

Sorry Jeff Atwood, for th post the same issue multiple times.

Hi @VANHUSSEN

From what little error messages you have posted, it looks like you have an issue with the version of Ruby you are running.

That is, at least, what your error message posted in your first post indicates.

Have to tried to rebuild your container and then run the restore process?

1 Like

I have try this command:
Remove ruby2.5-dev .

sudo apt remove ruby2.5-dev

Install ruby2.6-dev from a PPA.

sudo apt install software-properties-common
sudo apt-add-repository ppa:brightbox/ruby-ng
sudo apt install ruby2.6-dev

But still get the error. Please help

Hi @VANHUSSEN

Perhaps it will be better if you simply rebuild the default, supported container versus using.

./launcher rebuild app

Assuming of course, your Discourse container is specified in app.yml

1 Like

I install Discourse without Docker.

xen@xen:~$ lsb_release -a

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.4 LTS
Release:        18.04
Codename:       bionic

I kindly suggest you install with Docker if you are running a production Discourse application and requesting support on support .

If you are a developer and the installation is not production, that is another story :slight_smile: and you might consider posting over at dev

1 Like

If this isn’t a development install then docker is mandatory.

You need to be following the standard install guide for us to be able to offer any support.