Backup and Restore
Backup and Restore
Why Backups Matter
Importance of Backups
Backups protect against:
- Data Loss - Accidental deletion or corruption
- Hardware Failure - Server or disk failures
- Security Breaches - Malicious attacks
- Human Error - Mistakes during updates
- Disasters - Natural disasters or outages
Backup Frequency
Recommended backup schedule:
- Daily - Full backups for active forums
- Weekly - Full backups for smaller forums
- Before Updates - Always backup before updates
- Before Major Changes - Backup before configuration changes
What to Backup
Essential Files
Backup these directories and files:
Flatboard5/
âââ stockage/ # Configuration and data (CRITICAL)
â âââ json/ # JSON storage files
â âââ sqlite/ # SQLite database (Pro)
âââ uploads/ # User uploads (IMPORTANT)
â âââ avatars/
â âââ attachments/
â âââ markdown/
âââ plugins/ # Installed plugins (OPTIONAL)
âââ themes/ # Custom themes (OPTIONAL)
âââ languages/ # Custom translations (OPTIONAL)Critical Data
Must Backup:
stockage/json/- All JSON files (users, discussions, posts, config)stockage/sqlite/- SQLite database file (Pro)uploads/- User-uploaded files
Should Backup:
stockage/logs/- Log files- Custom plugins and themes
- Configuration files
Optional:
- Core application files (can re-download)
- Default themes and plugins
Backup Methods
Method 1: Admin Panel Backup (Recommended)
The easiest way to create backups is using the built-in backup feature in the admin panel:
Creating a Backup
Navigate to Admin Panel
- Go to Admin Panel > Tools > Backups
Create Backup
- Click the "Create Backup" button
- Select what to include:
- â Configuration - System configuration files
- â Data - All user data (JSON or SQLite)
- ⏠Uploads - User-uploaded files (avatars, attachments, images)
- ⏠Logs - System logs
- ⏠Cache - Cache files
- ⏠Plugins - Installed plugins (select specific plugins or all)
- ⏠Themes - Installed themes (select specific themes or all)
- Click "Create" and wait for the backup to complete
Download Backup
- Once created, click the download icon (âŹïž) next to the backup in the list
- The backup file will be downloaded to your computer
- Backup files are named:
backup_YYYY-MM-DD_HH-MM-SS.zip
Uploading a Backup
You can also upload a backup file to the server:
Navigate to Admin Panel
- Go to Admin Panel > Tools > Backups
Upload Backup
- Click the "Upload Backup" button
- Select a ZIP file from your computer
- The file must:
- Be a valid ZIP archive
- Contain a
manifest.jsonfile - Have a
.zipextension - Be within your PHP
upload_max_filesize/post_max_sizelimit (displayed on the upload page)
- Click "Upload" and wait for the upload to complete
Restoring a Backup
Navigate to Admin Panel
- Go to Admin Panel > Tools > Backups
Restore Backup
- Find the backup you want to restore in the list
- Click the "Restore" button
- Confirm the restoration (this action is irreversible)
- Wait for the restore to complete
- Important: You will be logged out after restoring data - you must log in again with the restored admin account
- All user data (if data was included in backup)
- All uploads (if uploads were included in backup)
- Selected plugins/themes (if they were included in backup)
Make sure you have a current backup before restoring an older backup!
Method 2: Manual Backup
JSON Storage Backup
# Create backup directory
mkdir -p /backups/flatboard-$(date +%Y%m%d)
# Backup JSON storage
tar -czf /backups/flatboard-$(date +%Y%m%d)/json-backup.tar.gz stockage/json/
# Backup uploads
tar -czf /backups/flatboard-$(date +%Y%m%d)/uploads-backup.tar.gz uploads/
# Backup plugins (if custom)
tar -czf /backups/flatboard-$(date +%Y%m%d)/plugins-backup.tar.gz plugins/
# Backup themes (if custom)
tar -czf /backups/flatboard-$(date +%Y%m%d)/themes-backup.tar.gz themes/SQLite Backup (Pro)
# Backup SQLite database
sqlite3 stockage/sqlite/flatboard.db ".backup /backups/flatboard-$(date +%Y%m%d)/flatboard.db"
# Or copy the file
cp stockage/sqlite/flatboard.db /backups/flatboard-$(date +%Y%m%d)/flatboard.dbFull Backup
# Backup entire installation (excluding core files)
tar -czf /backups/flatboard-full-$(date +%Y%m%d).tar.gz \
stockage/ \
uploads/ \
plugins/ \
themes/ \
languages/Method 3: Automated Backup Script
Create automated backup script:
#!/bin/bash
# backup-flatboard.sh
BACKUP_DIR="/backups/flatboard"
DATE=$(date +%Y%m%d-%H%M%S)
BACKUP_PATH="$BACKUP_DIR/$DATE"
# Create backup directory
mkdir -p "$BACKUP_PATH"
# Backup JSON storage
tar -czf "$BACKUP_PATH/json.tar.gz" stockage/json/
# Backup SQLite (if exists)
if [ -f "stockage/sqlite/flatboard.db" ]; then
sqlite3 stockage/sqlite/flatboard.db ".backup $BACKUP_PATH/flatboard.db"
fi
# Backup uploads
tar -czf "$BACKUP_PATH/uploads.tar.gz" uploads/
# Backup custom plugins
tar -czf "$BACKUP_PATH/plugins.tar.gz" plugins/
# Backup custom themes
tar -czf "$BACKUP_PATH/themes.tar.gz" themes/
# Create manifest
echo "Backup created: $DATE" > "$BACKUP_PATH/manifest.txt"
echo "Files:" >> "$BACKUP_PATH/manifest.txt"
ls -lh "$BACKUP_PATH" >> "$BACKUP_PATH/manifest.txt"
# Compress everything
tar -czf "$BACKUP_DIR/flatboard-$DATE.tar.gz" -C "$BACKUP_DIR" "$DATE"
# Remove uncompressed directory
rm -rf "$BACKUP_PATH"
# Keep only last 7 days of backups
find "$BACKUP_DIR" -name "flatboard-*.tar.gz" -mtime +7 -delete
echo "Backup completed: $BACKUP_DIR/flatboard-$DATE.tar.gz"Make executable:
chmod +x backup-flatboard.shMethod 4: Cron Job Automation
Set up automated daily backups:
# Edit crontab
crontab -e
# Add daily backup at 2 AM
0 2 * * * /path/to/backup-flatboard.sh >> /var/log/flatboard-backup.log 2>&1Backup Storage
Local Storage
Store backups on the same server:
- Pros: Fast, easy access
- Cons: Lost if server fails
Remote Storage
Store backups off-site:
FTP/SFTP
# Upload backup via SFTP
scp backup.tar.gz user@backup-server:/backups/Cloud Storage
AWS S3:
aws s3 cp backup.tar.gz s3://your-bucket/backups/Google Cloud Storage:
gsutil cp backup.tar.gz gs://your-bucket/backups/Dropbox/OneDrive:
- Use rclone or similar tools
Backup Rotation
Keep multiple backup versions:
# Keep daily backups for 7 days
# Keep weekly backups for 4 weeks
# Keep monthly backups for 12 monthsRestore Procedures
Restore from Admin Panel (Recommended)
The easiest way to restore a backup is using the built-in restore feature in the admin panel:
Step 1: Upload Backup (If Needed)
If your backup is on your computer and not on the server:
- Go to Admin Panel > Tools > Backups
- Click "Upload Backup" button
- Select the backup ZIP file from your computer
- Click "Upload" and wait for the upload to complete
The backup file must:
- Be a valid ZIP archive
- Contain a
manifest.jsonfile - Have a
.zipextension - Be smaller than 500MB (or your PHP
upload_max_filesizelimit)
Step 2: Restore Backup
- Go to Admin Panel > Tools > Backups
- Find the backup you want to restore in the list
- Click the "Restore" button
- Confirm the restoration (this action is irreversible)
- Wait for the restore to complete
- You will be automatically logged out after restoring data
- Log in again with the restored admin account credentials
- Delete all existing data that was included in the backup (users, discussions, posts, etc.)
- Delete all existing uploads if uploads were included in the backup
- Delete selected plugins/themes if they were included in the backup
- Then restore all data from the backup
This ensures a clean restore without conflicts. Make sure you have a current backup before restoring an older backup!
What Gets Restored
The restore process will restore only what was included in the backup:
- Configuration - System settings (if included)
- Data - All user data (users, discussions, posts, categories, etc.) (if included)
- Uploads - User-uploaded files (avatars, attachments, images) (if included)
- Logs - System logs (if included)
- Cache - Cache files (if included)
- Plugins - Selected plugins (if included)
- Themes - Selected themes (if included)
Restore from Command Line
Restore JSON Storage
# Stop forum (put in maintenance mode)
# Extract backup
tar -xzf json-backup.tar.gz
# Restore files
cp -r json/* stockage/json/
# Set permissions
chmod 600 stockage/json/config.json
chmod 644 stockage/json/*.json
# Clear cache
php app/Cli/console.php cache:clearRestore SQLite Database (Pro)
# Stop forum
# Restore database
sqlite3 stockage/sqlite/flatboard.db < backup.sql
# Or restore from backup file
cp backup.db stockage/sqlite/flatboard.db
# Set permissions
chmod 600 stockage/sqlite/flatboard.db
# Verify integrity
sqlite3 stockage/sqlite/flatboard.db "PRAGMA integrity_check;"Restore Uploads
# Extract backup
tar -xzf uploads-backup.tar.gz
# Restore files
cp -r uploads/* uploads/
# Set permissions
chmod -R 750 uploads/Full Restore
# Extract full backup
tar -xzf flatboard-full-20251225.tar.gz
# Restore directories
cp -r stockage/ stockage/
cp -r uploads/ uploads/
cp -r plugins/ plugins/
cp -r themes/ themes/
# Set permissions
chmod -R 750 stockage/
chmod -R 750 uploads/
chmod 755 plugins/
chmod 755 themes/
# Clear cache
php app/Cli/console.php cache:clearVerify Restore
After restoring:
- Check Files - Verify all files restored
- Test Forum - Access forum and test functionality
- Check Data - Verify discussions, posts, users
- Test Features - Test key features
- Check Logs - Review error logs
Updating Flatboard (Local Update System)
Flatboard supports a local update workflow for offline or self-hosted deployments where the automatic update check URL is not configured or not reachable. This lets you apply official update archives manually without internet access during the update itself.
How It Works
- Download a Flatboard update archive (
.zip) from the official site or your distribution channel - Upload it via the Backups page â the system detects it as an update and routes it automatically
- Apply it from Admin â Tools â Updates using a guided 5-step process
Update archives are standard ZIP files with an embedded manifest.json that identifies them as Flatboard updates:
{
"type": "update",
"software": "flatboard",
"edition": "pro",
"version": "5.2.1",
"build_date": "2026-03-10",
"checksum": "sha256:...",
"compatible_from": "5.0.0"
}manifest.json into every Community and Pro archive it produces.Step 1: Upload the Update Archive
Go to Admin Panel â Tools â Backups
Click "Upload Backup"
Select the Flatboard update
.zipfile from your computer:::info The upload page displays the effective PHP upload size limit (
upload_max_filesize/post_max_size). The client validates the file size before submitting to avoid a failed round-trip. :::Click "Upload" and wait for the upload to complete
The server detects the archive as a Flatboard update (manifest.type == "update" and manifest.software == "flatboard") and routes it to storage/updates/ instead of storage/backups/. A success notice with a link to Admin â Tools â Updates is displayed.
Step 2: Apply the Update
Go to Admin Panel â Tools â Updates
The page scans
storage/updates/and displays one card per valid archive:Card style Meaning Green ("Update") Archive version is newer than the installed version Yellow ("Reinstall") Archive version matches the installed version Listed for deletion only Archive version is older than the installed version Click "Update" or "Reinstall" on the desired archive
The 5-step progress UI runs automatically:
Step What it does 1 â Verify Validates manifest (edition, semver â„ current version, checksum) 2 â Backup Creates a full automatic backup of your forum before touching any files 3 â Extract Extracts the archive to a temporary directory 4 â Deploy Copies new files into the installation, skipping protected paths 5 â Cleanup Removes the temporary extraction directory Each step is executed over a separate CSRF-protected AJAX call with retry logic. The UI shows real-time progress and stops with an error message if any step fails.
Protected Paths
The deploy step never overwrites these paths regardless of what the archive contains:
stockage/â all forum data (JSON / SQLite)uploads/â user-uploaded files.envâ environment configuration.htaccessâ web server configurationinstall.phpâ installer
Managing Old Archives
Archives older than the currently installed version are listed separately on the Updates page with a Delete button. They cannot be applied. Clean them up once you no longer need them.
Disaster Recovery
Complete Server Failure
If server is completely lost:
- Provision New Server - Set up new server
- Install Flatboard 5 - Fresh installation
- Restore Backup - Restore from latest backup
- Verify - Test everything
- Update DNS - Point domain to new server
Partial Data Loss
If only some data is lost:
- Identify Lost Data - Determine what's missing
- Restore from Backup - Restore specific files
- Merge Data - Merge with existing data if needed
- Verify - Check data integrity
Corrupted Data
If data is corrupted:
- Stop Forum - Put in maintenance mode
- Restore from Backup - Restore last known good backup
- Verify Integrity - Check data integrity
- Test - Test functionality
Backup Best Practices
Regular Schedule
- Automate - Use cron jobs for automation
- Test Restores - Regularly test backup restoration
- Monitor - Check backup logs regularly
- Verify - Verify backup integrity
Security
- Encrypt Backups - Encrypt sensitive backups
- Secure Storage - Store backups securely
- Access Control - Limit backup access
- Off-Site - Keep backups off-site
Documentation
- Document Process - Document backup procedures
- Label Backups - Clearly label backup files
- Keep Logs - Maintain backup logs
- Update Procedures - Keep procedures current
Troubleshooting
Backup Fails
Check:
- Disk space available
- File permissions
- Backup script permissions
- Error logs
Restore Fails
Check:
- Backup file integrity
- File permissions
- Disk space
- Compatibility with current version
Backup Too Large
Solutions:
- Exclude unnecessary files
- Compress more aggressively
- Split into multiple backups
- Use incremental backups
Resources
- Installation Guide - Fresh installation
- Storage Guide - Storage information
- Troubleshooting - Backup issues
Last updated: March 10, 2026