# How to perform a restore when you have two containers?

**URL:** https://meta.discourse.org/t/how-to-perform-a-restore-when-you-have-two-containers/281975
**Category:** Self-hosting
**Tags:** backups, two-container
**Created:** [October 7, 2023, 1:31pm UTC](https://meta.discourse.org/t/how-to-perform-a-restore-when-you-have-two-containers/281975 "2023-10-07T13:31:54Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Thomas\_Rother](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thomas_rother/32/423597_2.png) [@Thomas\_Rother](https://meta.discourse.org/u/Thomas_Rother)
#### Post date: [October 7, 2023, 1:31pm UTC](https://meta.discourse.org/t/how-to-perform-a-restore-when-you-have-two-containers/281975/1 "2023-10-07T13:31:54Z")

</div>

Small question: how to perform the restore, when you have multiple containers (data and web\_only). I tried this howto first from within the data container:

```plaintext
root@docker2:/var/discourse# ./launcher enter data
x86_64 arch detected.
root@docker2-data:/# discourse enable_restore
bash: discourse: command not found

```

OK, the discourse app is in the web container. But here the restore throws an exception and ends with an error:

```plaintext
Restore are now permitted. Disable them with `disable_restore`
root@forum:/var/www/discourse# discourse restore netzwissen-forum-2023-10-07-125819-v20230913194832.tar.gz
Plugin name is 'discourse-topic-voting', but plugin directory is named 'discourse-voting'
Starting restore: netzwissen-forum-2023-10-07-125819-v20230913194832.tar.gz
[STARTED]
'system' has started the restore!
Marking restore as running...
Making sure /var/www/discourse/tmp/restores/default/2023-10-07-132317 exists...
Copying archive to tmp directory...
EXCEPTION: /var/www/discourse/lib/discourse.rb:138:in `exec': Failed to copy archive to tmp directory.
cp: cannot stat '/var/www/discourse/public/backups/default/netzwissen-forum-2023-10-07-125819-v20230913194832.tar.gz': No such file or directory
/var/www/discourse/lib/discourse.rb:172:in `execute_command'
/var/www/discourse/lib/discourse.rb:138:in `exec'
/var/www/discourse/lib/discourse.rb:34:in `execute_command'
/var/www/discourse/lib/backup_restore/local_backup_store.rb:47:in `download_file'
/var/www/discourse/lib/backup_restore/backup_file_handler.rb:62:in `copy_archive_to_tmp_directory'
/var/www/discourse/lib/backup_restore/backup_file_handler.rb:22:in `decompress'
/var/www/discourse/lib/backup_restore/restorer.rb:42:in `run'
script/discourse:149:in `restore'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/thor-1.2.2/lib/thor/command.rb:27:in `run'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/thor-1.2.2/lib/thor/invocation.rb:127:in `invoke_command'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/thor-1.2.2/lib/thor.rb:392:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/thor-1.2.2/lib/thor/base.rb:485:in `start'
script/discourse:290:in `<top (required)>'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/cli/exec.rb:58:in `load'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/cli/exec.rb:58:in `kernel_load'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/cli/exec.rb:23:in `run'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/cli.rb:492:in `exec'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/cli.rb:34:in `dispatch'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/cli.rb:28:in `start'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/exe/bundle:45:in `block in <top (required)>'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/exe/bundle:33:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
Trying to rollback...
There was no need to rollback
Cleaning stuff up...
Removing tmp '/var/www/discourse/tmp/restores/default/2023-10-07-132317' directory...
Marking restore as finished...
Notifying 'system' of the end of the restore...
Finished!
[FAILED]
Restore done.

```

What is the trick to get the restore running on deployments with **separate data and web containers**?

Thanks, Thommie

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [October 8, 2023, 12:12pm UTC](https://meta.discourse.org/t/how-to-perform-a-restore-when-you-have-two-containers/281975/2 "2023-10-08T12:12:24Z")

</div>

Did you upload the backup to /var/discourse/shared/web-only/default?

You can run

discourse restore

To get a list of available backups.

You can also run a backup on web only to see where it puts its value so that you know you’re putting yours on the right place.

EDIT: I edited the OP and added this:

> [@Backup discourse from the command line](https://meta.discourse.org/t/backup-discourse-from-the-command-line/64364/1):
>
> If you’re using a two-container setup, you’ll `./launcher enter web_only` and replace `standalone` with `web-only` in the path to where the backups belong.

Does that help?

---

<div class="post-metadata">

### Author: ![Thomas\_Rother](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thomas_rother/32/423597_2.png) [@Thomas\_Rother](https://meta.discourse.org/u/Thomas_Rother)
#### Post date: [October 9, 2023, 8:54pm UTC](https://meta.discourse.org/t/how-to-perform-a-restore-when-you-have-two-containers/281975/3 "2023-10-09T20:54:41Z")

</div>

> [@Backup discourse from the command line](https://meta.discourse.org/t/backup-discourse-from-the-command-line/64364/1):
>
> `discourse enable_restore`

Hmmmm,  
nope, still not working

I have the backup file here:

```plaintext
thommie@docker2:/var/discourse/shared/web-only$ ls  
backups log netzwissen-forum-2023-10-09-201019-v20230913194832.tar.gz

```

Then

root@docker2:/var/discourse# ./launcher enter web\_only

```plaintext
x86_64 arch detected.  
root@forum:/var/www/discourse#

root@forum:/var/www/discourse# discourse restore  
You must provide a filename to restore. Did you mean one of the following?  
  
discourse restore forum-netzwissen-eu-2023-10-08-033221-v20230926165821.tar.gz

```

So, the restore only shows a backup file from **inside** of the web\_only container of the new forum instance (the target of the backup). But not the backup file from the source instance which is available on **/var/discourse/shared/web-only/ on the HOST system**

So, the “discourse restore” does not use the **mapped** volume on the host, but only the one inside the container.

??

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [October 9, 2023, 9:54pm UTC](https://meta.discourse.org/t/how-to-perform-a-restore-when-you-have-two-containers/281975/4 "2023-10-09T21:54:39Z")

</div>

it needs to be in `/var/discourse/shared/web-only/backups/default`

inside the container do a

```
 discourse backup

```

and see where it puts the backup and put yours in the same place.

---

<div class="post-metadata">

### Author: ![Thomas\_Rother](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thomas_rother/32/423597_2.png) [@Thomas\_Rother](https://meta.discourse.org/u/Thomas_Rother)
#### Post date: [October 11, 2023, 6:24pm UTC](https://meta.discourse.org/t/how-to-perform-a-restore-when-you-have-two-containers/281975/5 "2023-10-11T18:24:44Z")

</div>

@pfaffman you’re right, I was on the wrong folder, the restore has finished successfully

thanks for the help!

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [November 10, 2023, 6:25pm UTC](https://meta.discourse.org/t/how-to-perform-a-restore-when-you-have-two-containers/281975/6 "2023-11-10T18:25:33Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
