Why Backup Your Database?
Regular database backups protect you from:
- Accidental data deletion
- Hacking or malware attacks
- Failed updates or migrations
- Hardware failures
- Human error
Best Practice: Create backups before any major changes like updates, migrations, or new plugin installations.
Backup via phpMyAdmin
Export Database
- Open phpMyAdmin from EGPNL
- Select your database from the left panel
- Click the Export tab
- Choose export method:
- Quick: Default settings, good for most cases
- Custom: More options for advanced users
- Format: SQL
- Click Go to download the .sql file
Custom Export Options
For custom exports, consider these options:
- Compression: gzip - reduces file size significantly
- Add DROP TABLE: Useful for full replacements
- Data only: Export data without structure
- Specific tables: Select only needed tables
Import via phpMyAdmin
- Open phpMyAdmin
- Select the target database (or create a new empty one)
- Click the Import tab
- Click Choose File and select your .sql or .sql.gz file
- Leave other settings as default
- Click Go
Import Warning: Importing will overwrite existing tables with the same names. Make sure you're importing to the correct database!
Large File Import
If your backup file exceeds the upload limit:
- Compress to .sql.gz format
- Upload via File Manager and import from server
- Use command line import (see below)
- Split into smaller files
Command Line Backup
For large databases or automation, use SSH:
Export (mysqldump)
# Basic export
mysqldump -u username -p database_name > backup.sql
# With compression
mysqldump -u username -p database_name | gzip > backup.sql.gz
# Specific tables only
mysqldump -u username -p database_name table1 table2 > backup.sql
# All databases
mysqldump -u username -p --all-databases > all_databases.sql
Import (mysql)
# Import SQL file
mysql -u username -p database_name < backup.sql
# Import gzipped file
gunzip < backup.sql.gz | mysql -u username -p database_name
# Import with progress (for large files)
pv backup.sql | mysql -u username -p database_name
EGPNL Backup System
Manual Backup
- Go to Backup in EGPNL
- Select Database Backups
- Choose databases to backup
- Click Create Backup
- Download when complete
Automatic Backups
- Go to Backup → Scheduled Backups
- Enable automatic backups
- Set frequency (daily, weekly)
- Choose retention period
- Include databases in backup
Storage: Automatic backups use your hosting storage. Monitor backup sizes and adjust retention as needed.
Restore from Backup
Via EGPNL
- Go to Backup in EGPNL
- Find your backup in the list
- Click Restore
- Select database restoration
- Confirm and wait for completion
Via phpMyAdmin
- Drop existing tables (if doing full restore)
- Import the backup file
- Verify data integrity
Backup Best Practices
- Regular schedule: Daily for active sites
- Before changes: Always backup before updates
- Off-site storage: Keep copies in cloud storage
- Test restores: Periodically verify backups work
- Multiple copies: Maintain several backup versions
- Include files: Backup both database AND files
3-2-1 Rule: Keep 3 copies of your data, on 2 different media types, with 1 copy off-site.
Troubleshooting
Import Fails - Timeout
Large imports may timeout. Solutions:
- Use command line import instead
- Split the SQL file into smaller parts
- Import tables one at a time
Character Encoding Issues
If you see garbled text after import:
- Ensure export and import use same encoding (UTF-8)
- Add
--default-character-set=utf8mb4to commands
Was this article helpful?