1
0
mirror of https://github.com/fadlee/bigdump.git synced 2025-10-22 20:26:26 +02:00
google-labs-jules[bot] 5d37441776 I have modernized the BigDump script, refactoring it into a modern PHP application.
I've converted the original `bigdump.php` script into an object-oriented application with a clear separation of concerns.

Key changes include:
- A new directory structure (`src`, `public`, `templates`, `config`).
- Object-oriented code with classes for `Configuration`, `Database`, `FileHandler`, and `Dumper`.
- Separation of HTML, CSS, and JavaScript from the PHP logic.
- Improved security by mitigating XSS and file path traversal risks.
- A new `README.md` with updated instructions.
- Unit tests for the core classes (written but not run due to environment constraints).
2025-08-11 04:49:20 +00:00

BigDump - A Staggered MySQL Dump Importer

Description

This is a modernized version of the original BigDump script by Alexey Ozerov. It allows for the staggered import of large and very large MySQL dumps (like phpMyAdmin dumps) even on web servers with hard runtime limits or those in safe mode. The script imports only a small part of the huge dump and restarts itself, continuing from where the last session left off.

This version has been refactored to use a modern PHP architecture, with a focus on security, maintainability, and ease of use.

Features

  • Imports large MySQL dump files in smaller chunks to avoid server timeouts.
  • Supports Gzip compressed dump files.
  • Supports CSV file imports.
  • AJAX-powered user interface for a smooth import process.
  • Modern, secure, and maintainable codebase.

Usage

  1. Download and Unzip: Download the latest version and unzip it.
  2. Upload: Upload the entire directory structure to your web server.
  3. Configuration:
    • Copy config/config.php to config/config.local.php.
    • Edit config/config.local.php with your database credentials.
  4. Permissions: Ensure that the data directory is writable by the web server.
  5. Run: Open public/index.php in your web browser.
  6. Upload Dump File: Use the web interface to upload your .sql, .gz, or .csv dump file.
  7. Start Import: Click the "Start Import" link next to the file you want to import.
  8. Wait: Do not close the browser window while the import is in progress.
  9. IMPORTANT: When the import is complete, it is recommended to remove the BigDump files and the data directory from your server for security reasons.

Security Note

This script is designed to execute SQL queries from a dump file. This is an inherently dangerous operation if the dump file is from an untrusted source. Always make sure you trust the source of your dump files. This modernized version has been built with security in mind and mitigates common vulnerabilities like XSS and file path traversal, but the risk of executing malicious SQL from a compromised dump file remains.

Running Tests

This project uses PHPUnit for unit tests. To run the tests, you will need to have PHP and PHPUnit installed.

  1. Install Dependencies: Make sure you have PHP installed on your system.
  2. Download PHPUnit: If you don't have PHPUnit, you can download the PHAR file:
    wget -O phpunit.phar https://phar.phpunit.de/phpunit-10.phar
    chmod +x phpunit.phar
    
  3. Run Tests: From the root of the project, run:
    ./phpunit.phar
    

Credits

This code is a modernized version of the original BigDump script written by Alexey Ozerov.

Description
No description provided
Readme 987 KiB
Languages
PHP 100%