---
title: "calicoctl datastore migrate-policy-names"
description: "Reference for the calicoctl datastore migrate-policy-names command in Calico Open Source, used to fix pre-v3.32 policy names on an upgraded etcdv3 datastore."
product: "Calico Open Source"
version: "3.32 (latest)"
section: "Reference"
canonical_url: "https://docs.tigera.io/calico/latest/reference/calicoctl/datastore/migrate-policy-names"
---

# calicoctl datastore migrate-policy-names

This section describes the `calicoctl datastore migrate-policy-names` command.

Read the [calicoctl Overview](https://docs.tigera.io/calico/latest/reference/calicoctl/overview.md) for a full list of calicoctl commands.

> **SECONDARY:** This command is available in Calico v3.32.2 and later. You only need it on an etcdv3 datastore (for example, OpenStack) that was created before v3.32 and upgraded in place. A Kubernetes datastore is migrated automatically by kube-controllers, so no manual step is required there.

## Display the help text for 'calicoctl datastore migrate-policy-names' command

Run `calicoctl datastore migrate-policy-names --help` to display the following help menu for the command.

```text
Usage:
  calicoctl datastore migrate-policy-names [--config=<CONFIG>] [--allow-version-mismatch]

Options:
  -h --help                    Show this screen.
  -c --config=<CONFIG>         Path to the file containing connection
                               configuration in YAML or JSON format.
                               [default: /etc/calico/calicoctl.cfg]
     --allow-version-mismatch  Allow client and cluster versions mismatch.

Description:
  Rewrite policy names in the datastore to drop the legacy "default." tier
  prefix, aligning the stored name with the v3 resource name introduced in
  v3.32.

  This is only needed for an etcdv3 datastore (for example OpenStack) that was
  created before v3.32 and upgraded in place. A Kubernetes datastore is
  migrated automatically by kube-controllers. The command is safe to re-run.
```

### Examples

Rewrite any pre-v3.32 policy names in the datastore so they match their v3 names.

```bash
calicoctl datastore migrate-policy-names
```

On completion, the command reports how many policies it rewrote.

```text
Policy name migration complete, migrated 5 policies.
```

The command is idempotent. Running it again once every policy has already been migrated reports `migrated 0 policies` and makes no changes.

### General options

```text
-c --config=<CONFIG>     Path to the file containing connection
                         configuration in YAML or JSON format.
                         [default: /etc/calico/calicoctl.cfg]
```

## See also

- [Install calicoctl](https://docs.tigera.io/calico/latest/operations/calicoctl/install.md)
- [Upgrade Calico on OpenStack](https://docs.tigera.io/calico/latest/operations/upgrading/openstack-upgrade.md) for the full upgrade procedure that runs this command
