So your Enterprise WeChat bot is running on some aging VM, a forgotten Docker container, or — worst case — someone's laptop under a desk. It works... until it doesn't. And when it goes down, nobody knows how to bring it back because the original developer left six months ago.
Sound familiar? Let's talk about migrating your OpenClaw Enterprise WeChat bot to a clean, maintainable setup on Tencent Cloud Lighthouse — without losing messages, configs, or your sanity.
The most common reasons teams hit the migration wall:
npm audit returns a novel-length report.Before you touch anything, export your current state:
# On your OLD server
# 1. Backup the entire config directory
tar czf clawdbot-config-backup-$(date +%Y%m%d).tar.gz /opt/clawdbot/config/
# 2. Export environment variables
env | grep -i "WECHAT\|CLAWDBOT\|API_KEY" > clawdbot-env-export.txt
# 3. Dump any local database (if using SQLite for conversation history)
sqlite3 /opt/clawdbot/data/conversations.db ".backup /tmp/conversations-backup.db"
# 4. Note the current daemon status and version
clawdbot --version
systemctl status clawdbot
Document everything. Migration failures almost always come from forgotten environment variables or missing data files.
Here's the clean-slate approach:
The Lighthouse image comes with systemd integration, proper log directories, and firewall rules already configured. That's half the migration work done for you.
From your local machine (or the old server):
# SCP config backup to new Lighthouse instance
scp clawdbot-config-backup-*.tar.gz root@NEW_LIGHTHOUSE_IP:/opt/clawdbot/
# SSH into new instance and extract
ssh root@NEW_LIGHTHOUSE_IP
cd /opt/clawdbot
tar xzf clawdbot-config-backup-*.tar.gz --strip-components=2
Don't just copy-paste the env file. Review each variable and update any that reference the old server's IP, hostname, or paths:
# Create a clean env file on the new instance
cat > /opt/clawdbot/.env <<'EOF'
WECHAT_CORP_ID=your_corp_id
WECHAT_AGENT_ID=your_agent_id
WECHAT_SECRET=your_secret
WECHAT_TOKEN=your_callback_token
WECHAT_AES_KEY=your_encoding_aes_key
API_KEY=your_model_api_key
EOF
chmod 600 /opt/clawdbot/.env
This is the step people forget. In the Enterprise WeChat admin console, update the callback URL to point to your new Lighthouse instance's public IP:
https://YOUR_LIGHTHOUSE_IP:443/webhook/wechat
Make sure port 443 is open in the Lighthouse firewall settings (it is by default on the OpenClaw image).
# Start the daemon on the new instance
sudo systemctl start clawdbot
sudo systemctl status clawdbot
# Test with a simple message in Enterprise WeChat
# Check logs for the incoming event
journalctl -u clawdbot -f --no-pager
If the bot responds correctly, disable the old instance immediately to avoid duplicate responses:
# On the OLD server
sudo systemctl stop clawdbot
sudo systemctl disable clawdbot
Now that you're on fresh infrastructure, take 10 minutes to do what the original setup probably skipped:
# Enable automatic security updates
sudo apt-get install -y unattended-upgrades
sudo dpkg-reconfigure -plow unattended-upgrades
# Set up log rotation
cat > /etc/logrotate.d/clawdbot <<'EOF'
/var/log/clawdbot/*.log {
daily
rotate 14
compress
copytruncate
}
EOF
# Create a weekly backup cron
echo "0 3 * * 0 tar czf /opt/clawdbot/backups/weekly-\$(date +\%Y\%m\%d).tar.gz /opt/clawdbot/config/" | crontab -
Keep the old server alive (but stopped) for at least 2 weeks after migration. If anything goes wrong, your rollback is:
sudo systemctl start clawdbotMigration doesn't have to be a weekend-long ordeal. With the pre-built Lighthouse image, the actual work is config transfer + callback URL update — maybe 30 minutes if you're careful.
Get your new home ready:
Your bot deserves better than a laptop under a desk.