# 復元テスト - 機能しません

**URL:** <https://meta.discourse.org/t/testing-restore-not-working/275859>\
**Category:** Self-hosting\
**Tags:** backups\
**Created:** [2023 年 8 月 19 日午後 4:02 UTC](https://meta.discourse.org/t/testing-restore-not-working/275859 "2023-08-19T16:02:00Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Crius](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/crius/32/317214_2.png) [@Crius](https://meta.discourse.org/u/Crius)\
**Post date:** [2023 年 8 月 19 日午後 4:02 UTC](https://meta.discourse.org/t/testing-restore-not-working/275859/1 "2023-08-19T16:02:00Z")

</div>

こんにちは、お気に入りのバグ発見者、サポートを悩ませるユーザーです。

本日午後、復元をテストしたところ、2回中2回とも以下のようになりました。

```plaintext
ERROR: could not extend file "base/16384/3294755": wrote only 4096 of 8192 bytes at block 43985
HINT: Check free disk space.
EXCEPTION: psql failed: HINT: Check free disk space.
/var/www/discourse/lib/backup_restore/database_restorer.rb:92:in `restore_dump'
/var/www/discourse/lib/backup_restore/database_restorer.rb:26:in `restore'
/var/www/discourse/lib/backup_restore/restorer.rb:51: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...
Rolling back...
Cleaning stuff up...
Dropping functions from the discourse_functions schema...
Removing tmp '/var/www/discourse/tmp/restores/default/2023-08-19-145440' directory...
Unpausing sidekiq...
Marking restore as finished...
Notifying 'system' of the end of the restore...
Finished!
[FAILED]
Restore done.

```

特に

```plaintext
Finished!
[FAILED]
Restore done.

```

は、ちょっと笑ってしまいました 🙄  
これは「それほど悪くない」から「信じられないほど悪い」までのスケールで言うと、本当にひどいと思います。

クリーンな状態で行いました。

- `launcher stop app`
- `rm -rf /var/discourse/shared`
- `launcher rebuild app`

テストやいじくり回しに使っている分離されたVMのステージング環境に復元しました。  
試した復元は、自動復元によって作成され、S3にバックアップされた最新のものです。

その後、メールで提供されたリンクからダウンロードし、このガイドに従って復元しました。

> [@コマンドラインからバックアップを復元する](https://meta.discourse.org/t/restore-a-backup-from-the-command-line/108034):
>
> bookmark このガイドでは、Discourse の Web UI を使用せずに、コマンドラインから Discourse のバックアップを復元する方法を説明します。 person_raising_hand 必要なユーザーレベル: 管理者 wrench コンソールアクセスが必要です ここでは、Discourse の Web UI を起動することなく、コマンドラインから Discourse のバックアップを復元する方法を説明します。これは、サーバーを移行する際に便利です。 前提条件 始める前に、次の手順を完了していることを確認してください。 ソースの Discourse インスタンスから最新のバックアップファイルをダウンロードします。 ./discourse-setup を実行するか、既存の app.yml をコピーして、宛先の Discourse インスタンスをブートストラップします。 宛先の Discourse インスタンスが最新バージョンであることを確認します。必要に応じて更新します。 バックアップの転送 宛先サーバーに SSH 接続するか、そこに…

バックアップは10GBでした。VMには、復元を開始したときに約110GBの空きがありました。

編集：Discourseバージョン 3.2.0.beta1-dev (fbf7b106cc)

---

_[View the full topic](https://meta.discourse.org/t/testing-restore-not-working/275859)._
