# Backup restore failing due to .tar versus .tar.gz file extension

**URL:** https://meta.discourse.org/t/backup-restore-failing-due-to-tar-versus-tar-gz-file-extension/145971
**Category:** Support
**Created:** [March 28, 2020, 5:47pm UTC](https://meta.discourse.org/t/backup-restore-failing-due-to-tar-versus-tar-gz-file-extension/145971 "2020-03-28T17:47:48Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Ramith\_Hettiarachchi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ramith_hettiarachchi/32/174611_2.png) [@Ramith\_Hettiarachchi](https://meta.discourse.org/u/Ramith_Hettiarachchi)
#### Post date: [March 28, 2020, 5:47pm UTC](https://meta.discourse.org/t/backup-restore-failing-due-to-tar-versus-tar-gz-file-extension/145971/1 "2020-03-28T17:47:48Z")

</div>

Hi can you please let me know what might be the issue, restoring the backup.  
Backup was created on 2019-09-03

Any tips would be highly appreciated ❤

```plaintext
> root@discourse-beta-ubuntu-s-1vcpu-1gb-sgp1-01-app:/var/www/discourse# discourse restore entc-bme-forum-2019-09-03-194746-v20190603134013.tar.gz
> Starting restore: entc-bme-forum-2019-09-03-194746-v20190603134013.tar.gz
> [STARTED]
> 'system' has started the restore!
> Marking restore as running...
> Making sure /var/www/discourse/tmp/restores/default/2020-03-28-174121 exists...
> Copying archive to tmp directory...
> Unzipping archive, this may take a while...
> EXCEPTION: File exists - /shared/tmp/restores/default/2020-03-28-174121/PaxHeader
> /usr/local/lib/ruby/2.6.0/fileutils.rb:525:in `block in mv'
> /usr/local/lib/ruby/2.6.0/fileutils.rb:1557:in `block in fu_each_src_dest'
> /usr/local/lib/ruby/2.6.0/fileutils.rb:1566:in `block in fu_each_src_dest0'
> /usr/local/lib/ruby/2.6.0/fileutils.rb:1564:in `each'
> /usr/local/lib/ruby/2.6.0/fileutils.rb:1564:in `fu_each_src_dest0'
> /usr/local/lib/ruby/2.6.0/fileutils.rb:1555:in `fu_each_src_dest'
> /usr/local/lib/ruby/2.6.0/fileutils.rb:520:in `mv'
> /var/www/discourse/lib/compression/strategy.rb:41:in `strip_directory'
> /var/www/discourse/lib/backup_restore/backup_file_handler.rb:70:in `decompress_archive'
> /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:143:in `restore'
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/thor-1.0.1/lib/thor/base.rb:485:in `start'
> script/discourse:284:in `<top (required)>'
> /usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:63:in `load'
> /usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:63:in `kernel_load'
> /usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:28:in `run'
> /usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/cli.rb:476:in `exec'
> /usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
> /usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
> /usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor.rb:399:in `dispatch'
> /usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/cli.rb:30:in `dispatch'
> /usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/base.rb:476:in `start'
> /usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/cli.rb:24:in `start'
> /usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/exe/bundle:46:in `block in <top (required)>'
> /usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/friendly_errors.rb:123:in `with_friendly_errors'
> /usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/exe/bundle:34:in `<top (required)>'
> /usr/local/bin/bundle:23:in `load'
> /usr/local/bin/bundle:23:in `<main>'
> Trying to rollback...
> There was no need to rollback
> Cleaning stuff up...
> Removing tmp '/var/www/discourse/tmp/restores/default/2020-03-28-174121' directory...
> Unpausing sidekiq...
> Marking restore as finished...
> Notifying 'system' of the end of the restore...
> Finished!
> [FAILED]
> Restore done.

```

---

<div class="post-metadata">

### Author: ![Ramith\_Hettiarachchi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ramith_hettiarachchi/32/174611_2.png) [@Ramith\_Hettiarachchi](https://meta.discourse.org/u/Ramith_Hettiarachchi)
#### Post date: [March 28, 2020, 6:42pm UTC](https://meta.discourse.org/t/backup-restore-failing-due-to-tar-versus-tar-gz-file-extension/145971/2 "2020-03-28T18:42:28Z")

</div>

First there was an issue the archive being a .tar file, but i recompressed to .tar.gz

 ![Screenshot 2020-03-29 at 00.11.21](https://global.discourse-cdn.com/meta/original/3X/9/e/9e1606cf0fbcdb256ab290cb05f7b416354eb28d.png)

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [March 30, 2020, 2:42pm UTC](https://meta.discourse.org/t/backup-restore-failing-due-to-tar-versus-tar-gz-file-extension/145971/3 "2020-03-30T14:42:25Z")

</div>

Why did you need to make changes to the backup file created by Discourse? Did you create manually create the tar file (on MacOS)? I’ve seen reports where it uses a different tar format which causes problems during decompression.

You might need to create a new tar file with the `--format ustar` option or, even better, create a new backup directly in a Discourse Docker container.

---

<div class="post-metadata">

### Author: ![Ramith\_Hettiarachchi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ramith_hettiarachchi/32/174611_2.png) [@Ramith\_Hettiarachchi](https://meta.discourse.org/u/Ramith_Hettiarachchi)
#### Post date: [March 30, 2020, 3:25pm UTC](https://meta.discourse.org/t/backup-restore-failing-due-to-tar-versus-tar-gz-file-extension/145971/4 "2020-03-30T15:25:10Z")

</div>

i downloaded the backup from my previous hosted discourse months back.. when I located it, it was having the .tar extension (i have no clue why - I saw my emails had .tar.gz)

I will try your suggestion!  
Thanks a lot @gerhard!

---

<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: [April 13, 2024, 9:40pm UTC](https://meta.discourse.org/t/backup-restore-failing-due-to-tar-versus-tar-gz-file-extension/145971/5 "2024-04-13T21:40:11Z")

</div>



---

<div class="post-metadata">

### Author: ![martim](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martim/32/482990_2.png) [@martim](https://meta.discourse.org/u/martim)
#### Post date: [January 23, 2025, 6:42pm UTC](https://meta.discourse.org/t/backup-restore-failing-due-to-tar-versus-tar-gz-file-extension/145971/6 "2025-01-23T18:42:26Z")

</div>

> [@gerhard](#):
>
> You might need to create a new tar file with the `--format ustar` option

I’m facing the same issue and tried this. The file uploads fine, but restoration can’t find the DB dump:

```plaintext
[2025-01-23 18:39:45] EXCEPTION: No such file or directory @ rb_check_realpath_internal - /var/www/discourse/tmp/restores/default/2025-01-23-183945/dump.sql.gz

```

Any suggestions? Thanks

---

<div class="post-metadata">

### Author: ![rishabh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rishabh/32/179446_2.png) [@rishabh](https://meta.discourse.org/u/rishabh)
#### Post date: [January 24, 2025, 5:30am UTC](https://meta.discourse.org/t/backup-restore-failing-due-to-tar-versus-tar-gz-file-extension/145971/7 "2025-01-24T05:30:18Z")

</div>

Hey Martim,

I see your new topic [Locked out of my forum after restore](https://meta.discourse.org/t/locked-out-of-my-forum-after-restore/348684), does that mean you were able to navigate this specific issue succesfully?

---

<div class="post-metadata">

### Author: ![martim](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martim/32/482990_2.png) [@martim](https://meta.discourse.org/u/martim)
#### Post date: [January 24, 2025, 12:18pm UTC](https://meta.discourse.org/t/backup-restore-failing-due-to-tar-versus-tar-gz-file-extension/145971/8 "2025-01-24T12:18:55Z")

</div>

It does! Sorry, I thought I had deleted my comment as I managed to restore shortly after.

---

<div class="post-metadata">

### Author: ![rishabh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rishabh/32/179446_2.png) [@rishabh](https://meta.discourse.org/u/rishabh)
#### Post date: [January 28, 2025, 4:27am UTC](https://meta.discourse.org/t/backup-restore-failing-due-to-tar-versus-tar-gz-file-extension/145971/9 "2025-01-28T04:27:55Z")

</div>


