惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
F
Fortinet All Blogs
J
Java Code Geeks
Y
Y Combinator Blog
Stack Overflow Blog
Stack Overflow Blog
V
Visual Studio Blog
M
MIT News - Artificial intelligence
腾讯CDC
Last Week in AI
Last Week in AI
The Cloudflare Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Jina AI
Jina AI
Microsoft Security Blog
Microsoft Security Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
P
Proofpoint News Feed
博客园 - 叶小钗
Recent Announcements
Recent Announcements
T
Tailwind CSS Blog
Engineering at Meta
Engineering at Meta
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
人人都是产品经理
人人都是产品经理
L
LangChain Blog
博客园 - 司徒正美
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
GBase 8a Backup and Restore Guide: Full and Incremental B...
Michael · 2026-05-19 · via DEV Community

Michael

GBase 8a stores massive analytical datasets across many nodes. If hardware fails, someone drops a table, or an upgrade goes wrong, a solid backup strategy is your only lifeline. This guide covers the official gbackup tool for full and incremental backups, plus mysqldump for finer-grained tasks.

gbackup vs. mysqldump

Aspect gbackup mysqldump
Type Physical backup Logical backup
Speed Fast (copies data files) Slow (generates SQL statements)
Restore speed Fast Slow (re‑executes every statement)
Granularity Database / cluster Database, table
Cross‑platform Weaker Strong (standard SQL)
Best for Full disaster recovery, large volumes Table migration, cross‑platform exports

For production, gbackup is the primary tool. mysqldump fills the gaps when you need per‑table exports.

Full Backup with gbackup

Before You Start

# Verify all nodes are healthy
gcadmin showall

# Ensure the backup directory has enough space (1.5× data size recommended)
df -h /backup/gbase

Enter fullscreen mode Exit fullscreen mode

Run a Full Backup

# Basic full backup
gbackup \
  --backup-dir=/backup/gbase/full_20240601 \
  --backup-type=full \
  --user=gbase --password=your_password \
  --host=coordinator_ip --port=5258

# Compressed full backup (saves 30%–50% storage)
gbackup \
  --backup-dir=/backup/gbase/full_20240601 \
  --backup-type=full --compress \
  --user=gbase --password=your_password \
  --host=coordinator_ip --port=5258

Enter fullscreen mode Exit fullscreen mode

Verify the Backup

ls -lh /backup/gbase/full_20240601/
cat /backup/gbase/full_20240601/backup.log | tail -20
# Look for "backup completed successfully"

Enter fullscreen mode Exit fullscreen mode

Incremental Backups with gbackup

Incremental backups capture only changes since the last backup, so they're fast and compact.

gbackup \
  --backup-dir=/backup/gbase/incr_20240602 \
  --backup-type=incremental \
  --incremental-basedir=/backup/gbase/full_20240601 \
  --user=gbase --password=your_password \
  --host=coordinator_ip --port=5258

Enter fullscreen mode Exit fullscreen mode

Recommended cadence: Full on Sunday, incrementals Monday–Saturday, new full next Sunday. At worst, you lose one day of data.

Restoring from Backups

Full Restore

# Stop the database first
gcadmin stop

grestore \
  --backup-dir=/backup/gbase/full_20240601 \
  --user=gbase --password=your_password \
  --host=coordinator_ip --port=5258

gcadmin start

Enter fullscreen mode Exit fullscreen mode

Full + Incremental Restore

Restore the full backup, then apply each incremental in sequence. The last incremental omits --apply-log-only to finalize the consistent state.

# Restore full backup (don't commit yet)
grestore --backup-dir=/backup/gbase/full_20240601 --apply-log-only \
  --user=gbase --password=your_password

# Apply first incremental
grestore --backup-dir=/backup/gbase/incr_20240602 --apply-log-only \
  --incremental-dir=/backup/gbase/incr_20240602

# Apply last incremental (no --apply-log-only)
grestore --backup-dir=/backup/gbase/full_20240601 \
  --incremental-dir=/backup/gbase/incr_20240603

gcadmin start

Enter fullscreen mode Exit fullscreen mode

mysqldump for Fine-Grained Tasks

# Export a single database
mysqldump -h coordinator_ip -P 5258 -u gbase -p \
  --databases sales_db > /backup/sales_db_20240601.sql

# Export a single table
mysqldump -h coordinator_ip -P 5258 -u gbase -p \
  sales_db orders > /backup/orders_20240601.sql

# Import back
mysql -h coordinator_ip -P 5258 -u gbase -p sales_db < /backup/orders_20240601.sql

Enter fullscreen mode Exit fullscreen mode

Automating with Cron

#!/bin/bash
DATE=$(date +%Y%m%d)
BACKUP_BASE=/backup/gbase
COORD_IP=192.168.1.10

DAY_OF_WEEK=$(date +%u)
if [ "$DAY_OF_WEEK" -eq 7 ]; then
  BACKUP_DIR=$BACKUP_BASE/full_$DATE
  gbackup --backup-dir=$BACKUP_DIR --backup-type=full --compress \
    --user=gbase --password=your_password --host=$COORD_IP --port=5258
else
  LAST_FULL=$(ls -dt $BACKUP_BASE/full_* | head -1)
  BACKUP_DIR=$BACKUP_BASE/incr_$DATE
  gbackup --backup-dir=$BACKUP_DIR --backup-type=incremental \
    --incremental-basedir=$LAST_FULL --compress \
    --user=gbase --password=your_password --host=$COORD_IP --port=5258
fi

# Remove backups older than 30 days
find $BACKUP_BASE -maxdepth 1 -mtime +30 -exec rm -rf {} \;

Enter fullscreen mode Exit fullscreen mode

Add to crontab: 0 2 * * * /bin/bash /usr/local/scripts/gbase_backup.sh

Backup Readiness Checklist

  • Does the backup log end with "completed successfully"?
  • Is the backup file size similar to the previous run?
  • Perform a restore drill at least once a month.
  • Are backups stored off‑site?
  • Does the retention policy meet compliance requirements?

A backup is only as good as your ability to restore it. Run a full restore drill every quarter — when a crisis hits, you'll be glad you did. Protecting your gbase database with a solid backup routine is one of the most important investments a DBA can make.