Queue-driven, panel-native MySQL backups for Pterodactyl, packaged as a Blueprint extension.
Made by @najuaircrack.
! This is an AI generated showcase image intended to visually represent all features in one view. The actual interface may differ slightly.
- Runs MySQL backups through Laravel queues, not external cron scripts.
- Creates one queued backup record per database before the worker starts, so manual and scheduled backups are visible immediately.
- Supports per-server backup policies, intervals in minutes, retention limits, quotas, restore safety backups, and manual cooldowns.
- Streams
mysqldumpoutput directly into compressed.sql.gzfiles. - Optionally encrypts backups using AES-256-GCM, producing
.sql.gz.enc. - Imports and lists legacy local backups from existing backup folders.
- Lets users download, restore, filter, search, and monitor backup progress from the server panel.
- Gives admins global defaults, server-specific limits, provider health checks, audit logs, and backup history.
- Supports local, S3-compatible, FTP, FTPS, SFTP, Google Drive (OAuth), OneDrive, Dropbox, Box, MEGA, pCloud, Yandex Disk, WebDAV, and generic rclone storage.
The extension is fully panel integrated:
MysqlBackupSchedulerServicereconciles due schedules from the database.MysqlBackupQueueServicecreates backup records and dispatches database jobs.ProcessMysqlDatabaseBackupJobrunsmysqldump, compresses, encrypts when enabled, uploads, verifies, notifies, and enforces retention.MysqlBackupStorageManagerabstracts local, S3-style, FTP/SFTP, rclone, and Google Drive (native OAuth) storage.GoogleDriveOAuthServicehandles Google Drive OAuth token exchange, refresh, and direct Drive REST API uploads — no rclone required for Google Drive.MysqlBackupAdminSettingsServicemanages global and per-server admin defaults.- React server UI handles policy, provider setup, manual backup, restore, download, progress, and history.
- Blade admin UI handles operational controls, provider testing, server limit overrides, and audits.
- Pterodactyl panel with Blueprint, target
beta-2026-01. - Working Laravel queue worker, normally
pteroq. mysqldumpandmysqlavailable on the panel host.- Optional:
rclonefor OneDrive, Dropbox, Box, MEGA, pCloud, WebDAV, and similar providers. Not required for Google Drive. - Optional: Flysystem FTP/SFTP adapters, installed by
private/install.sh.
Place the extension in your Blueprint extensions directory as mysqlautobackup, then run:
blueprint -build
php artisan migrate --force
php artisan optimize:clear
php artisan queue:restart
systemctl restart pteroqIf you use FTP, FTPS, or SFTP storage, install the adapters:
composer require league/flysystem-ftp league/flysystem-sftp-v3Users connect their own Google Drive directly through OAuth. Backups upload straight to their Drive via the Google Drive REST API. No rclone installation or config files required.
- Go to https://console.cloud.google.com and sign in.
- Click the project dropdown at the top → New Project → give it a name → Create.
- Make sure your new project is selected in the dropdown.
- In the left sidebar go to APIs & Services → Library.
- Search for Google Drive API and click it.
- Click Enable.
- Go to APIs & Services → OAuth consent screen.
- Choose External → Create.
- Fill in:
- App name — anything, e.g.
Pterodactyl Backup - User support email — your email
- Developer contact email — your email
- App name — anything, e.g.
- Click Save and Continue through the Scopes and Test Users steps (no changes needed).
- Click Back to Dashboard.
If your app stays in Testing mode, only Google accounts you add as test users can connect. To allow any Google account, click Publish App → Confirm.
- Go to APIs & Services → Credentials.
- Click + Create Credentials → OAuth 2.0 Client ID.
- Set Application type to Web application.
- Give it a name, e.g.
Pterodactyl Backup Client. - Under Authorized redirect URIs, click + Add URI and enter:
https://game.example.in/api/client/extensions/mysqlautobackup/mysql-backups/google-oauth/callback
Replace
game.example.inwith your actual panel domain. Do not add a trailing slash.
- Click Create.
- Copy the Client ID and Client Secret shown — you will need both in the next step.
- Open your server in the Pterodactyl panel and go to the MySQL Backups tab.
- Scroll to Storage Providers and click Add Provider.
- Select Google Drive from the driver dropdown.
- Enter a Name for this provider, e.g.
My Google Drive. - Paste your Client ID and Client Secret from Step 4.
- Click Connect Google Drive.
- A Google consent popup will open — sign in with the Google account you want backups saved to and click Allow.
- The popup closes automatically and the provider appears in your list.
- Still on the MySQL Backups tab, go to Configuration.
- Set Storage Provider to the Google Drive provider you just added.
- Save the configuration.
Backups will now upload directly to a folder called pterodactyl-mysql-backups in that Google account's Drive, organized as servers/{server-uuid}/{year}/{month}/{day}/{database}_{time}.sql.gz.
Retention works automatically. When a backup is pruned by the retention count or retention days policy, the extension calls the Google Drive API to delete the file from Drive as well. No manual cleanup needed.
"redirect_uri_mismatch" error from Google
The redirect URI in your Google Cloud credentials does not match exactly. Check that you entered:
https://game.example.in/api/client/extensions/mysqlautobackup/mysql-backups/google-oauth/callback
with no trailing slash and using https, not http.
"Google did not return a refresh token"
This happens if the consent screen was already approved once without prompt=consent. Go to https://myaccount.google.com/permissions, remove the app's access, then try connecting again.
Upload fails after a long backup
The access token may have expired mid-upload on very large databases. The extension retries once with a fresh token automatically. If it still fails, check your panel PHP timeout settings.
Popup is blocked
Allow popups for your panel domain in your browser, then click Connect again.
MYSQL_BACKUP_LOCAL_ROOT=/var/lib/pterodactyl/backups/databases
MYSQL_BACKUP_MYSQLDUMP_PATH=mysqldump
MYSQL_BACKUP_MYSQL_PATH=mysql
MYSQL_BACKUP_RCLONE_PATH=rclone
MYSQL_BACKUP_ENCRYPTION_KEY=
MYSQL_BACKUP_DUMP_USERNAME=
MYSQL_BACKUP_DUMP_PASSWORD=
MYSQL_BACKUP_DUMP_HOST=
MYSQL_BACKUP_DUMP_IDLE_TIMEOUT=300
MYSQL_BACKUP_DISCORD_MAX_ATTACHMENT_BYTES=26214400
MYSQL_BACKUP_ALLOW_PRIVATE_WEBHOOKS=falseMost runtime limits are configured in the admin panel. Environment values are used for binary paths, optional defaults, and security overrides.
For OneDrive, Dropbox, Box, MEGA, pCloud, Yandex Disk, and WebDAV, users supply an rclone config block:
- Admin enables
Allow users to add server storage providersand the desired provider. - User creates a remote with rclone on a trusted machine:
rclone config
rclone config show myremote- User adds the provider in the panel, sets a remote path like
myremote:pterodactyl/mysql-backups, and pastes the rclone config block.
The config is stored encrypted in the database and written to a temporary 0600 file only while a job runs.
If Pterodactyl database users cannot connect from the panel host, configure a dedicated dump user:
CREATE USER 'ptero_backup'@'PANEL_HOST_OR_IP' IDENTIFIED BY 'strong-password';
GRANT SELECT, SHOW VIEW, TRIGGER, EVENT ON `database_name`.* TO 'ptero_backup'@'PANEL_HOST_OR_IP';
FLUSH PRIVILEGES;- Database passwords and storage provider credentials are never sent to the frontend.
- Storage provider configs including OAuth tokens are encrypted with Laravel
Crypt. - Google Drive OAuth tokens are auto-refreshed server-side; the client secret never leaves the server after initial setup.
- Optional backup encryption uses AES-256-GCM.
- Webhook URLs are blocked if they resolve to private or reserved IP ranges unless
MYSQL_BACKUP_ALLOW_PRIVATE_WEBHOOKS=true. - Rclone remotes must use named remotes like
gdrive:path; inline remotes and parent traversal are rejected. - Generic rclone is disabled by default for new installs.
After changing code or rebuilding:
php artisan optimize:clear
php artisan queue:restart
systemctl restart pteroqUseful checks:
systemctl status pteroq
php artisan queue:failed
php artisan queue:retry allmysqldump: Got error: 1045 Access denied
Use a dedicated backup user and ensure the MySQL host allows that user from the panel host IP.
Manual backups are queued but never complete
Check pteroq, failed Laravel jobs, and that mysqldump is available to the panel user.
Local provider test fails
chown -R www-data:www-data /var/lib/pterodactyl/backups/databases
chmod -R 750 /var/lib/pterodactyl/backups/databasesrclone upload fails (non-Google Drive providers)
Confirm rclone is installed, the remote name in the path matches the pasted config block, and the config block includes the correct type section.
