---
title: "calicoctl datastore migrate lock"
description: "Reference for the calicoctl datastore migrate lock command in Calico Open Source, used to lock a datastore during migration."
product: "Calico Open Source"
version: "3.33 (latest)"
section: "Reference"
canonical_url: "https://docs.tigera.io/calico/latest/reference/calicoctl/datastore/migrate/lock"
---

# calicoctl datastore migrate lock

This sections describes the `calicoctl datastore migrate lock` command.

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

## Display the help text for 'calicoctl datastore migrate lock' command

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

```text
Lock the datastore to prevent changes during a migration. Run this before
exporting so nothing changes while the migration is in progress.

Usage:
  calicoctl datastore migrate lock [flags]

Examples:
  calicoctl datastore migrate lock

Flags:
  -c, --config string   Path to the file containing connection configuration in YAML or JSON format. (default "/etc/calico/calicoctl.cfg")
  -h, --help            help for lock

Global Flags:
      --allow-version-mismatch   Allow client and cluster versions mismatch
      --context string           The name of the kubeconfig context to use
  -l, --log-level string         Set the log level (panic, fatal, error, warn, info, debug) (default "panic")
```

### Examples

Lock the datastore to prepare it for migration so that any changes to the data will not affect the cluster during migration.

```bash
calicoctl datastore migrate lock
```

### General options

```text
-c, --config string   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)
- [Resources](https://docs.tigera.io/calico/latest/reference/resources/overview.md) for details on all valid resources, including file format and schema
