Data Backup & Cross-Instance Migration Best Practices
Master native VirtFusion snapshots, automated offsite synchronization with Rclone, and seamless live server migration using Rsync for resilient 3-2-1 disaster recovery.
Data security is the bedrock of production stability. Whether guarding against accidental file deletion, ransomware threats, kernel panic, or migrating services during plan upgrades, establishing a reliable offsite backup and migration procedure is essential. Powered by the VirtFusion cloud platform, FlawlessNode provides both panel-level instant snapshots and full compatibility with native Linux disaster recovery utilities.
1. Utilizing Native VirtFusion Snapshots
Before performing major software upgrades, modifying core networking configurations, or testing experimental kernel parameters, create a restore point in the VirtFusion dashboard:
- Log in to the FlawlessNode Client Portal and access the VirtFusion control panel;
- Navigate to Backups / Snapshots in the instance management menu;
- Click Create Snapshot to generate an immediate point-in-time image of your NVMe virtual disk;
- If an unexpected breaking change occurs, click Restore to roll back your entire system state instantly.
[!NOTE] Panel snapshots are designed for short-term rollbacks before risky system changes. For enterprise disaster recovery against datacenter-wide incidents, implement off-site cold storage backups following the 3-2-1 backup rule.
2. Automated Scheduled Database Dumps
When running MySQL, MariaDB, or PostgreSQL, execute hot database dumps before transferring files to prevent database corruption caused by copying active binary storage files.
Automated MySQL / MariaDB Dump Script
Create /usr/local/bin/db-backup.sh:
#!/bin/bash
BACKUP_DIR="/data/backups/mysql"
DATE=$(date +"%Y%m%d_%H%M%S")
mkdir -p "$BACKUP_DIR"
# Export and gzip all databases
mysqldump --all-databases --single-transaction --quick \
-u root -p'YOUR_DATABASE_PASSWORD' | gzip > "$BACKUP_DIR/all_databases_$DATE.sql.gz"
# Clean up backups older than 7 days
find "$BACKUP_DIR" -type f -name "*.sql.gz" -mtime +7 -delete
Grant executable permissions and schedule it in crontab (e.g., daily at 2:00 AM):
chmod +x /usr/local/bin/db-backup.sh
(crontab -l 2>/dev/null; echo "0 2 * * * /usr/local/bin/db-backup.sh >/dev/null 2>&1") | crontab -
3. Offsite Object Storage Synchronization with Rclone
Rclone is the industry standard for syncing files and backups securely to Cloudflare R2, Backblaze B2, AWS S3, Google Drive, or private WebDAV storage.
3.1 Installing and Configuring Rclone
# Official one-line installer
sudo -v ; curl https://rclone.org/install.sh | sudo bash
# Configure remote storage endpoint
rclone config
# Follow the interactive prompts, select S3 protocol, input your Endpoint, Access Key, and Secret Key, and name it my-remote
3.2 Syncing Local Backups to Remote Buckets
# Sync local backup directory to remote bucket folder backup-vps
rclone sync /data/backups my-remote:backup-vps/daily --transfers 4 -P
Triggering this command after your database dump provides fully automated offsite disaster recovery without manual intervention.
4. Live Server Migration: Near-Zero Downtime with Rsync
When upgrading between FlawlessNode plans (e.g., moving from AS4837 to the AS9929 flagship profile) or moving across regions, perform a seamless cutover using rsync over SSH.
4.1 Configuring Passwordless SSH Authentication
Generate a temporary migration key on the old server and install it on the new server:
# Generate temporary key on old server
ssh-keygen -t ed25519 -N "" -f ~/.ssh/migration_key
# Copy public key to new server
ssh-copy-id -i ~/.ssh/migration_key.pub root@NEW_SERVER_IP
4.2 Initial Pre-sync (While Services Remain Live)
Sync large static assets, web files, and Docker volumes without disrupting active users:
# Sync web roots and container volumes
rsync -avzP -e "ssh -i ~/.ssh/migration_key" \
--delete \
--exclude="*.log" \
/www/wwwroot/ root@NEW_SERVER_IP:/www/wwwroot/
rsync -avzP -e "ssh -i ~/.ssh/migration_key" \
/data/docker/ root@NEW_SERVER_IP:/data/docker/
4.3 Final Cutover & Incremental Sync (1~3 Minutes Maintenance Window)
- Lower DNS TTL: Set your domain’s DNS TTL to
60seconds 24 hours prior to cutover; - Stop Write Services on Old Server: Temporarily stop web and database daemons to prevent new write discrepancies:
sudo systemctl stop nginx mysql - Execute Final Database Dump and Rsync:
# Export and pipe directly into the new server mysqldump --all-databases --single-transaction -u root -p'PASSWORD' | \ ssh -i ~/.ssh/migration_key root@NEW_SERVER_IP "mysql -u root -p'NEW_PASSWORD'" # Quick delta sync of files modified during the pre-sync window rsync -avzP -e "ssh -i ~/.ssh/migration_key" \ --delete \ /www/wwwroot/ root@NEW_SERVER_IP:/www/wwwroot/ - Start Daemons on New Server: Start Nginx and database services on the new server and verify site functionality;
- Update DNS Records: Point your domain’s A / AAAA records to the new instance’s IP. With a 60-second TTL, global traffic migrates cleanly within minutes!
[!TIP] Keep your old VirtFusion instance running for 48 hours as a cold fallback before terminating it in the Client Portal.