Database Backups
FeedbackPulse includes a built-in backup system (Admin → バックアップ) that lets you create, download, and manage database backups directly from the 管理パネル.
🔧 仕組み
FeedbackPulse intelligently detects your hosting environment and picks the best backup method:
| Environment | メソッド | Speed |
|---|---|---|
| VPS/Dedicated (exec available) | mysqldump command → gzip | Fast |
| Windows (Laragon/XAMPP) | mysqldump → PHP gzencode | Fast |
| Shared hosting (exec disabled) | Pure PHP/PDO dump → gzencode | Moderate |
The system automatically falls back to the PHP-based method if exec() is disabled or mysqldump is not found. This means backups work on every hosting type, including 共有ホスティング where shell commands are restricted.
📋 機能
Create a Backup
Click Create Backup to generate a new database dump. The file is saved to storage/app/backups/ with a timestamped filename.
Download a Backup
Click the download icon next to any backup to download the .sql.gz file.
Delete a Backup
Click the delete icon to remove a backup file. This only deletes the backup file — your live database is not affected.
Backup List
Shows all existing backups with:
- Filename
- File size
- Creation date
- Download/Delete actions
🔐 セキュリティ
- バックアップ are stored inside
storage/app/backups/(not publicly accessible) - データベース passwords are handled via temporary
.my.cnffiles that are deleted after use - Only superadmins can access the backup feature
💡 Best Practices
- Create regular backups — before updates, major changes, or periodically
- Download backups — don't just keep them on the server
- Test restoration — periodically verify backups can be restored
- Automate — set up a cronジョブ for automatic daily backups if needed
Manual Backup via Command Line
cd /var/www/feedbackpulse-saas
mysqldump -u feedbackpulse -p feedbackpulse | gzip > storage/app/backups/manual_$(date +%Y%m%d).sql.gz
Restoring a Backup
gunzip < storage/app/backups/backup_file.sql.gz | mysql -u feedbackpulse -p feedbackpulse