Install
openclaw skills install reinstall-openclawSafely uninstall and reinstall OpenClaw while preserving user configurations, credentials, memory files, skills, and custom settings. Includes backup and res...
openclaw skills install reinstall-openclawThis skill provides complete procedures to safely uninstall and reinstall OpenClaw while preserving all user configurations, credentials, memory files, skills, and custom settings.
First, identify the OpenClaw installation location and version:
# Check OpenClaw version
npx openclaw --version
# Find OpenClaw npm package location
npm root -g
# List global npm packages
npm list -g --depth=0
Create a complete backup of all user configurations:
# Create backup directory with timestamp
BACKUP_DIR=~/openclaw-backup-$(date +%Y%m%d)
mkdir -p $BACKUP_DIR
# Backup entire .openclaw directory
cp -r ~/.openclaw $BACKUP_DIR/
# Verify backup
ls -la $BACKUP_DIR/
| Directory/File | Description |
|---|---|
openclaw.json | Main configuration (gateway token, API keys, channel configs) |
credentials/ | API credentials and secrets |
memory/ | SQLite memory database |
agents/ | Agent configurations and sessions |
skills/ | Installed skills |
workspace/ | User workspace (SOUL.md, IDENTITY.md, AGENTS.md, etc.) |
feishu/ | Feishu configuration |
identity/ | Device identity files |
devices/ | Paired devices |
cron/ | Scheduled cron jobs |
Stop all running OpenClaw processes:
# Stop gateway if running
npx openclaw gateway stop
# Kill any remaining processes
pkill -f openclaw
pkill -f "node.*openclaw"
# Verify no processes running
ps aux | grep openclaw
Use the official uninstall command:
# Full uninstall (removes everything including CLI - optional)
npx openclaw uninstall --all --yes
# OR uninstall but keep CLI (recommended)
npx openclaw uninstall --state --workspace --yes
Note: The --all flag removes the CLI as well. If you want to keep the CLI for reinstallation, omit this flag.
Remove any remaining files that might interfere:
# Remove npm cache (optional but recommended)
npm cache clean --force
# Remove old OpenClaw npm package if still exists
sudo npm uninstall -g openclaw
# Remove any remaining .openclaw directories
rm -rf ~/.openclaw
rm -rf ~/.openclaw-dev
Install the latest official version:
# Install globally
sudo npm install -g openclaw@latest
# Verify installation
npx openclaw --version
Restore your backed-up configurations:
# Restore .openclaw directory
cp -r ~/openclaw-backup-YYYYMMDD/* ~/.openclaw/
# Set correct permissions
chmod 700 ~/.openclaw
# Run doctor to check for issues
npx openclaw doctor --fix
# Start the gateway
npx openclaw gateway
# Check health
npx openclaw health
# Check status
npx openclaw status
Run this before uninstalling to create a timestamped backup:
# Create automatic backup
BACKUP_DIR=~/openclaw-backup-$(date +%Y%m%d-%H%M%S) && mkdir -p $BACKUP_DIR && cp -r ~/.openclaw/* $BACKUP_DIR/ && echo "Backup created: $BACKUP_DIR"
Run this after reinstallation to restore configurations:
# Restore from latest backup
LATEST_BACKUP=$(ls -td ~/openclaw-backup-* | head -1) && cp -r $LATEST_BACKUP/* ~/.openclaw/ && chmod 700 ~/.openclaw && echo "Restored from: $LATEST_BACKUP"
# Stop any stale processes
npx openclaw gateway stop
# Force start
npx openclaw gateway --force
# Find process using the port
lsof -i :18788
# Kill it
kill <PID>
# Run doctor to fix
npx openclaw doctor --fix
# Fix .openclaw permissions
chmod 700 ~/.openclaw
chmod 600 ~/.openclaw/openclaw.json
chmod 700 ~/.openclaw/credentials
Key settings to preserve:
gateway.port - Gateway port (default: 18788)gateway.auth.token - Gateway authentication tokenchannels.feishu - Feishu app credentialsmodels.providers - API keys for AI models~/.openclaw/
├── openclaw.json # Main config
├── credentials/ # API secrets
├── memory/main.sqlite # Memory database
├── agents/main/ # Agent configs
├── skills/ # Installed skills
├── workspace/ # User workspace
│ ├── SOUL.md
│ ├── IDENTITY.md
│ ├── AGENTS.md
│ └── USER.md
├── feishu/ # Feishu config
├── identity/ # Device identity
├── devices/ # Paired devices
└── cron/ # Scheduled jobs