# Error when restore database

**URL:** https://meta.discourse.org/t/error-when-restore-database/158101
**Category:** Support
**Tags:** unsupported-install
**Created:** [July 18, 2020, 7:22am UTC](https://meta.discourse.org/t/error-when-restore-database/158101 "2020-07-18T07:22:52Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![VANHUSSEN](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vanhussen/32/186896_2.png) [@VANHUSSEN](https://meta.discourse.org/u/VANHUSSEN)
#### Post date: [July 18, 2020, 7:22am UTC](https://meta.discourse.org/t/error-when-restore-database/158101/1 "2020-07-18T07:22:53Z")

</div>

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

 ![Screen Shot 2020-07-18 at 14.17.03](https://global.discourse-cdn.com/meta/original/3X/c/5/c5a93f5e35a0834e9d1e0712ea87a40d8e385bf0.png)

Anyone can help? Thank you.

---

<div class="post-metadata">

### Author: ![neounix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neounix/32/215617_2.png) [@neounix](https://meta.discourse.org/u/neounix)
#### Post date: [July 18, 2020, 2:41pm UTC](https://meta.discourse.org/t/error-when-restore-database/158101/2 "2020-07-18T14:41:25Z")

</div>

@VANHUSSEN

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

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [July 18, 2020, 9:55pm UTC](https://meta.discourse.org/t/error-when-restore-database/158101/3 "2020-07-18T21:55:59Z")

</div>

Please don’t post the same issue multiple times.

---

<div class="post-metadata">

### Author: ![VANHUSSEN](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vanhussen/32/186896_2.png) [@VANHUSSEN](https://meta.discourse.org/u/VANHUSSEN)
#### Post date: [July 18, 2020, 11:05pm UTC](https://meta.discourse.org/t/error-when-restore-database/158101/4 "2020-07-18T23:05:10Z")

</div>

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 dashboard** → **Settings** → **Backups** , 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?

---

<div class="post-metadata">

### Author: ![VANHUSSEN](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vanhussen/32/186896_2.png) [@VANHUSSEN](https://meta.discourse.org/u/VANHUSSEN)
#### Post date: [July 18, 2020, 11:06pm UTC](https://meta.discourse.org/t/error-when-restore-database/158101/5 "2020-07-18T23:06:30Z")

</div>

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

---

<div class="post-metadata">

### Author: ![neounix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neounix/32/215617_2.png) [@neounix](https://meta.discourse.org/u/neounix)
#### Post date: [July 19, 2020, 2:29am UTC](https://meta.discourse.org/t/error-when-restore-database/158101/6 "2020-07-19T02:29:38Z")

</div>

> [@VANHUSSEN](#):
>
> I got the error. Why?

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?

---

<div class="post-metadata">

### Author: ![VANHUSSEN](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vanhussen/32/186896_2.png) [@VANHUSSEN](https://meta.discourse.org/u/VANHUSSEN)
#### Post date: [July 19, 2020, 2:50am UTC](https://meta.discourse.org/t/error-when-restore-database/158101/7 "2020-07-19T02:50:16Z")

</div>

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

---

<div class="post-metadata">

### Author: ![neounix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neounix/32/215617_2.png) [@neounix](https://meta.discourse.org/u/neounix)
#### Post date: [July 19, 2020, 2:52am UTC](https://meta.discourse.org/t/error-when-restore-database/158101/8 "2020-07-19T02:52:58Z")

</div>

> [@VANHUSSEN](#):
>
> But still get the error. Please help

Hi @VANHUSSEN

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

```plaintext
./launcher rebuild app

```

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

---

<div class="post-metadata">

### Author: ![VANHUSSEN](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vanhussen/32/186896_2.png) [@VANHUSSEN](https://meta.discourse.org/u/VANHUSSEN)
#### Post date: [July 19, 2020, 3:06am UTC](https://meta.discourse.org/t/error-when-restore-database/158101/9 "2020-07-19T03:06:13Z")

</div>

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

```

---

<div class="post-metadata">

### Author: ![neounix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neounix/32/215617_2.png) [@neounix](https://meta.discourse.org/u/neounix)
#### Post date: [July 19, 2020, 3:10am UTC](https://meta.discourse.org/t/error-when-restore-database/158101/10 "2020-07-19T03:10:39Z")

</div>

> [@VANHUSSEN](#):
>
> I install Discourse without Docker.

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 🙂 and you might consider posting over at #Development

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [July 19, 2020, 3:50am UTC](https://meta.discourse.org/t/error-when-restore-database/158101/11 "2020-07-19T03:50:51Z")

</div>

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

You need to be following the [standard install guide](https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md) for us to be able to offer any support.
