> ## Documentation Index
> Fetch the complete documentation index at: https://cometchat-22654f5b-docs-agent-native-development.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrate from Another Chat Provider with Agent Skills

> Move your app and your chat history from another chat provider to CometChat with one prompt to your AI coding agent, or migrate only your data.

Already using a different chat provider and want to move to CometChat? With
[CometChat Agent Skills](/agent-skills) installed, one prompt does the whole thing.
(Already on CometChat and upgrading the UI Kit instead? That's a different job — say
*"Upgrade my app to the latest UI Kit version"*, see
[Example prompts](/agent-skills#example-prompts).)

<Info>
  This page covers the agent-driven migration. For how CometChat imports users, groups and
  messages, the historical and live migration approaches, and the import APIs, see
  [Data Import and Migration](/fundamentals/data-import-and-migration).
</Info>

## Two ways to migrate

* **Migrate your app and your data.** Open your project in your coding agent and say
  *"Migrate my app to CometChat."*
* **Migrate only your data.** Say *"Migrate only my data to CometChat. Don't change my
  app code."*, naming the chat provider you're moving from. The agent writes and runs
  the same data-import script described below, without touching your app.

## What a full migration does

The agent detects the provider you're on and migrates your app **end to end in one
run**: it swaps the data layer (or your UI components) over to CometChat, wires
`init → login`, maps every feature that has a CometChat equivalent, removes the ones
that don't (and lists them for you), and verifies the build. Your own UI is
preserved when you built on the provider's SDK; the CometChat UI Kit takes over
where you used the provider's UI Kit.

## Before you start

* **Create your CometChat app first, and put its credentials in place.** Sign up at
  [app.cometchat.com](https://app.cometchat.com) and create an app — the migration never
  creates one for you. It also **won't ask you for your app credentials**: it reads them
  from `.cometchat/config.json` or your environment, and writes placeholders (with an
  "add your credentials" action item) if it finds neither. So set them up first — see
  [Connect your credentials](/agent-skills#connect-your-credentials) — or you'll get a build full of
  placeholders to fill in later.
* **Create a full-access REST API key** for the history import. Unlike the app
  credentials, the agent *does* ask you for this one (and your current provider's key)
  when it runs the import.
* **Node.js 18 or newer**, for `npx` and the data-import script.
* **Your app should build today** on your current provider — migrating an app that
  doesn't build first only hides which errors were yours.
* **Start from a clean git branch.** The agent works on a new `cometchat-migration`
  branch and never commits, so the diff stays easy to review.

<Note>
  Safe to run on a real repo: it works on its own branch and never commits, and it never
  deletes your own app code — where your code shares a file with the provider's, it's
  rewired, not removed. To leave no trace of the old provider it does go beyond deleting
  SDK calls, though: it updates your README, setup/deploy guides and `.env.example` to
  describe CometChat, renames provider-named identifiers (e.g. `providerUserId` → `userId`),
  and removes docs that describe the old provider's product (its changelog or docs pages).
  Review the branch diff before you merge.
</Note>

## Bringing your history across

The migration also prepares a **data-import script** for your users, groups and
messages. When the app migration is done, the agent tells you the script is **ready
for data import** and asks for your **API keys (or the relevant credentials)** —
for both your current provider and your CometChat app. Once you provide them, the
agent **runs the import for you** — a **dry run first**, showing the users, groups,
members and messages it will import, then the real import. You don't run anything by hand.

<Note>
  CometChat retains messages for the last **6 months** by default, so the import
  brings over history from that window. To import messages **older than 6 months**,
  reach out to CometChat and we'll help you import the older history.
</Note>

## Choosing a cut-over strategy

* **Hard switch (default).** Export from your current provider, import into CometChat,
  then deploy the migrated app. Simplest — do it in a maintenance window so no messages
  are sent mid-copy. The generated script does exactly this.
* **Zero-downtime live migration.** Keep both systems in sync while users move onto the
  new build gradually. This one is set up with CometChat's team —
  [contact sales](https://www.cometchat.com/contact-sales). Choose it if you can't take
  a maintenance window.

See [Data Import and Migration](/fundamentals/data-import-and-migration) for both
approaches, and the [Data Import API](/rest-api/data-import) for the limits the import
script respects.

## Before you go live

Switch login from the development **Auth Key** to **server-minted auth tokens**. The
Auth Key is for development only; in production your server mints a per-user
[auth token](/rest-api/auth-tokens) and the client logs in with `loginWithAuthToken()`.
The agent leaves this as an action item and, where your app already has a token server,
wires it for you.

## Learn more

<CardGroup cols={2}>
  <Card title="Data Import and Migration" icon="database" href="/fundamentals/data-import-and-migration">
    How CometChat imports users, groups and messages, and the historical vs live migration approaches
  </Card>

  <Card title="Agent Skills" icon="wand-magic-sparkles" href="/agent-skills">
    Install the skills and connect your credentials before you migrate
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.