-
Notifications
You must be signed in to change notification settings - Fork 0
Backup Recovery Guide
Status: ✅ Complete
Last Updated: December 5, 2025
This guide helps you backup your RiceCoder data and recover from data loss or corruption. Regular backups ensure you don't lose important work.
Configuration:
-
~/.ricecoder/config.yaml- Global configuration -
.agent/config.yaml- Project configuration -
~/.ricecoder/- All global settings
Sessions:
-
~/.ricecoder/sessions/- Saved chat sessions - Session history and metadata
Project Data:
-
.agent/specs/- Specifications -
.agent/hooks/- Hook configurations -
.agent/- All project-specific data
Cache:
-
~/.ricecoder/cache/- Cached data (can be regenerated)
Logs:
-
~/.ricecoder/logs/- Log files (for debugging)
Backup Configuration:
# Backup global configuration
cp -r ~/.ricecoder ~/.ricecoder.backup.$(date +%Y%m%d)
# Backup project configuration
cp -r .agent .agent.backup.$(date +%Y%m%d)Restore Configuration:
# Restore global configuration
rm -rf ~/.ricecoder
cp -r ~/.ricecoder.backup.20251205 ~/.ricecoder
# Restore project configuration
rm -rf .agent
cp -r .agent.backup.20251205 .agentCreate backup script (backup-ricecoder.sh):
#!/bin/bash
# Backup directory
BACKUP_DIR="$HOME/ricecoder-backups"
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
BACKUP_PATH="$BACKUP_DIR/ricecoder_$TIMESTAMP"
# Create backup directory
mkdir -p "$BACKUP_PATH"
# Backup global configuration
cp -r ~/.ricecoder "$BACKUP_PATH/ricecoder_home"
# Backup project configuration (if in a project)
if [ -d ".agent" ]; then
cp -r .agent "$BACKUP_PATH/agent_project"
fi
# Create tar archive
tar -czf "$BACKUP_PATH.tar.gz" -C "$BACKUP_DIR" "ricecoder_$TIMESTAMP"
# Remove uncompressed backup
rm -rf "$BACKUP_PATH"
# Keep only last 10 backups
ls -t "$BACKUP_DIR"/ricecoder_*.tar.gz | tail -n +11 | xargs rm -f
echo "Backup created: $BACKUP_PATH.tar.gz"Make script executable:
chmod +x backup-ricecoder.shRun backup:
./backup-ricecoder.shUsing rsync to remote server:
# Backup to remote server
rsync -avz ~/.ricecoder user@backup-server:/backups/ricecoder/
# Backup project configuration
rsync -avz .agent user@backup-server:/backups/ricecoder/projects/Using cloud storage (AWS S3):
# Install AWS CLI
pip install awscli
# Configure AWS credentials
aws configure
# Backup to S3
aws s3 sync ~/.ricecoder s3://my-backup-bucket/ricecoder/
# Backup project configuration
aws s3 sync .agent s3://my-backup-bucket/ricecoder/projects/Using cloud storage (Google Drive):
# Install rclone
curl https://rclone.org/install.sh | sudo bash
# Configure Google Drive
rclone config
# Backup to Google Drive
rclone sync ~/.ricecoder gdrive:ricecoder-backup/
# Backup project configuration
rclone sync .agent gdrive:ricecoder-backup/projects/Backup to Git repository:
# Create backup repository
mkdir ricecoder-backup
cd ricecoder-backup
git init
# Copy data
cp -r ~/.ricecoder .
cp -r ../.agent .
# Commit and push
git add .
git commit -m "RiceCoder backup $(date)"
git remote add origin https://github.com/YOUR_USERNAME/ricecoder-backup.git
git push -u origin main| Data | Frequency | Retention |
|---|---|---|
| Configuration | Weekly | 4 weeks |
| Sessions | Daily | 2 weeks |
| Project Data | After changes | 1 month |
| Full Backup | Monthly | 3 months |
Using cron (macOS/Linux):
# Edit crontab
crontab -e
# Add backup job (daily at 2 AM)
0 2 * * * /path/to/backup-ricecoder.sh
# Add backup job (weekly on Sunday at 3 AM)
0 3 * * 0 /path/to/backup-ricecoder.shUsing Task Scheduler (Windows):
- Open Task Scheduler
- Create Basic Task
- Set trigger (daily, weekly, etc.)
- Set action to run backup script
- Enable task
Restore global configuration:
# Stop RiceCoder
pkill rice
# Restore from backup
rm -rf ~/.ricecoder
cp -r ~/.ricecoder.backup ~/.ricecoder
# Restart RiceCoder
rice chatRestore project configuration:
# Restore from backup
rm -rf .agent
cp -r .agent.backup .agent
# Verify restoration
rice config showExtract tar archive:
# Extract backup
tar -xzf ricecoder_20251205_120000.tar.gz
# Restore configuration
cp -r ricecoder_20251205_120000/ricecoder_home ~/.ricecoder
cp -r ricecoder_20251205_120000/agent_project .agentRestore from AWS S3:
# Restore from S3
aws s3 sync s3://my-backup-bucket/ricecoder/ ~/.ricecoder
# Restore project configuration
aws s3 sync s3://my-backup-bucket/ricecoder/projects/ .agentRestore from Google Drive:
# Restore from Google Drive
rclone sync gdrive:ricecoder-backup/ ~/.ricecoder
# Restore project configuration
rclone sync gdrive:ricecoder-backup/projects/ .agentClone backup repository:
# Clone backup repository
git clone https://github.com/YOUR_USERNAME/ricecoder-backup.git
# Restore configuration
cp -r ricecoder-backup/ricecoder ~/.ricecoder
cp -r ricecoder-backup/agent .agentIf you lose all data:
-
Reinstall RiceCoder:
cargo install ricecoder
-
Restore from backup:
# Restore configuration cp -r ~/.ricecoder.backup ~/.ricecoder cp -r .agent.backup .agent
-
Verify restoration:
rice config show rice session list
If configuration is corrupted:
-
Reset to defaults:
rice config reset
-
Restore from backup:
cp ~/.ricecoder.backup/config.yaml ~/.ricecoder/config.yaml
-
Validate configuration:
rice config validate
If sessions are lost:
-
Check backup:
ls -la ~/.ricecoder.backup/sessions/ -
Restore sessions:
cp -r ~/.ricecoder.backup/sessions/* ~/.ricecoder/sessions/
-
Verify sessions:
rice session list
If only some data is lost:
-
Identify what's missing:
ls -la ~/.ricecoder/ ls -la .agent/ -
Restore missing data:
# Restore specific file cp ~/.ricecoder.backup/config.yaml ~/.ricecoder/config.yaml # Restore specific directory cp -r ~/.ricecoder.backup/sessions ~/.ricecoder/
-
Verify restoration:
rice config validate rice session list
- Backup Frequently: Backup at least weekly
- Automate Backups: Use cron or Task Scheduler
- Test Backups: Regularly test restoration
- Keep Multiple Copies: Keep backups in multiple locations
- Monitor Backups: Ensure backups complete successfully
- Local Backup: Keep a local backup for quick recovery
- Remote Backup: Keep a remote backup for disaster recovery
- Cloud Backup: Use cloud storage for redundancy
- Offline Backup: Keep an offline backup for security
- Encrypted Backup: Encrypt sensitive backups
- Test Restoration: Regularly test backup restoration
- Verify Integrity: Verify backup file integrity
- Check Completeness: Ensure all data is backed up
- Monitor Size: Monitor backup size for anomalies
- Document Process: Document your backup process
- Encrypt Backups: Encrypt sensitive data
- Secure Storage: Store backups securely
- Access Control: Limit access to backups
- Audit Logs: Log backup and restore operations
- Secure Deletion: Securely delete old backups
Before relying on backups, ensure you:
- Identify critical data to backup
- Choose backup method(s)
- Create backup script or schedule
- Test backup process
- Verify backup completeness
- Test restoration process
- Document backup procedure
- Monitor backup execution
- Keep backups secure
- Regularly review and update backups
Problem: Backup script fails or doesn't complete.
Solution:
- Check disk space:
df -h - Check permissions:
ls -la ~/.ricecoder - Check backup destination:
ls -la ~/ricecoder-backups - Run backup manually:
./backup-ricecoder.sh - Check logs for errors
Problem: Restoration doesn't work or data is corrupted.
Solution:
- Verify backup file:
tar -tzf ricecoder_backup.tar.gz - Check backup integrity:
tar -xzf ricecoder_backup.tar.gz -C /tmp - Verify file permissions:
ls -la ~/.ricecoder - Try restoring to temporary location first
- Check for conflicts with existing data
Problem: Backup files are taking up too much space.
Solution:
- Compress backups:
gzip ricecoder_backup/ - Remove old backups:
rm -rf ricecoder_backup_old/ - Exclude cache:
--exclude=cache - Use incremental backups
- Archive old backups to cloud storage
If you need help with backups or recovery:
- Check This Guide: Review this guide for solutions
- Check FAQ: FAQ
- Check Troubleshooting: Troubleshooting Guide
- Ask Community: GitHub Discussions
- Report Issue: GitHub Issues
- Installation & Setup - Installation guide
- Configuration Guide - Configuration options
- Upgrade Guide - Upgrade instructions
- Troubleshooting Guide - Troubleshooting help
Last updated: December 5, 2025