- Updated: March 23, 2026
- 7 min read
Step‑by‑step guide: Migrating a legacy Moltbot deployment to the OpenClaw Full‑Stack Template
To migrate a legacy Moltbot deployment to the new OpenClaw Full‑Stack Template, follow this step‑by‑step developer guide that covers prerequisites, repository updates, configuration migration, testing, and rollback.
1. Introduction: From Clawd.bot → Moltbot → OpenClaw
When Clawd.bot first appeared, it introduced a lightweight chatbot framework built on Node.js. Over time, the community extended it into Moltbot, adding richer NLP pipelines, multi‑channel support, and a plug‑in architecture. Today, OpenClaw supersedes Moltbot with a full‑stack, low‑code template that runs on the UBOS homepage platform, offering built‑in CI/CD, scalable hosting, and AI‑first integrations.
OpenClaw is not just a code upgrade; it’s a paradigm shift toward declarative workflows, unified secrets management, and out‑of‑the‑box AI services such as OpenAI ChatGPT integration. This guide walks developers, DevOps engineers, and technical leads through the migration process, ensuring a smooth transition with zero downtime.
2. Prerequisites
Before touching any code, verify that your environment meets the following requirements.
2.1 System Requirements
- Ubuntu 22.04 LTS or Debian 12 (recommended for UBOS agents)
- Docker Engine ≥ 24.0 and Docker Compose ≥ 2.20
- Node.js ≥ 18.x (LTS) and npm ≥ 9.x
- Git 2.40+ for repository cloning
- Access to a UBOS account with UBOS partner program privileges (required for hosting OpenClaw templates)
2.2 Tools & Access
- CLI:
ubos-cli(install vianpm i -g @ubos/cli) - API token from the About UBOS dashboard
- Secret manager access (UBOS Secrets Vault)
- Optional: Telegram integration on UBOS for real‑time deployment notifications
Once the above are in place, you’re ready to clone the Moltbot repo and begin the migration.
3. Code Changes: Updating the Repository
The core of the migration lies in swapping the Moltbot codebase for the OpenClaw template while preserving custom business logic.
3.1 Clone the Existing Moltbot Repository
git clone https://github.com/your-org/moltbot.git
cd moltbot
git checkout production # ensure you are on the stable branch3.2 Create a New Branch for Migration
git checkout -b migrate-to-openclaw3.3 Add the OpenClaw Template as a Submodule
OpenClaw lives in the UBOS Template Marketplace. For this tutorial we’ll use the AI SEO Analyzer as a base; replace it with the official OpenClaw repo when it becomes public.
git submodule add https://github.com/ubos/openclaw-template.git openclaw
git submodule update --init --recursive3.4 Refactor Custom Modules
Identify Moltbot‑specific modules (e.g., src/bot/intentHandler.js, src/bot/channelAdapter.js) and move them into the OpenClaw src/custom/ folder. Keep the original file names to minimize code churn.
// Example: moving intent handler
mv src/bot/intentHandler.js openclaw/src/custom/intentHandler.js
// Update import paths
sed -i 's|../bot/intentHandler|../custom/intentHandler|g' openclaw/src/main.js3.5 Adjust Build Scripts
OpenClaw uses a unified ubos.yaml for CI/CD. Replace Moltbot’s package.json>scripts with the following:
"scripts": {
"dev": "ubos dev",
"build": "ubos build",
"deploy": "ubos deploy"
}3.6 Verify Dependency Compatibility
Run npm install inside the openclaw folder. If any Moltbot‑specific packages remain (e.g., botpress), replace them with OpenClaw equivalents such as @ubos/ai-core.
cd openclaw
npm install
npm uninstall botpress
npm install @ubos/ai-core“Migrating at the code level is only half the battle; the real challenge is aligning configuration and secrets with UBOS’s managed environment.” – Senior UBOS Engineer
4. Configuration Migration
OpenClaw centralizes configuration in ubos.yaml and the Secrets Vault. Follow these steps to move your Moltbot settings.
4.1 Export Existing Environment Variables
# From your Moltbot server
printenv | grep MOLTBOT_ > moltbot.env4.2 Create a New ubos.yaml File
Use the UBOS platform overview as a reference. Below is a minimal example for a chatbot service.
services:
chatbot:
image: ghcr.io/ubos/openclaw-template:latest
ports:
- "8080:8080"
env:
- name: OPENAI_API_KEY
secret: openai_api_key
- name: TELEGRAM_BOT_TOKEN
secret: telegram_bot_token
resources:
cpu: "500m"
memory: "512Mi"
secrets:
openai_api_key: {}
telegram_bot_token: {}
4.3 Import Secrets into UBOS Vault
Run the following commands using ubos-cli:
# Assuming you have a .env file with KEY=VALUE pairs
while IFS='=' read -r key value; do
ubos secret set "$key" "$value"
done < moltbot.env4.4 Migrate Database Connections
If Moltbot used a PostgreSQL instance, define it as a separate service in ubos.yaml and reference it via environment variables.
services:
db:
image: postgres:15
env:
- name: POSTGRES_USER
secret: pg_user
- name: POSTGRES_PASSWORD
secret: pg_password
- name: POSTGRES_DB
value: moltbot_db
resources:
cpu: "250m"
memory: "256Mi"
chatbot:
# ... previous config ...
env:
- name: DATABASE_URL
value: "postgres://{{ .Secrets.pg_user }}:{{ .Secrets.pg_password }}@db:5432/moltbot_db"4.5 Verify Configuration Locally
Start the stack with Docker Compose (UBOS provides a wrapper):
ubos devOpen http://localhost:8080 and confirm the bot responds as expected.
5. Verification Steps
After deployment, run a series of health checks to ensure the OpenClaw instance matches the original Moltbot behavior.
5.1 Automated Smoke Tests
Create a simple Jest test that sends a message to the bot’s HTTP endpoint and validates the reply.
test('greeting intent', async () => {
const res = await fetch('http://localhost:8080/api/message', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ text: 'Hi' })
});
const data = await res.json();
expect(data.reply).toMatch(/hello|hi/i);
});5.2 Manual Interaction via Telegram
If you enabled the ChatGPT and Telegram integration, send a test message to the bot and verify the response matches the Moltbot baseline.
5.3 Performance Benchmarks
Run ab -n 1000 -c 50 http://localhost:8080/api/message and compare latency against the previous Moltbot deployment. Aim for ≤150 ms average response time.
5.4 Rollback Plan
Should any issue arise, you can revert to the original Moltbot branch:
git checkout production
git push origin production --force # if you had already deployed the migration branch
ubos rollback --service chatbotMaintain the old Docker image tag in your registry for an instant fallback.
6. Deploying OpenClaw on UBOS
UBOS provides a one‑click hosting experience for OpenClaw templates. Follow the official guide to spin up the service in the cloud.
Visit the OpenClaw hosting page and select your preferred region, then connect your GitHub repository. UBOS will automatically provision the container, inject secrets, and expose a public HTTPS endpoint.
Explore the UBOS Platform
Learn how the Enterprise AI platform by UBOS can scale your chatbot across millions of users.
Pricing & Plans
Review the UBOS pricing plans to choose a tier that matches your traffic.
Low‑Code Development
Accelerate future features with the Web app editor on UBOS and the Workflow automation studio.
AI Marketing Agents
Leverage AI marketing agents to promote your new chatbot without writing a single line of code.
For a historical perspective on the evolution of chatbot frameworks, see the original announcement article here.
7. Conclusion
Migrating from Moltbot to OpenClaw involves three core pillars: updating the codebase, moving configuration to ubos.yaml and the Secrets Vault, and validating the new deployment with automated and manual tests. By following this guide, developers can leverage UBOS’s managed infrastructure, gain access to cutting‑edge AI integrations, and future‑proof their chatbot services.
Next steps:
- Push the migration branch to your remote repository.
- Connect the repo to the UBOS hosting console via the OpenClaw hosting page.
- Monitor logs through the UBOS dashboard and iterate on custom modules.
- Explore additional templates such as the AI Video Generator to enrich your bot’s capabilities.
Happy coding, and welcome to the next generation of AI‑first chatbots on UBOS!
Andrii Bidochko
CTO UBOS
Andrii Bidochko is an AI entrepreneur and researcher focused on AI agents, reinforcement learning, and autonomous systems. He writes about the technologies shaping the future of machine intelligence, from frontier models and agent architectures to real-world AI applications.