What to back up
You need to protect four categories of data:Database backup
Usemysqldump with the --single-transaction flag to produce a consistent snapshot without locking tables during the dump.
The
--single-transaction flag uses InnoDB’s MVCC to create a consistent snapshot. This is safe for production databases because it does not block reads or writes.File backup
Archive the application files, excluding dependencies that can be reinstalled and temporary files that are regenerated automatically..env file separately with restricted permissions:
Automated backup script
Create a shell script that produces timestamped database and file backups, and rotates old backups to prevent disk exhaustion.Restore procedure
Follow these steps to restore an OwnPay installation from backup.Pre-update backups
OwnPay’s built-inUpdateService automatically creates a database backup and file snapshot before applying any update. These backups are stored in storage/backups/pre-update-{version}/.
Automatic pre-update backups are a safety net, not a replacement for your own backup schedule. If the update process itself fails catastrophically (disk full, permissions error), the automatic backup may not have completed. Always maintain independent backups.
Data export
For compliance, accounting, or migration purposes, you can export data without a full database backup.- Transactions - Filter by date range, status, or gateway on the Transactions page, then click Export CSV. This includes amount, fee, net amount, currency, status, and gateway reference.
- Reports - The Reports page generates summary data that can be exported as CSV for import into accounting software.
- Customer data - Export individual customer records or bulk-export all customers for a brand. This includes all PII in decrypted form for GDPR data portability requests.
Related Pages
- Security and Compliance - Encrypting backups and handling PII
- Migration Guide - Upgrading between versions safely
- Performance and Scaling - Optimizing backup I/O on busy servers