# How to Migrate Hermes Agent to xCloud (Hostinger, Cloudways or Any Server)

> Migrate Hermes Agent to xCloud from Hostinger, Cloudways or any server: deploy a fresh Hermes, give your old agent SSH access and let it move its memory itself.

You can migrate a Hermes Agent to xCloud from any host without copying a single file yourself. **Deploy a fresh Hermes Agent on xCloud, give your old agent root SSH access to the new server, and ask it to migrate itself.** The agent backs itself up, copies the backup to xCloud, restores it there and tells you when it's done. Then you stop the old agent, switch Telegram over and say hi to your agent on its new server.

It takes about 15 minutes. Your old agent keeps running the whole time, so nothing is lost if you stop halfway.

This works wherever Hermes runs today: Hostinger's one-click Hermes Agent template (Docker, managed in Hostinger's Docker Manager, see [Hostinger's Hermes Agent guide](https://www.hostinger.com/tutorials/how-to-set-up-hermes-agent/)), Cloudways Managed AI Agents (which gives SSH and terminal access to the agent's server, see [Cloudways' announcement](https://www.cloudways.com/blog/cloudways-managed-ai-agents-is-generally-available/)), another managed host, or any VPS or Docker container you can open a terminal on. To move a WordPress website from Hostinger instead, see [How to Migrate a WordPress Website from Hostinger to xCloud](/docs/migrate-from-hostinger-to-xcloud/).

## What moves and what doesn't

The agent uses Hermes's own backup and restore commands (`hermes backup` and `hermes import`, from the [Hermes backup and transfer guide](https://hermes-agent.nousresearch.com/docs/user-guide/backup-and-transfer)), so it does not matter how your old host installed Hermes.

| Moves to xCloud | Stays as xCloud set it up |
|---|---|
| Memories, skills, sessions and conversation history | The Hermes program and its version |
| Cron jobs, profiles, `SOUL.md` and hooks | The model and LLM provider you chose on xCloud |
| API keys and tokens in `.env`, including your Telegram bot token | The `hermes-gateway` service, dashboard, domain and Basic Auth |

## What you need

- Your current Hermes Agent, and a way to chat with it (Telegram, its web terminal or the Hermes command line)
- An old server that can reach your xCloud server on SSH port 22, with `ssh` and `scp` available to the agent
- An xCloud account
- The LLM provider, API key and model your old agent uses

## Step 1: Deploy a fresh Hermes Agent on xCloud

Create a new Hermes Agent server by following [How to Deploy Hermes Agent with xCloud](/docs/how-to-deploy-hermes-agent-with-xcloud/). Two choices matter for the migration:

- **Use the same LLM provider and model** as your old agent, with the same API key. The migration keeps the model and provider you choose here.
- **Leave the Telegram fields empty.** Your bot token comes over with the migration. If you add the same bot here now, two agents will use one bot.

When the server is ready, ask your old agent which version it runs (`hermes --version`). Then open **Hermes → Updates** on the xCloud server. If the xCloud version is older, click **Check for Updates** and then **Update Now**, so xCloud runs the same version or a newer one.

## Step 2: Get an SSH key from your old agent

Your old agent needs its own SSH key to log in to the new server. Send it this message:

```text
Create a new SSH key pair for a migration: type ed25519, file name hermes_migration, no passphrase, saved in your SSH folder. Then show me only the public key (the .pub file).
```

Copy the line it sends back. It starts with `ssh-ed25519`. Never share the private key.

You can also use your own SSH key instead, if your old agent can already use it.

## Step 3: Give the key root access to the xCloud server

1. Open the new server in xCloud and go to **Settings → Sudo Users**.
2. Click **Add Sudo User**.
3. Enter `root` in **Sudo User Name**. A root user needs no password.
4. Click **Add SSH Key**, give it a name such as `hermes-migration`, paste the public key from Step 2 under **Public Key**, and click **Add SSH Key**. The new key is ticked.
5. Optional: tick **Temporary**, so xCloud removes the key by itself within 12 hours. Skip this if `root` already has another key you want to keep, such as your Hermes Desktop key.
6. Click **Save**.

![Enter root as the Sudo User Name, add and tick the hermes-migration SSH key, then click Save in xCloud's Add Sudo User form](/_landing/docs/migrate-hermes-agent-to-xcloud-image-1.png)

xCloud adds the key for the `root` user in a few seconds. You'll find the server's IP address on the server's overview in xCloud.

## Step 4: Ask your old agent to migrate itself

Copy this message, replace `SERVER_IP` with your xCloud server's IP address, and send it to your old agent:

```text
Please migrate yourself fully to my new Hermes Agent on xCloud, then tell me when it's done.

The xCloud server: root@SERVER_IP, SSH port 22. Log in with the hermes_migration SSH key you created. On that server Hermes runs as root, its data folder is /root/.hermes, and its gateway is the systemd service hermes-gateway.

Safety rules:
- Copy, never move. Don't delete, stop or change anything on this server, except the temporary backup file you create.
- On the xCloud server, don't reinstall, update or uninstall Hermes, and don't change anything outside /root.
- If a step fails, stop and tell me what happened. Don't improvise workarounds.

Steps:
1. Run hermes --version here and on the xCloud server. If the xCloud version is older than yours, or "hermes import --help" there doesn't list --keep-host and --messaging-off, stop and tell me.
2. Make a full backup of yourself: hermes backup -o /tmp/hermes-migration.zip. It holds keys and tokens, so treat it as a secret.
3. Copy it with scp to /root/hermes-migration.zip on the xCloud server.
4. On the xCloud server, in this order:
   a. systemctl stop hermes-gateway
   b. Back up the fresh install: tar --exclude=hermes-agent -czf /root/hermes-before-migration.tar.gz -C /root .hermes
   c. hermes import /root/hermes-migration.zip --keep-host --messaging-off --force
      Note the undo point it prints.
   d. systemctl restart hermes-gateway, then check that systemctl is-active hermes-gateway says active.
   e. Delete /root/hermes-migration.zip, and any hermes_migration key files the import copied into /root/.hermes.
5. Delete /tmp/hermes-migration.zip here.
6. On the xCloud server, check that your memories, skills (hermes skills list) and sessions (hermes sessions list) are there.
7. Reply "Migration done", with what you checked and the undo point. Don't stop yourself: I will do that.
```

What the message makes sure of:

- **`--keep-host`** keeps what xCloud set up: the model and provider settings and the dashboard settings. Everything else comes from your old agent.
- **`--messaging-off`** brings Telegram over switched off, so your old agent keeps answering until you move the bot in Step 6.
- **Two backups** protect you: `/root/hermes-before-migration.tar.gz` holds the fresh xCloud install, and the undo point lets Hermes put it back.

When the agent replies **Migration done**, go on to Step 5.

## Step 5: Stop the old Hermes

A Telegram bot token (and most other bot tokens) can only be used by one running Hermes at a time, so stop the old agent before you switch the bot over. Use the way that matches where it runs:

| Where the old agent runs | How to stop it |
|---|---|
| Hostinger's Hermes Agent template | In Hostinger's **Docker Manager**, stop the Hermes Agent project. |
| Any other Docker install | `docker stop <container>` on that server, or `docker compose down` in the folder of its compose file. |
| A plain install (Hermes's installer, its own service) | `hermes gateway stop` in a terminal on that server. |
| A managed Hermes host, such as Cloudways | Use your host's own controls to stop or delete the agent, or run `hermes gateway stop` in its terminal. |

To check, send a message to your bot: nothing should answer yet.

## Step 6: Move Telegram to xCloud and say hi

1. In xCloud, open the server and go to **Hermes → Environment**.
2. In the **Hermes config.yaml** editor, find this block near the end:
   ```yaml
   platforms:
     telegram:
       enabled: false
   ```
3. Change `false` to `true`, then click **Save & Restart**.
4. Send "hi" to your Telegram bot. Your agent now answers from xCloud, with all its memories and skills.

Ask it something only your old agent knew, to see that its memory came over. If you don't use Telegram, chat with your agent the way you usually do, for example through [Hermes Desktop over SSH](/docs/connect-hermes-desktop-to-a-remote-xcloud-hermes-agent-via-ssh/).

## Step 7: Clean up

1. In xCloud, go to **Settings → Sudo Users**. If the migration key is the only key on `root`, delete the `root` entry: for `root`, xCloud removes only its SSH keys, never the user. If `root` has other keys you use, edit it and untick only `hermes-migration`. A **Temporary** key is removed by itself within 12 hours.
2. Keep the old agent stopped for a few days. Once you are sure everything is on xCloud, cancel the old server or plan.
3. When you no longer need the safety copy, delete `/root/hermes-before-migration.tar.gz` on the xCloud server.

![The root entry in xCloud's Sudo Users list, where you remove the migration key after the move](/_landing/docs/migrate-hermes-agent-to-xcloud-image-2.png)

## After the migration: xCloud settings that rewrite files

A few xCloud buttons write Hermes settings from what you entered in xCloud, not from the migrated files:

- **Hermes → Providers → Save Provider** and the **Repair Hermes** card in **Settings → Others** rewrite the provider keys in `/root/.hermes/.env` and the model settings in `config.yaml` with the provider you saved in xCloud. Your memories, skills and sessions are not touched. If you used the same provider in Step 1, this changes nothing you need.
- **Hermes → Channels → Save** writes your Telegram token and user ID to `.env` and restarts Hermes. Telegram stays off until `enabled` is `true` in `config.yaml` (Step 6).
- **Hermes → Reset** wipes `/root/.hermes` and installs Hermes again. Don't use it unless you want to start over.

## Troubleshooting

### The agent says the import was refused because the gateway owns the profile

Hermes won't restore while its gateway runs. Ask the agent to run `systemctl stop hermes-gateway` on the xCloud server and try the import again.

### The agent can't log in to the xCloud server

Check that the key in **Sudo Users** is the full `.pub` line from Step 2, that the user is `root`, and that you used the server's IP address. If you ticked **Temporary**, the key is removed after 12 hours: add it again. Some hosts block outgoing SSH: ask your old agent to test `ssh root@SERVER_IP` and tell you the error.

### The xCloud agent doesn't answer, and the log says it has no credentials for the provider

The model on xCloud uses a different provider than the key your old agent had. Open **Hermes → Providers**, choose the provider you want, add its API key and click **Save Provider**.

### Telegram doesn't answer after Step 6

Make sure the old agent is stopped (Step 5), and that `enabled: true` is saved under `platforms → telegram`. Then check **Hermes → Logs** for Telegram errors.

### You want to undo the migration

Run the undo command the agent reported (`hermes import <undo point> --force --keep-host`) on the xCloud server, or restore `/root/hermes-before-migration.tar.gz`. Your old agent was never changed, so you can simply start it again.

## Frequently asked questions

### Can I migrate from any host?

Yes. The migration uses Hermes's own backup and restore commands, so it works wherever your Hermes Agent runs: Hostinger, Cloudways, another managed Hermes host, a VPS or a Docker container. Your old agent only needs a terminal where it can run hermes, ssh and scp, and to reach your xCloud server on SSH port 22.

### Does the migration move my memories, skills and sessions?

Yes. The agent makes a full Hermes backup of itself with hermes backup and restores it on xCloud with hermes import. That covers your memories, skills, sessions, cron jobs, profiles, SOUL.md and the keys in .env. The Hermes program itself is not copied: xCloud already installed it.

### Do I need to reconnect Telegram?

You don't need a new bot or token: the token comes over with the migration. It arrives switched off, because one bot token can only be used by one running Hermes at a time. After you stop the old agent, set enabled to true under platforms → telegram in Hermes → Environment → Hermes config.yaml and click Save & Restart.

### What happens to my API keys?

The LLM API keys in your old agent's .env file move to xCloud with the backup. The model and provider settings stay as you chose them when you deployed Hermes on xCloud, so pick the same provider and model there. If they differ, open Hermes → Providers, choose your provider, add its key and click Save Provider.

### Can I keep the old Hermes running?

Yes, until you are happy with the xCloud agent. The migration only copies, so the old agent keeps working. Just don't run both with the same Telegram bot: stop the old agent before you switch Telegram on in xCloud. Two agents can also run on different bots.

If you run into any issues during the migration, feel free to reach out to our [support team](/docs/access-built-in-support-portal-in-xcloud/).
