> This page location: /docs.md > /docs/tools-and-connectors.md > /docs/atlas/cli/current.md > /docs/atlas/cli/current/connect-atlas-cli.md

> For the complete MongoDB documentation index, see www.mongodb.com/docs/llms.txt

# Migrate to the Atlas CLI

**Note:**

`mongocli atlas` commands for MongoCLI are now deprecated. Follow the steps on this page to migrate to the Atlas CLI and run [Atlas CLI commands](https://www.mongodb.com/docs/atlas/cli/current/command/atlas.md#std-label-atlas) instead of `mongocli atlas` commands.

If you have already configured MongoDB CLI, you can migrate your settings to the Atlas CLI easily. Migrating to the Atlas CLI preserves existing MongoDB CLI profiles and saved API (Application Programming Interface) keys. If you haven't already configured MongoDB CLI, you can proceed to [Install or Update the Atlas CLI.](https://www.mongodb.com/docs/atlas/cli/current/install-atlas-cli.md#std-label-install-atlas-cli)

Complete the following steps to migrate from the MongoDB CLI to the Atlas CLI:

1. Install the Atlas CLI.

   [Install or Update the Atlas CLI](https://www.mongodb.com/docs/atlas/cli/current/install-atlas-cli.md#std-label-install-atlas-cli). If you have an existing `mongocli.toml` configuration file from the MongoDB CLI, Atlas CLI automatically [creates a new configuration file](https://www.mongodb.com/docs/atlas/cli/current/atlas-cli-save-connection-settings.md#std-label-config-toml-location), `config.toml`. The Atlas CLI populates `config.toml` with the profile content and API (Application Programming Interface) keys from `mongocli.toml`.

2. Update any automation scripts.

   If you use any automation scripts that rely on `mongocli.toml` or use MongoDB CLI Atlas commands, update the scripts to point to the [new configuration file](https://www.mongodb.com/docs/atlas/cli/current/atlas-cli-save-connection-settings.md#std-label-config-toml-location) and use [Atlas CLI commands](https://www.mongodb.com/docs/atlas/cli/current/command/atlas.md#std-label-atlas) instead.

   **Note:**

   Atlas CLI supports both MongoDB CLI environment variables and [Atlas CLI environment variables](https://www.mongodb.com/docs/atlas/cli/current/atlas-cli-env-variables.md#std-label-atlas-cli-env-vars), so changing existing environment variables is optional. However, you can use either MongoDB CLI environment variables or [Atlas CLI environment variables](https://www.mongodb.com/docs/atlas/cli/current/atlas-cli-env-variables.md#std-label-atlas-cli-env-vars), but not both together. If you plan to use [Atlas CLI environment variables](https://www.mongodb.com/docs/atlas/cli/current/atlas-cli-env-variables.md#std-label-atlas-cli-env-vars) in the future, change your existing MongoDB CLI environment variables.

3. Choose an authentication method and connect to Atlas.

   You can authenticate using either `atlas auth login` or `atlas
           config init`. To learn more, see [Connect from the Atlas CLI.](https://www.mongodb.com/docs/atlas/cli/current/connect-atlas-cli.md#std-label-connect-atlas-cli)

4. Use the new [Atlas CLI commands](https://www.mongodb.com/docs/atlas/cli/current/command/atlas.md#std-label-atlas).

   Use [Atlas CLI commands](https://www.mongodb.com/docs/atlas/cli/current/command/atlas.md#std-label-atlas) (starting with `atlas`) wherever you previously used MongoDB CLI Atlas commands (starting with `mongocli atlas`). You can use profiles that Atlas CLI migrates from the MongoCLI by [using the --profile flag.](https://www.mongodb.com/docs/atlas/cli/current/atlas-cli-save-connection-settings.md#std-label-atlas-cli-profiles)
