ถ้าคุณต้องย้าย AI infrastructure ทั้งระบบ — servers, agents, cron jobs, API keys, scripts — ปกติมันคือสัปดาห์ของ DevOps work. แต่ถ้าให้ AI agent ทำแทน คุณต้องทำเองแค่ไหน?
คำตอบ: 3 อย่าง
สิ่งที่ต้องย้าย
- OpenClaw gateway + config
- AI agents 4 ตัว (identity, memory, workspace)
- Cron jobs 17 ตัว
- 70+ automation scripts ที่เขียนสำหรับ macOS
- API keys ทั้งหมด
Tools ที่ใช้
- Claude agent ผ่าน OpenClaw (Oracle session)
- Hetzner Cloud (Helsinki, CX22: 4 vCPU, 8GB RAM, Ubuntu 24.04)
- Telegram เป็น control interface ทั้งหมด
Agent ทำอะไรเองได้บ้าง
- Research + เปรียบเทียบ VPS providers 8 เจ้า (Hetzner, DigitalOcean, Oracle Cloud, Vultr ฯลฯ) พร้อมราคา
- Provision server ผ่าน Hetzner API
- Bootstrap: Ubuntu 24.04, Node.js 22 LTS, Chromium, Thai fonts
- ย้าย OpenClaw gateway + regenerate config
- Setup systemd service + UFW firewall rules
- Migrate agents ทีละตัว — copy identity, memory, workspace files
- Clone + re-schedule cron jobs 17 ตัว
- Fix Mac→Linux path issues อัตโนมัติ (เช่น
/System/Library/Fonts/→/usr/share/fonts/) - Debug gateway pairing issue
- ติดตั้ง features ใหม่ระหว่างย้าย: persistent memory + stealth browser MCP
Security Shim — Technical Detail
macOS scripts ส่วนใหญ่ใช้ security find-generic-password -s <service> -w เพื่อดึง API keys จาก Keychain บน Linux ไม่มี Keychain จึงสร้าง shim ที่:
- Intercept
securitycommand - Map service name → environment variable หรือ secrets file
- Return value เหมือน macOS Keychain ทุกประการ
ผลคือ scripts เดิม 70+ ตัวทำงานได้โดยไม่ต้อง refactor แม้แต่บรรทัดเดียว
3 อย่างที่คนต้องทำเอง (ทั้งหมดผ่านมือถือ)
- Login ให้ตอน browser automation เจอ login page (X, Google)
- เลือก server plan ใน Hetzner UI — Angular SPA ที่ agent กด next ไม่ได้
- ตอบ yes/no ก่อน agent ทำ destructive action (เช่น overwrite configs)
Gateway Pairing Issue
จุดที่ใช้เวลานานสุด: หลัง migrate แล้ว gateway ขึ้น pairing required ทั้งที่ service รันปกติ สาเหตุคือ bootstrap token ใน config ผูกกับ machine เดิม agent ต้องหา undocumented re-pairing flow เอง → แก้ได้ใน ~45 นาที
ต้นทุน
Hetzner CX22 (Helsinki): $12.59/เดือน (~450 บาท)
บทสรุป
Agent ไม่ได้ perfect — มีรอบนึงที่ยอมรับเองว่า “research ผิด แนะนำ plugin ที่ไม่มีจริง” แต่พอบอกให้ไป research ใหม่ → เจอวิธีแก้จริงใน 2 นาที
นั่นคือสิ่งที่เปลี่ยนไปใน DevOps ยุคนี้ — ไม่ใช่ automation ที่สมบูรณ์แบบ แต่คือ loop ของ human oversight + agent execution ที่เร็วกว่าทำเองมาก
ใช้เวลาทั้งหมด 3-4 ชั่วโมง รวม debug + install features ใหม่ ได้ AI agents 4 ตัวทำงาน 24/7 บน cloud ค่าใช้จ่าย $12.59/เดือน