1 # Transfering the config to/from the database
3 {! backend/administration/CLI_tasks/general_cli_task_info.include !}
5 ## Transfer config from file to DB.
8 You need to add the following to your config before executing this command:
11 config :pleroma, configurable_from_database: true
17 ./bin/pleroma_ctl config migrate_to_db
23 mix pleroma.config migrate_to_db
26 ## Transfer config from DB to `config/env.exported_from_db.secret.exs`
29 In-Database configuration will still be applied after executing this command unless you set the following in your config:
32 config :pleroma, configurable_from_database: false
37 - `<path>` - where to save migrated config. E.g. `--path=/tmp`. If file saved into non standart folder, you must manually copy file into directory where Pleroma can read it. For OTP install path will be `PLEROMA_CONFIG_PATH` or `/etc/pleroma`. For installation from source - `config` directory in the pleroma folder.
38 - `<env>` - environment, for which is migrated config. By default is `prod`.
39 - To delete transferred settings from database optional flag `-d` can be used
43 ./bin/pleroma_ctl config migrate_from_db [--env=<env>] [-d] [--path=<path>]
48 mix pleroma.config migrate_from_db [--env=<env>] [-d] [--path=<path>]
51 ## Dump all of the config settings defined in the database
56 ./bin/pleroma_ctl config dump
62 mix pleroma.config dump
65 ## List individual configuration groups in the database
70 ./bin/pleroma_ctl config groups
76 mix pleroma.config groups
79 ## Dump the saved configuration values for a specific group or key
81 e.g., this shows all the settings under `config :pleroma`
86 ./bin/pleroma_ctl config dump pleroma
92 mix pleroma.config dump pleroma
95 To get values under a specific key:
97 e.g., this shows all the settings under `config :pleroma, :instance`
102 ./bin/pleroma_ctl config dump pleroma instance
108 mix pleroma.config dump pleroma instance
111 ## Delete the saved configuration values for a specific group or key
113 e.g., this deletes all the settings under `config :tesla`
118 ./bin/pleroma_ctl config delete [--force] tesla
124 mix pleroma.config delete [--force] tesla
127 To delete values under a specific key:
129 e.g., this deletes all the settings under `config :phoenix, :stacktrace_depth`
134 ./bin/pleroma_ctl config delete [--force] phoenix stacktrace_depth
140 mix pleroma.config delete [--force] phoenix stacktrace_depth
143 ## Remove all settings from the database
145 This forcibly removes all saved values in the database.
150 ./bin/pleroma_ctl config [--force] reset
156 mix pleroma.config [--force] reset