﻿---
title: stack kb data-views preview-swap-data-views-default cli command
description: Preview swap references Behaviour flags: --dry-run — validate all inputs and exit without performing any action 
url: https://www.elastic.co/elastic/docs-builder/docs/4120/reference/elastic-cli/cli/stack/kb/data-views/preview-swap-data-views-default
applies_to:
  - Elastic Cloud Serverless: Preview
  - Elastic Stack: Preview
---

# stack kb data-views preview-swap-data-views-default cli command
<cli-modifiers>
</cli-modifiers>

```bash
elastic stack kb data-views preview-swap-data-views-default \
  --from-id <from-id> \
  --to-id <to-id> \
  [options]
```

Preview swap references
**Behaviour flags:**
`--dry-run` — validate all inputs and exit without performing any action

## Options

<definitions>
  <definition term="--from-id string required">
    The saved object reference to change.
  </definition>
  <definition term="--to-id string required">
    New saved object reference value to replace the old value.
  </definition>
  <definition term="--delete">
    Deletes referenced saved object if all references are removed.
  </definition>
  <definition term="--for-id string">
    Limit the affected saved objects to one or more by identifier.
    **Repeatable:** pass `--for-id` multiple times to supply more than one value
  </definition>
  <definition term="--for-type string">
    Limit the affected saved objects by type.
  </definition>
  <definition term="--from-type string">
    Specify the type of the saved object reference to alter. The default value is `index-pattern` for data views.
  </definition>
  <definition term="--input-file string">
    path to a JSON file to use as command input
  </definition>
  <definition term="--dry-run">
    validate all inputs and exit without performing any action (preview changes without applying them)
  </definition>
</definitions>


## Global Options

<definitions>
  <definition term="--json">
    output as JSON
  </definition>
</definitions>