> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> Settings of the RESTORE query that control which categories of objects are restored from a backup.

# Restore settings

The [`RESTORE`](/docs/concepts/features/backup-restore/overview#syntax) query accepts
settings in its `SETTINGS` clause that control which categories of objects are read
from a backup. This page documents the settings that select what is restored: table
data, access entities, and user-defined functions.

<h2 id="structure-only">
  `structure_only`
</h2>

Type: `Bool`. Default: `false`.

When set to `true`, only `CREATE` queries are read from the backup, without the
contents of the restored objects. It is a convenient shortcut that sets the
effective defaults of all three category settings below to `false`:

* `restore_table_data`
* `restore_access_entities`
* `restore_functions`

<h2 id="restore-table-data">
  `restore_table_data`
</h2>

Type: `Bool`. Optional; when not set it defaults to `!structure_only` (i.e. `true`
unless `structure_only` is set).

Whether to restore the data of tables. When set explicitly it overrides
`structure_only`: set it to `true` to restore table data even when
`structure_only=true`, or to `false` to skip table data even when `structure_only`
is not set.

<h2 id="restore-access-entities">
  `restore_access_entities`
</h2>

Type: `Bool`. Optional; when not set it defaults to `!structure_only`.

Whether to restore access entities — users, roles, settings profiles, row policies,
and quotas. When set explicitly it overrides `structure_only`.

<h2 id="restore-functions">
  `restore_functions`
</h2>

Type: `Bool`. Optional; when not set it defaults to `!structure_only`.

Whether to restore user-defined functions. When set explicitly it overrides
`structure_only`.

<h2 id="effective-behavior">
  Effective behavior
</h2>

Each category is restored when its corresponding setting is `true`. When a category
setting is not specified, its value is derived from `structure_only`: all three are
`true` by default, and all three become `false` when `structure_only=true`.

| `structure_only` | `restore_*` not set | `restore_* = true` | `restore_* = false` |
| :--------------: | :-----------------: | :----------------: | :-----------------: |
|      `false`     |       restored      |      restored      |       skipped       |
|      `true`      |       skipped       |      restored      |       skipped       |

This is fully backward compatible: a `RESTORE` query that does not set any of the
new settings behaves exactly as before.

<h2 id="examples">
  Examples
</h2>

Restore table definitions and access entities, but not table data — for example
to set up an environment for testing or replaying queries without copying data:

```sql theme={null}
RESTORE ALL FROM backup_name
SETTINGS structure_only = true, restore_access_entities = true
```

Restore only table data, without re-creating access entities or user-defined
functions:

```sql theme={null}
RESTORE ALL FROM backup_name
SETTINGS structure_only = true, restore_table_data = true
```

Restore everything except user-defined functions:

```sql theme={null}
RESTORE ALL FROM backup_name
SETTINGS restore_functions = false
```
