Merge branch 'develop' into stable
[akkoma] / docs / docs / administration / CLI_tasks / config.md
index a0199d06fe6a0ab372b86eec4a672db98ac12173..31e5af401ccd8b75a88b1a9261ca05d3c7e72427 100644 (file)
@@ -155,3 +155,51 @@ This forcibly removes all saved values in the database.
     ```sh
     mix pleroma.config [--force] reset
     ```
+
+## Dumping specific configuration values to JSON
+
+If you want to bulk-modify configuration values (for example, for MRF modifications),
+it may be easier to dump the values to JSON and then modify them in a text editor.
+
+=== "OTP"
+
+    ```sh
+    ./bin/pleroma_ctl config dump_to_file group key path
+    # For example, to dump the MRF simple configuration:
+    ./bin/pleroma_ctl config dump_to_file pleroma mrf_simple /tmp/mrf_simple.json
+    ```
+
+=== "From Source"
+
+    ```sh
+    mix pleroma.config dump_to_file group key path 
+    # For example, to dump the MRF simple configuration:
+    mix pleroma.config dump_to_file pleroma mrf_simple /tmp/mrf_simple.json
+    ```
+
+## Loading specific configuration values from JSON
+
+**Note:** This will overwrite any existing value in the database, and can
+cause crashes if you do not have exactly the correct formatting.
+
+Once you have modified the JSON file, you can load it back into the database.
+
+=== "OTP"
+
+    ```sh
+    ./bin/pleroma_ctl config load_from_file path
+    # For example, to load the MRF simple configuration:
+    ./bin/pleroma_ctl config load_from_file /tmp/mrf_simple.json
+    ```
+
+=== "From Source"
+
+    ```sh
+    mix pleroma.config load_from_file path
+    # For example, to load the MRF simple configuration:
+    mix pleroma.config load_from_file /tmp/mrf_simple.json
+    ```
+
+**NOTE** an instance reboot is needed for many changes to take effect,
+you may want to visit `/api/v1/pleroma/admin/restart` on your instance
+to soft-restart the instance.