SCRIPT

Effortless Database Management with Backup Manager

Backup Manager simplifies database backups to various cloud services, making it essential for developers and teams using MySQL or PostgreSQL.

backup database cloud php laravel backup-manager mysql postgresql
Effortless Database Management with Backup Manager

📦 Get Effortless Database Management with Backup Manager

vmaster· MIT License· ⭐ 1.7K stars · Updated Sep 8, 2024

Database management can be a complex task, especially when it comes to ensuring that your data is consistently backed up and easily recoverable. For developers working with cloud services, managing backups across multiple platforms like S3, Dropbox, FTP, and more can become overwhelming. This is where Backup Manager comes into play, offering a streamlined solution for efficiently dumping and restoring databases.

What Is Backup Manager?

Backup Manager is a framework-agnostic PHP package designed for database backup management. It provides a straightforward way to dump databases to various cloud storage options and restore them when needed. By supporting popular databases like MySQL and PostgreSQL, it caters to a wide audience of developers looking for reliable backup solutions.

Key Features

  • Framework-Agnostic: Works seamlessly with any PHP application, whether it’s a custom-built system or a popular framework like Laravel or Symfony.
  • Multi-Database Support: Compatible with both MySQL and PostgreSQL, making it versatile for different project requirements.
  • Cloud Storage Integration: Easily back up your databases to S3, Dropbox, FTP, SFTP, and Rackspace Cloud, ensuring your data is safe and accessible.
  • Gzip Compression: Compress your database dumps using Gzip to save storage space and improve transfer speeds.
  • Simple Configuration: Setting up Backup Manager is straightforward, allowing you to get started quickly without a steep learning curve.
  • Laravel and Symfony Drivers: If you’re using Laravel or Symfony, dedicated drivers are available to enhance integration and ease of use.
  • Customizable Options: Fine-tune your backup process with various parameters, including single transactions and table exclusions.

Installation & Setup

Getting started with Backup Manager is easy. You’ll need to have Composer installed to manage your PHP dependencies. Here’s how to install the package:

CODE
composer require backup-manager/backup-manager

After installing, you'll want to configure your databases. Here's an example of how to set it up in your config/database.php file:

CODE
// config/database.php
'development' => [
    'type' => 'mysql',
    'host' => 'localhost',
    'port' => '3306',
    'user' => 'root',
    'pass' => 'password',
    'database' => 'test',
    'singleTransaction' => false,
    'ignoreTables' => [],
    'ssl' => false,
    'extraParams' => null,
],
'production' => [
    'type' => 'postgresql',
    'host' => 'localhost',
    'port' => '5432',
    'user' => 'postgres',
    'pass' => 'password',
    'database' => 'test',
],

How to Use It

Once you have Backup Manager installed and configured, using it is quite simple. Here’s a practical example of how to back up a MySQL database:

CODE
use BackupManager\Manager;
use BackupManager\Filesystems\S3;

$manager = new Manager();

$manager->backup('development', new S3());

This code snippet initializes a Backup Manager instance and performs a backup of your development database to an S3 bucket. Just replace S3() with the desired storage option to back up to other services.

Who Should Use Backup Manager?

Backup Manager is ideal for developers and teams who need a reliable, straightforward solution for managing database backups. Whether you are a solo developer working on a personal project or part of a larger team managing production databases, this tool can save you time and effort while ensuring your data is secure.

Final Thoughts

In an era where data is paramount, having a robust backup strategy is crucial. Backup Manager provides an effective and easy-to-use solution for database backups, allowing you to focus on building your applications without the constant worry of data loss. Its framework-agnostic nature and support for multiple cloud services make it a versatile choice for any PHP developer. If you're looking for a reliable way to manage your database backups, Backup Manager is definitely worth considering.

ScriptForge Admin

Senior developer and curator of the ScriptForge platform. Specializing in PHP, Laravel, and full-stack JavaScript development.

gh
𝕏
🌐

Related Scripts