# Site Migration: Chemicloud → kaburusvr

Tested and proven procedure. Used for kaburu.co, stats.kaburu.co, invoice.kaburu.co on 2026-05-11.

## Prerequisites

- SSH access to Chemicloud: `ssh -p 1988 -i ~/.ssh/chemicloud [email protected]` - Hetzner MCP tools or root SSH on kaburusvr - Cloudflare user-scoped API token with DNS:Edit

## Step 1 — Gather credentials from source

```bash # Get WordPress DB credentials cat ~/domain.com/wp-config.php | grep -E “DB_NAME|DB_USER|DB_PASSWORD|table_prefix”

# Get app credentials (Matomo, Laravel etc) cat ~/domain.com/public_html/config/config.ini.php | grep -E “dbname|username|password” ```

## Step 2 — Dump databases on Chemicloud

```bash # WordPress mysqldump -u DB_USER -p“DB_PASS” DB_NAME 2>/dev/null | gzip > /tmp/site_wp.sql.gz

# Run large DBs in background nohup mysqldump … | gzip > /tmp/file.sql.gz > /tmp/dump.log 2>&1 & ```

## Step 3 — Archive files on Chemicloud

```bash nohup tar -czf /tmp/site_files.tar.gz -C ~/domain.com/public_html . > /tmp/tar.log 2>&1 & ```

## Step 4 — Add kaburusvr public key to Chemicloud

```bash # Get kaburusvr public key cat ~/.ssh/id_ed25519.pub # on kaburusvr

# Add to Chemicloud (run on kaburusvr) ssh -p 1988 -i ~/.ssh/chemicloud [email protected] \

'echo "KEY" >> ~/.ssh/authorized_keys'

```

## Step 5 — Transfer to kaburusvr

```bash rsync -az -e “ssh -p 1988 -o StrictHostKeyChecking=no” \

[email protected]:/tmp/site_files.tar.gz \
[email protected]:/tmp/site_wp.sql.gz \
/tmp/

```

## Step 6 — Create site on kaburusvr

```bash cyberpanel createWebsite –package Standard –owner admin \

  1. -domainName domain.com –email [email protected] –php PHP83

```

IMPORTANT: Also register in CyberPanel DB: ```sql INSERT INTO cyberpanel.websiteFunctions_websites (domain, adminEmail, phpSelection, ssl, state, externalApp, config, BackupLock, admin_id, package_id) VALUES ('domain.com', 'email', 'PHP 8.3', 1, 1, 'linuxuser', '', 0, 1, 1); ```

## Step 7 — Create database

```bash # Via CyberPanel MCP tool or: cyberpanel createDatabase –databaseWebsite domain.com –dbName dbname \

  1. -dbUsername dbuser –dbPassword “password”

```

## Step 8 — Extract files and import DB

```bash # Fix permissions first chmod 755 /home/domain.com/public_html/ rm -f /home/domain.com/public_html/index.html # remove placeholder

# Extract tar -xzf /tmp/site_files.tar.gz -C /home/domain.com/public_html/

# Get correct Linux user ls -la /home/domain.com/ | grep public_html chown -R LINUXUSER:LINUXUSER /home/domain.com/public_html/

# Create .user.ini echo “open_basedir=/home/domain.com/public_html:/tmp:/usr/local/lsws/” \

> /home/domain.com/public_html/.user.ini

chown LINUXUSER:LINUXUSER /home/domain.com/public_html/.user.ini

# Import DB zcat /tmp/site_wp.sql.gz | mysql dbname ```

## Step 9 — Update config files

WordPress wp-config.php: ```bash sed -i “s/define( 'DB_NAME', 'OLD' );/define( 'DB_NAME', 'NEW' );/” wp-config.php sed -i “s/define( 'DB_USER', 'OLD' );/define( 'DB_USER', 'NEW' );/” wp-config.php sed -i “s/define( 'DB_HOST', 'localhost:3306' );/define( 'DB_HOST', 'localhost' );/” wp-config.php ```

## Step 10 — Fix PHP handler path

```bash # Check vhost for wrong path grep “lsphp” /usr/local/lsws/conf/vhosts/domain.com/vhost.conf

# Fix if needed sed -i 's|lsphpPHP83|lsphp83|g' /usr/local/lsws/conf/vhosts/domain.com/vhost.conf

# Restart LiteSpeed /usr/local/lsws/bin/lswsctrl restart ```

## Step 11 — DNS cutover (Cloudflare)

```bash CF_TOKEN=“cfut_…” # user-scoped token ZONE_ID=$(curl -s “https://api.cloudflare.com/client/v4/zones?name=domain.com” \

  1. H “Authorization: Bearer $CF_TOKEN” | python3 -c “import json,sys; print(json.load(sys.stdin)['result'][0]['id'])”)

# Get record IDs then update each curl -s -X PATCH “https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records/RECORD_ID” \

  1. H “Authorization: Bearer $CF_TOKEN” -H “Content-Type: application/json” \
  2. -data '{“content”:“49.13.202.144”}'

```

## Step 12 — Issue SSL

```bash cyberpanel issueSSL –domainName domain.com 2>&1 | tail -3 ```

## Step 13 — Verify

```bash curl -s -o /dev/null -w “%{http_code}” https://domain.com # Should return 200 or 301/302 ```

## Common issues

Problem Cause Fix
—————-—–
404 after migration index.html placeholder rm public_html/index.html
403 on all pages PHP handler wrong path Fix lsphpPHP83 → lsphp83 in vhost.conf
403 on all pages Permissions chmod 755 public_html/
Site loads default page Not in CyberPanel DB INSERT into websiteFunctions_websites
CF API auth error Using account token Use user-scoped token (cfut_)
CF API IPv6 error IP filter missing IPv6 Add 2a01:4f8:1c18:91ab::1 to token