# バックアップからの復元中にエラーが発生しました: discourse\_functions.raise\_discourse\_voting\_category\_settings\_readonly() が存在しません

**URL:** <https://meta.discourse.org/t/an-error-occurred-while-restoring-from-a-backup-discourse-functions-raise-discourse-voting-category-settings-readonly-does-not-exist/319988>\
**Category:** Self-hosting\
**Tags:** backups\
**Created:** [2024 年 8 月 3 日午後 8:22 UTC](https://meta.discourse.org/t/an-error-occurred-while-restoring-from-a-backup-discourse-functions-raise-discourse-voting-category-settings-readonly-does-not-exist/319988 "2024-08-03T20:22:36Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [2024 年 8 月 27 日午後 10:16 UTC](https://meta.discourse.org/t/an-error-occurred-while-restoring-from-a-backup-discourse-functions-raise-discourse-voting-category-settings-readonly-does-not-exist/319988/4 "2024-08-27T22:16:55Z")

</div>

開発インスタンスでも同じエラーが発生しています（pgvector の最新バージョンを取得するために pg16 にアップグレードしたばかりで、以前はこの復元が失敗していました）。これは `git pull` したばかりのものです。

投稿投票とトピック投票の両方を追加しました（トピック投票はソースにありました）。

私の考えでは、

```plaintext
 DROP table discourse_voting_category_settings;

```

を実行することでしたが、その後 `CASCADE` を追加する必要があることに気づき、怖気づいてステージングへの復元を試みました。

ステージングサイトで、同じデータベースを復元しようとすると、次のエラーが発生します。

```plaintext
ERROR: type "hotlinked_media_status" already exists
EXCEPTION: psql failed: ERROR: type "hotlinked_media_status" already exists
/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'

```

---

_[View the full topic](https://meta.discourse.org/t/an-error-occurred-while-restoring-from-a-backup-discourse-functions-raise-discourse-voting-category-settings-readonly-does-not-exist/319988)._
