---
title: dhconfig properties
sidebar_label: Properties
---

The `properties` (or `property`) configuration data type of the [dhconfig](./overview.md) tool works with properties files stored in the system. `properties` also handles other types of configuration files, such as `status-dashboard-defaults.json`.

```text
dhconfig properties [import|export|list|validate|delete|help] [arguments]
```

As with other `dhconfig` configuration data types, the `--help` argument provides detailed information on the available actions and arguments, as well as usage examples. Use `--help` whenever you need more information about the available options. For example, if you want information about the `import` action, you can run:

```bash
dhconfig properties import --help
```

Which prints the following:

```text
usage: dhconfig properties import [--configfile <arg>] [-d <arg>] [--diskprops] [--etcd] [-f <arg>] [-force] [-h] [-k
       <arg> | -user <arg>] [-pf <arg>] [-r <arg>] [-u]  [-v]
Import properties files from disk.
```

...followed by a description of all of the subcommand's arguments and some usage examples.

Due to the number of available options and combinations, and the robust in-tool documentation via `--help`, an exhaustive list of all possible commands is not provided here. Instead, we will elaborate on some of the more complex arguments below, and then give some usage examples. We recommend that you use the `--help` argument as needed for more information.

## Arguments

| Argument              | Description                                                                                                                                                                                                                         |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `-r,--rename <arg>`   | When importing from a single file, assign a new name when stored in the system.                                                                                                                                                     |
| `-u,--update-on-same` | When importing a file, update the system even if the file contents are unchanged.                                                                                                                                                   |
| `-force,--force`      | When a properties file is imported, `dhconfig` also validates the file like the `validate` action. The `--force` option can be used to import a file that has apparent errors. Use with care because this can cause problems later. |

## Examples

### `export`

Export all properties files to `/tmp`:

```bash
/usr/illumon/latest/bin/dhconfig properties export --directory /tmp
```

Export all properties files to `/tmp`, bypassing configuration service:

```bash
/usr/illumon/latest/bin/dhconfig properties export --directory /tmp --etcd
```

> [!NOTE]
> **Bypassing configuration server:**
> When you use the `--etcd` option, `dhconfig` connects directly to the etcd database, skipping the Configuration Server. This should only be done by administrators with the necessary permissions and is typically used for troubleshooting or recovery when the Configuration Server is unavailable.

Print `iris-environment.prop`:

```bash
/usr/illumon/latest/bin/dhconfig properties export iris-environment.prop
```

Export `iris-environment.prop` to local file:

```bash
/usr/illumon/latest/bin/dhconfig properties export iris-environment.prop > /tmp/my_properties.prop
```

Export `iris-environment.prop` and `iris-endpoints.prop` to `/tmp`:

```bash
/usr/illumon/latest/bin/dhconfig properties export --directory /tmp iris-environment.prop iris-endpoints.prop
```

```bash
/usr/illumon/latest/bin/dhconfig properties export --directory . --file iris-environment.prop --file iris-endpoints.prop
```

### `import`

> [!NOTE]
> Import actions require authentication, with `sudo`, `--key`, or `--user`.

Import `my_properties.prop` as `iris-environment.prop`:

```bash
sudo -u irisadmin /usr/illumon/latest/bin/dhconfig properties import --file /tmp/my_properties.prop --rename iris-environment.prop
```

Import several properties files from `/tmp`:

```bash
sudo -u irisadmin /usr/illumon/latest/bin/dhconfig properties import /tmp/p1.prop /tmp/p2.prop /tmp/p3.prop
```

```bash
sudo -u irisadmin /usr/illumon/latest/bin/dhconfig properties import --directory /tmp p1.prop p2.prop p3.prop
```

Import `iris-environment.prop` from `/tmp`:

```bash
sudo -u irisadmin /usr/illumon/latest/bin/dhconfig properties import /tmp/iris-environment.prop
```

or:

```bash
/usr/illumon/latest/bin/dhconfig properties import /tmp/iris-environment.prop --user iris
```

### `list`

List all properties files in the system:

```bash
/usr/illumon/latest/bin/dhconfig properties list
```

### `validate`

Use `validate` to check a properties file for errors without importing. This process parses the file to expose syntax errors and checks for common user errors, such as smart quotes and non-breaking spaces that can be inserted via cut-and-paste from formatted sources.

Validate a file without importing it:

```bash
/usr/illumon/latest/bin/dhconfig properties validate /tmp/my_properties.prop
```

### `delete`

> [!NOTE]
> Delete actions require authentication, with `sudo`, `--key`, or `--user`.

Delete a properties file:

```bash
sudo -u irisadmin /usr/illumon/latest/bin/dhconfig properties delete --file typo.prop
```

## Related documentation

- [dhconfig overview](./overview.md)
