Add pgBackRest Support for PostgreSQL Backups #7214
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📋 Description
This PR implements backup capabilities for PostgreSQL databases using pgBackRest, addressing the limitations of the current pg_dump-based backup system, particularly for large databases.
🎯 Changes Made
Core Components
1. New Service Layer (
app/Services/PgBackRestService.php)2. Background Job (
app/Jobs/PgBackRestBackupJob.php)3. Database Schema (
database/migrations/_add_pgbackrest_support.php)backup_enginefield toscheduled_database_backups(pg_dump/pgbackrest)use_pgbackrestboolean flagpgbackrest_configJSON field for configurationbackup_typetoscheduled_database_backup_executions(full/diff/incr)database_sizeto track original database sizepgbackrest_configurationstable for detailed status tracking4. UI Components
Livewire Component (
app/Livewire/Project/Database/Backup/BackupConfiguration.php)Blade View (
resources/views/livewire/project/database/backup/configuration.blade.php)5. API Endpoints (
app/Http/Controllers/Api/BackupController.php)GET /api/databases/{uuid}/backups- List all backupsPOST /api/databases/{uuid}/backups- Create backup configurationPOST /api/backups/{id}/execute- Trigger manual backup (with optional type)GET /api/backups/executions/{id}- Get execution detailsPOST /api/backups/executions/{id}/restore- Restore from backup (with optional PITR)GET /api/databases/{uuid}/pgbackrest/status- Get pgBackRest status🔗 Related Issues
Closes #7172
/claim #7172