#reinstall openclaw but keep all agents data

1 messages · Page 1 of 1 (latest)

timber grail
#

how can i fully delete and then reinstall openclaw but i want to keep all of the data of all of my agents - memory, soul, identity, agnets, etc. all of those files

stuck shoalBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> âś… Mark Solution

nova radishBOT
#

First, run this so we know your starting version if anything gets weird:

openclaw --version

If you want to reinstall OpenClaw but keep agent data, do not delete ~/.openclaw or your workspace.

Your important stuff is usually:

  • Agent workspace: ~/.openclaw/workspace
    • AGENTS.md
    • SOUL.md
    • IDENTITY.md
    • USER.md
    • MEMORY.md
    • memory/
#
  • HEARTBEAT.md
  • State/sessions/auth/config: ~/.openclaw
    • openclaw.json
    • agents/<agentId>/sessions/
    • auth profiles, channel credentials, etc.

Safe reinstall flow:

# 1. Make a backup first
mkdir -p ~/openclaw-backup
cp -a ~/.openclaw ~/openclaw-backup/openclaw-state

# 2. Stop + remove the gateway service, but KEEP ~/.openclaw
openclaw gateway stop
openclaw gateway uninstall
#

# 3. Remove the CLI
pnpm remove -g openclaw
# or, if you originally used npm:
npm rm -g openclaw

# 4. Reinstall
pnpm add -g openclaw@latest
pnpm approve-builds -g

# 5. Reinstall/start daemon against the existing ~/.openclaw data
openclaw onboard --install-daemon

# 6. Verify
openclaw doctor
timber grail
#

well i want everything gone like full nuke except my md files. and then i want to reinstall openclaw and then i want to impor the md files i backed up

nova radishBOT
#

Yep — then treat this as backup MD files only → nuke OpenClaw → reinstall → copy MD files back.

Before nuking, back up only markdown files:

openclaw --version

mkdir -p ~/openclaw-md-backup

# default workspace markdown files
rsync -a --include='*/' --include='*.md' --exclude='*' \
  ~/.openclaw/workspace/ ~/openclaw-md-backup/workspace/

If you have multiple/custom agent workspaces, also check this before deleting:

#
openclaw config get agents

Back up markdown from any custom workspace paths too.

Then nuke OpenClaw:

openclaw uninstall --all --yes --non-interactive
pnpm remove -g openclaw

If anything remains and you’re sure your MD backup is good:

#
rm -rf ~/.openclaw

Reinstall:

pnpm add -g openclaw@latest
pnpm approve-builds -g
openclaw onboard --install-daemon

Import your MD files back:

rsync -a ~/openclaw-md-backup/workspace/ ~/.openclaw/workspace/
timber grail
#

C:\Users\Eagle3dStreaming>mkdir -p ~/openclaw-md-backup
The syntax of the command is incorrect.

nova radishBOT
#

You’re in Windows CMD, so mkdir -p ~/... won’t work — that was Linux/macOS syntax.

Use this instead:

mkdir "%USERPROFILE%\openclaw-md-backup"

To back up only .md files from the default OpenClaw workspace:

robocopy "%USERPROFILE%\.openclaw\workspace" "%USERPROFILE%\openclaw-md-backup\workspace" *.md /S

Then nuke OpenClaw:

#
openclaw uninstall --all --yes --non-interactive
pnpm remove -g openclaw
rmdir /S /Q "%USERPROFILE%\.openclaw"

Reinstall:

pnpm add -g openclaw@latest
pnpm approve-builds -g
openclaw onboard --install-daemon

Restore the markdown files:

#
robocopy "%USERPROFILE%\openclaw-md-backup\workspace" "%USERPROFILE%\.openclaw\workspace" *.md /S
openclaw gateway restart
openclaw doctor

Tiny caution: this deletes sessions, auth, config, channel connections, logs — everything except the .md files you copied. Make sure the backup folder has your files before running the rmdir line.

timber grail
#

Recommended first: openclaw backup create
Stopped Scheduled Task: OpenClaw Gateway
Removed Windows login item: C:\Users\Eagle3dStreaming\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\OpenClaw Gateway.cmd
Removed task script: C:\Users\Eagle3dStreaming.openclaw\gateway.cmd
Removed ~.openclaw
Removed ~.openclaw\workspace
Removed ~.openclaw\workspace\filings-agent
Removed ~.openclaw\workspace\financial-statements-agent
Removed ~.openclaw\workspace\intrinsic-value-agent
CLI still installed. Remove via npm/pnpm if desired.

C:\Users\Eagle3dStreaming>pnpm remove -g openclaw
'pnpm' is not recognized as an internal or external command,
operable program or batch file.

nova radishBOT
#

No worries — that just means pnpm isn’t installed on that machine. Your CLI was probably installed with npm.

Run this in CMD:

npm rm -g openclaw

If you want to confirm it’s gone:

where openclaw

If where openclaw says it can’t find it, you’re clean.

Then reinstall on Windows with the official installer from PowerShell:

#
iwr -useb https://openclaw.ai/install.ps1 | iex

Or from CMD, you can launch that PowerShell command like this:

powershell -ExecutionPolicy Bypass -Command "iwr -useb https://openclaw.ai/install.ps1 | iex"

After reinstall, restore your markdown backup into the new workspace, then:

openclaw doctor
openclaw gateway status
#

Also: since your output says it removed ~\.openclaw\workspace, make sure your .md backup exists before doing anything else destructive.

timber grail
#

C:\Users\Eagle3dStreaming>pnpm add -g openclaw@latest
'pnpm' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Eagle3dStreaming>

nova radishBOT
#

Yep — stop using pnpm on that machine. You’re in native Windows CMD, and pnpm isn’t installed.

Paste this into CMD to reinstall with the Windows installer:

powershell -ExecutionPolicy Bypass -Command "iwr -useb https://openclaw.ai/install.ps1 | iex"

If it complains that OpenClaw is still installed, remove it with npm first:

npm rm -g openclaw

Then rerun the installer command above.

After reinstall, restore your backed-up markdown files, for example: