Easy database backup and restore functionality for your projects
POST /api/v1/backup
Authorization: Bearer YOUR_TOKEN
Creates a full database backup with timestamp.
GET /api/v1/backup
Authorization: Bearer YOUR_TOKEN
Lists all available backups with details.
Creates a full database backup with automatic timestamping and cleanup.
Any authenticated user can create backups.
{
"success": true,
"message": "Database backup created successfully",
"backup": {
"filename": "backup_2025-08-23_22-56-27.sql",
"filepath": "/home/la/backups/full/backup_2025-08-23_22-56-27.sql",
"filesize": 2519105,
"filesize_formatted": "2.4 MB",
"created_at": "2025-08-23 22:56:27",
"timestamp": "2025-08-23_22-56-27"
}
}
curl -X POST 'https://la.deltascripts.com/api/v1/backup' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json'
Lists all available backup files with detailed information.
Any authenticated user can list backups.
{
"backups": [
{
"filename": "backup_2025-08-23_22-56-27.sql",
"filepath": "/home/la/backups/full/backup_2025-08-23_22-56-27.sql",
"filesize": 2519105,
"filesize_formatted": "2.4 MB",
"created_at": "2025-08-23 22:56:27",
"modified_at": "2025-08-23 22:56:27"
}
],
"total": 1,
"backup_directory": "/home/la/backups/full/"
}
curl -X GET 'https://la.deltascripts.com/api/v1/backup' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json'
Get backup system status and statistics.
Any authenticated user can check status.
{
"system_status": {
"backup_directory": "/home/la/backups/full/",
"backup_directory_exists": true,
"backup_directory_writable": true,
"mysqldump_available": true,
"max_backups_kept": 10
},
"backup_stats": {
"total_backups": 2,
"total_size": 4975230,
"total_size_formatted": "4.74 MB",
"oldest_backup": {
"filename": "backup_2025-08-23_22-39-42.sql",
"created_at": "2025-08-23 22:39:42"
},
"newest_backup": {
"filename": "backup_2025-08-23_22-56-27.sql",
"created_at": "2025-08-23 22:56:27"
}
}
}
Restore the database from a backup file.
Superadmin only - This is a destructive operation.
{
"filename": "backup_2025-08-23_22-56-27.sql"
}
{
"success": true,
"message": "Database restored successfully from backup",
"restore": {
"filename": "backup_2025-08-23_22-56-27.sql",
"filepath": "/home/la/backups/full/backup_2025-08-23_22-56-27.sql",
"restored_at": "2025-08-23 22:56:27"
}
}
Manually trigger cleanup of old backup files, keeping only the 20 newest backups.
Admin users only - This deletes the oldest backup files.
{
"success": true,
"message": "Backup cleanup completed",
"cleanup_stats": {
"files_before": 25,
"files_after": 20,
"files_deleted": 5,
"space_freed": 12582912,
"space_freed_formatted": "12 MB",
"max_backups_kept": 20
}
}
curl -X POST 'https://la.deltascripts.com/api/v1/backup/cleanup' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json'
Delete a specific backup file.
Superadmin only - This permanently deletes the backup.
curl -X DELETE 'https://la.deltascripts.com/api/v1/backup/backup_2025-08-23_22-56-27.sql' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json'
/home/la/backups/full/Backups are named with the pattern:
backup_YYYY-MM-DD_HH-MM-SS.sql
Example: backup_2025-08-23_22-56-27.sql
/home/la/backups/full/POST /api/v1/projects/{id}/backup
Authorization: Bearer YOUR_TOKEN
Creates a project-specific backup with all project data.
GET /api/v1/projects/{id}/backup
Authorization: Bearer YOUR_TOKEN
Lists all backups for a specific project.
Creates a project-specific backup containing all areas, sections, strings, and translations for the project.
Project admin role required.
{
"success": true,
"message": "Project backup created successfully",
"backup": {
"filename": "project_64_backup_2025-08-24_01-32-26.json",
"filepath": "/home/la/backups/userbackups/64/project_64_backup_2025-08-24_01-32-26.json",
"filesize": 23384,
"filesize_formatted": "22.84 KB",
"created_at": "2025-08-24 01:32:26",
"project_id": 64,
"project_name": "TestProjectStrings",
"data_summary": {
"areas": 3,
"sections": 9,
"strings": 21,
"translations": 50
}
}
}
curl -X POST 'https://la.deltascripts.com/api/v1/projects/64/backup' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json'
Lists project backup files with metadata, size, and creation details.
Project read access required.
{
"backups": [
{
"filename": "project_64_backup_2025-08-24_01-32-26.json",
"filepath": "/home/la/backups/userbackups/64/project_64_backup_2025-08-24_01-32-26.json",
"filesize": 23384,
"filesize_formatted": "22.84 KB",
"created_at": "2025-08-24 01:32:26",
"modified_at": "2025-08-24 01:32:26",
"metadata": {
"project_id": 64,
"project_name": "TestProjectStrings",
"created_at": "2025-08-24 01:32:26",
"created_by": 1,
"created_by_name": "Admin User",
"backup_version": "1.0"
}
}
],
"total": 1,
"project_id": 64,
"backup_directory": "/home/la/backups/userbackups/64/"
}
curl -X GET 'https://la.deltascripts.com/api/v1/projects/64/backup' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json'
Restore project data from a backup file. This will replace all existing project data.
Project admin role required - This is a destructive operation.
{
"filename": "project_64_backup_2025-08-24_01-32-26.json"
}
{
"success": true,
"message": "Project backup restored successfully",
"restore_summary": {
"backup_filename": "project_64_backup_2025-08-24_01-32-26.json",
"backup_created_at": "2025-08-24 01:32:26",
"backup_created_by": "Admin User",
"restored_data": {
"areas": 3,
"sections": 9,
"strings": 21,
"translations": 50
}
}
}
curl -X POST 'https://la.deltascripts.com/api/v1/projects/64/backup/restore' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"filename": "project_64_backup_2025-08-24_01-32-26.json"}'
Delete a project backup file.
Project admin role required - This permanently deletes the backup.
curl -X DELETE 'https://la.deltascripts.com/api/v1/projects/64/backup/project_64_backup_2025-08-24_01-32-26.json' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json'
Get project backup system status and statistics.
Project read access required.
{
"system_status": {
"backup_directory": "/home/la/backups/userbackups/64/",
"backup_directory_exists": true,
"backup_directory_writable": true,
"max_backups_kept": 10,
"project_id": 64
},
"backup_stats": {
"total_backups": 1,
"total_size": 23384,
"total_size_formatted": "22.84 KB",
"oldest_backup": {
"filename": "project_64_backup_2025-08-24_01-32-26.json",
"created_at": "2025-08-24 01:32:26"
},
"newest_backup": {
"filename": "project_64_backup_2025-08-24_01-32-26.json",
"created_at": "2025-08-24 01:32:26"
}
}
}
curl -X GET 'https://la.deltascripts.com/api/v1/projects/64/backup/status' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json'
/home/la/backups/userbackups/{projectId}/The backup system is designed to be simple, secure, and reliable. It provides easy database backup and restore functionality with proper access controls and automatic management.