Why would you possibly need to create a
full dump of your n-gen.net CMS database?
Use Cases
a. Before Database Migration
- Export current database before upgrading or migrating.
- Ensure rollback capability.
b. Before Character Set Conversion
- Create a full backup before running the UTF8 Converter Tool.
- Allows restoration if conversion has issues.
c. Scheduled Maintenance
- Regular database snapshots.
- Disaster recovery preparation.
d. Development Workflow
- Export production data to development environment.
Create test database copies.
Best Practices
Always verify MD5 after download to ensure file integrity
Test restore on a development environment first
Keep backups in a secure, off-server location
Document backup procedure for your organization
Schedule regular backups - this tool is for ad-hoc backups, not automated schedules
Troubleshooting
Error: "Backup file has expired"
- Files are automatically deleted after 5 minutes
- Create a new backup and download immediately
Error: "Could not find backup file"
- Session may have expired or file was already deleted
- Create a new backup
Error: "No tables found"
- Database may be empty or
SHOW TABLES permission denied
- Contact your database administrator
Memory/Timeout Issues
- Large databases may take several minutes
- Consider using mysqldump directly for databases >500MB
- Increase execution time limit in web.config if needed
The Complete Database Backup Tool
The Complete Database Backup Tool is a pure C# utility for the n-gen.net CMS that creates a full SQL dump of your database without requiring any external tools like »mysqldump«. It provides a secure, user-friendly interface for administrators to backup their database before making structural changes or performing character set conversions.
Features
1. Complete SQL Dump
- Pure C# implementation - No dependency on external tools like mysqldump, mysqldump.exe, or shell commands
- Cross-platform compatible - Works on Windows, Linux, and macOS servers
- Full database backup - Includes all tables, stored procedures, triggers, and events
- Excludes BLOB data - Automatically skips
media* and doc* tables which contain binary data (images, documents, etc.)
2. Smart Exclusion
- media* tables - Media Centre module (images, videos, audio files stored as BLOB)
- doc* tables - Document Centre module (PDFs, Word documents, etc. stored as BLOB)
- Why exclude? BLOB data can make backup files extremely large and slow. Media and documents are typically backed up separately through dedicated import/export tools within each module.
3. Security-First Design
- Files stored in
/App_Data/ - Protected by ASP.NET, not directly accessible via URL,
- 5-minute auto-delete - Backup files are automatically deleted after 5 minutes,
- Session-protected download - Only authenticated admins can download files,
- Download triggers deletion - Files are deleted immediately after download,
- Referer validation - Ensures downloads originate from the webform, not external tools.
4. Verification & Integrity
- MD5 checksum generation - Every backup file has a corresponding
.md5 file,
- One-click copy commands - Windows (
certutil) and Linux/Mac (md5sum) commands are provided,
- Verify your backup - Compare the MD5 hash after download to ensure file integrity.
5. User Experience
- Real-time progress tracking - See which table is being processed and how many rows,
- Detailed processing log - View comprehensive table-by-table results,
- Countdown timer - Visual indication of file expiration (5 minutes),
- File history - Browse existing backup files with MD5, size, and creation date.
6. Database Compatibility
- UTF-8 support - Handles all character sets (æøå, emojis, international characters),
- Preserves AUTO_INCREMENT - All ID values are preserved during restore,
- Transaction-safe - Uses
LOCK TABLES for consistent data export.
Technical Details
File Format
[domain]_backup_yyyy-MM-dd_HH-mm-ss.sql
Example: n-gen_net_backup_2026-06-20_14-30-45.sql
File Location
/App_Data/[domain]_backup_2026-06-20_14-30-45.sql
/App_Data/[domain]_backup_2026-06-20_14-30-45.sql.md5
Export Content
The exported (dumped) file is one single self-contained file written in Structure Query Language. It contains all the information needed for a full restore of your database. It also allows a skilled Admin to pick specific SQL statements and restore parts of a broken database, table by table, row by row. Below is a list of what the SQL file contains:
- All tables except
media* and doc* tables,
- Table structures (CREATE TABLE),
- Table data (INSERT statements),
- Stored Procedures,
- Triggers,
- Events,
- Database creation (
CREATE DATABASE IF NOT EXISTS),
- Character set and collation settings.
Excluded Content
All tables related to two n-gen.net CMS Pro modules, Media Centre and Document Centre, are not included in the exported content. The reason for that is that both modules contain tables with the datatype Binary Large Object (BLOB for short) that cannot be written as text. But both modules have their own built-in backup and restore tools.
media* tables (BLOB data - images, videos)
doc* tables (BLOB data - documents, PDFs)
Why BLOB Tables Are Excluded
Technical Reasons:
- BLOB (Binary Large Object) data can be several megabytes or gigabytes per record,
- Including BLOBs increases backup time significantly,
- Backup files become unmanageably large,
- Restore operations take much longer.
Alternative Backup Strategy for BLOB Data:
- Media Centre and Document Centre modules have dedicated export/import tools
- These tools extract BLOBs as individual files and package them as ZIP archives
- Restore operations re-import from these ZIP files
- This separation allows for selective restoration of content
Restore Instructions
Using Command Line
mysql -u username -p database_name < backup_file.sql
Using phpMyAdmin
- Select the database
- Click "Import"
- Choose the
.sql file
- Click "Go"
Using MySQL Workbench
- Open MySQL Workbench
- Select the connection
- Click "Data Import/Restore"
- Select "Import from Self-Contained File"
- Choose the
.sql file
- Click "Start Import"
Security Considerations
Backup File Lifecycle
- Created → File is written to
/App_Data/
- Active → File is available for download (5 minutes)
- Expired → File is automatically deleted after 5 minutes
- Downloaded → File is deleted immediately after download
- Session End → File is cleaned up when admin session ends
Why 5 Minutes?
- Minimizes exposure window in case of security breach
- Forces admin to be present and attentive during backup
- Prevents accumulation of old backup files
- Reduces disk space usage
Why /App_Data/?
- Protected by ASP.NET - files cannot be accessed directly via URL
- Only accessible through code-behind with session validation
- Standard location for sensitive application data
Known Limitations
- BLOB data is excluded - Media and document files require separate backup via module-specific tools,
- File size limit - Very large databases (>500MB) may time out; use alternative methods,
- Memory usage - The tool reads data incrementally, but large tables may use significant memory,
- 5-minute window - Admin must be ready to download immediately after backup creation.
This tool is part of the n-gen.net CMS admin suite, version 1.3 or higher.