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.
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.
- An output similar to the following is displayed:
- Execute the following command to view IDENTITY.md (agent identity configuration).
- An output similar to the following is displayed:
- View the memory directory
- An output similar to the following is displayed:
tip
total 4: Indicates the total size of all files in this directory is 4 KB.
- An output similar to the following is displayed:
Step 2: Package the workspace and transfer it to the local computer
- 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.
- 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.
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
- 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.
tip
Replace {EIP of your instance} with the actual address of the target server used for storing ECS instance files.
- Execute the following command to decompress the local backup archive workspace.tar.gz to /root.
- Overwrite the original workspace directory with the decompressed one and restart the Gateway service.
- Execute the following command to rename the original OpenClaw workspace directory to workspace.bak to avoid conflicts with the restored backup directory.
- 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.
- 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.
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:
- In Lark, enable "Open Platform Assistant" message notifications, and click "Open App".
- Enter the /new command and use the relevant features as prompted on the interface. Learn more.