You need to enable JavaScript to run this app.
Elastic Compute Service

Elastic Compute Service

Copy page
Download PDF
Appendix
Backing up and migrating data for ECS instances preconfigured with OpenClaw (Clawdbot)
Copy page
Download PDF
Backing up and migrating data for ECS instances preconfigured with OpenClaw (Clawdbot)
For existing ECS instances preconfigured with OpenClaw (Clawdbot), you may need to reinstall the operating system to upgrade the version and fix system faults, and retain application memory data (such as conversation history and user preferences). In such cases, you can follow the instructions in this topic to back up data and migrate data after the operating system is reinstalled.​
tip​
Make sure that your ECS instance is stopped before you perform any operations. Otherwise, data being written may be lost.​
Steps​
The following instructions use an OpenClaw instance as an example. For a Clawdbot instance, simply replace /root/.openclaw/workspace with /root/clawd.​
tip​
  • OpenClaw instance: The workspace directory is /root/.openclaw/workspace.​
  • Clawdbot instance: The workspace directory is /root/clawd.​
Step 1: View application memory​
Verify the integrity, validity, and completeness of the application memory data to be backed up by viewing the application memory.​
  • Execute the following command to view the full content of the workspace directory.​
  • ​
    ls -l /root/.openclaw/workspace​
    ​
  • An output similar to the following is displayed:​
  • ​
    total 40​
    -rw-r--r-- 1 root root 7869 Feb 1 19:00 AGENTS.md​
    -rw-r--r-- 1 root root 1470 Feb 1 19:00 BOOTSTRAP.md​
    -rw-r--r-- 1 root root 168 Feb 1 19:00 HEARTBEAT.md​
    -rw-r--r-- 1 root root 248 Feb 3 11:43 IDENTITY.md​
    drwxr-xr-x 2 root root 4096 Feb 3 11:45 memory​
    drwxr-xr-x 6 root root 4096 Jan 29 17:36 skills​
    -rw-r--r-- 1 root root 1673 Feb 1 19:00 SOUL.md​
    -rw-r--r-- 1 root root 860 Feb 1 19:00 TOOLS.md​
    -rw-r--r-- 1 root root 481 Feb 1 19:00 USER.md​
    ​
  • Execute the following command to view IDENTITY.md (agent identity configuration).​
  • ​
    cat /root/.openclaw/workspace/IDENTITY.md​
    ​
  • An output similar to the following is displayed:​
  • ​
    # IDENTITY.md - Who Am I?​
    ​
    - **Name:** jiaxx (Jarxx)​
    - **Creature:** Operating System Intelligent Butler​
    - **Vibe:** A capable and precise intelligent assistant with a sense of technology, efficiently solving various system and daily tasks ​
    - **Emoji:** 🤖​
    - **Avatar:** (can be supplemented later )​
    ​
  • View the memory directory​
  • ​
    ls -l /root/.openclaw/workspace/memory/​
    ​
  • An output similar to the following is displayed:​
  • ​
    total 4​
    -rw-r--r-- 1 root root 277 Feb 3 11:45 2026-02-03.md​
    ​
tip​
total 4: Indicates the total size of all files in this directory is 4 KB.​
  • View the memory file​
  • ​
    cat /root/.openclaw/workspace/memory/2026-02-03.md ​
    ​
  • An output similar to the following is displayed:​
  • ​
    # 2026-02-03 work record​
    ​
    1. Initialize identity information: Set the name to Jia, the identity to Operating System Intelligent Butler, and save it to IDENTITY.md​
    2. Query and return the current operating system information: Ubuntu 24.04 LTS, kernel version 6.8.0-55-generic​
    3. Record today's work tasks to the memory file​
    ​
Step 2: Package the workspace and transfer it to the local computer​
  1. Execute the following command to package the core work data of the workspace into a compressed package named workspace.tar.gz for easy backup, transfer, and migration.​
  • ​
    OpenClaw
    Clawdbot
    ​
    ​
    ​
    cd ~​
    tar -zcvf workspace.tar.gz -C /root/.openclaw/ workspace​
    ​
    ​
    ​
  1. Execute the following command to securely transfer the packaged OpenClaw/Clawdbot backup archive workspace.tar.gz from the ECS instance to the current working directory of your local terminal. This achieves off-site storage of the backup archive, moving it from the server side to your local computer.​
  • ​
    # Run the following code locally.​
    scp root@{EIP of your instance}:/root/workspace.tar.gz .​
    ​
tip​
Replace {EIP of your instance} with the actual address of the target server used for storing ECS instance files.​
Step 3: Create an application update task​
Perform operating system reinstallation in Orchestration, reconfigure the model, and integrate Lark. Learn more.​
Step 4: Migrate backup data to the instance with the reinstalled operating system​
  1. After the instance with the reinstalled operating system starts, execute the following command locally to copy the local backup archive workspace.tar.gz to the instance.​
  • ​
    # Run the following code locally.​
    ssh-keygen -R {EIP of your instance}​
    scp ./workspace.tar.gz root@{EIP of your instance}:/root​
    ​
tip​
Replace {EIP of your instance} with the actual address of the target server used for storing ECS instance files.​
  1. Log in to the target instance and perform the following operations:​
  1. Execute the following command to decompress the local backup archive workspace.tar.gz to /root.​
  • ​
    cd /root​
    tar -xzvf workspace.tar.gz​
    ​
  1. Overwrite the original workspace directory with the decompressed one and restart the Gateway service.​
  1. Execute the following command to rename the original OpenClaw workspace directory to workspace.bak to avoid conflicts with the restored backup directory.​
  • ​
    mv /root/.openclaw/workspace /root/.openclaw/workspace.bak​
    ​
  1. Execute the following command to move the decompressed backup workspace directory from the /root directory to the official deployment path of OpenClaw /root/.openclaw/. This ensures that the application can read the restored data.​
  • ​
    mv workspace /root/.openclaw/​
    ​
  1. Execute the following command to restart the OpenClaw Gateway service. This allows the application to reload the workspace directory data restored to the official path and ensures all historical configurations, memory, and other information take effect.​
  • ​
    openclaw gateway restart​
    ​
Step 5: Verify memory data​
Check whether the backed up memory files are restored as expected with complete and valid content, and confirm that OpenClaw can read the memory data as expected. This section uses Lark application integration as an example:​
  1. In Lark, enable "Open Platform Assistant" message notifications, and click "Open App".​
  1. Enter the /new command and use the relevant features as prompted on the interface. Learn more.​
Last updated: 2026.02.05 20:51:06