# サイトの設定のエクスポートとインポート

**URL:** <https://meta.discourse.org/t/export-and-import-site-settings/148184>\
**Category:** Self-hosting\
**Created:** [2020 年 4 月 16 日午前 1:47 UTC](https://meta.discourse.org/t/export-and-import-site-settings/148184 "2020-04-16T01:47:36Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [2020 年 4 月 16 日午前 2:06 UTC](https://meta.discourse.org/t/export-and-import-site-settings/148184/2 "2020-04-16T02:06:55Z")

</div>

あなたのサイト設定は、Discourse データベースの `site_settings` テーブルにあります。

```plaintext
discourse=# select count(1) from site_settings;
 count 
-------
    78
(1 row)

```

この情報はすでにデータベースのバックアップに含まれているため、そこから取得できます。または、以下の汎用コマンドラインユーティリティを使ってこのテーブルを直接ダンプすることもできます。

```plaintext
pg_dump -d <database_name> -t <table_name> > file.sql

```

例:

```plaintext
su postgres -c 'pg_dump -d discourse -t site_settings > /shared/neo/my_site_settings.sql'

```

実際の例と結果:

```plaintext
# su postgres -c 'pg_dump -d discourse -t site_settings > /shared/neo/my_site_settings.sql'
# cd /shared/neo
# ls -l
total 12
-rw-r--r-- 1 postgres postgres 10653 Apr 16 02:04 my_site_settings.sql
#

```

---

_[View the full topic](https://meta.discourse.org/t/export-and-import-site-settings/148184)._
