Download the PHP package amdadulhaq/database-backup-laravel without Composer

On this page you can find all versions of the php package amdadulhaq/database-backup-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package database-backup-laravel

Database Backup for Laravel

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads PHP Version Laravel Version Sponsor

Simple database backups for Laravel. Dumps one PostgreSQL or MySQL / MariaDB connection (SQLite also supported) and stores it on any Laravel filesystem disk — the local disk by default, or an S3-compatible API such as Cloudflare R2, MinIO, DigitalOcean Spaces, Backblaze B2 or AWS S3.

Requirements

Installation

You can install the package via composer:

Publish the config file:

The service provider is auto-discovered.

Destination disk

Any disk from config/filesystems.php works. Point DB_BACKUP_DISK at it.

AWS S3

Cloudflare R2

MinIO

DigitalOcean Spaces

Backblaze B2 (S3-compatible)

Local / any other disk

Usage

Schedule it in routes/console.php:

Restore

The file is pulled from the backup disk, gunzipped if needed, then piped into psql / mysql (a SQLite file is swapped in atomically and its stale -wal / -shm files are removed). PostgreSQL restores run in a single transaction with ON_ERROR_STOP, and the default pg_dump options include --clean --if-exists so a restore drops existing objects first. MySQL restores stop at the first error; mysqldump emits DROP TABLE IF EXISTS for every table in the dump, but tables that exist in the target and not in the backup are left in place.

MySQL / MariaDB restores are not transactional. DDL (DROP / CREATE TABLE) commits immediately, so a restore that fails halfway leaves the database partially restored. Take a fresh backup before restoring.

The backup's type must match the connection: a .sql[.gz] file for pgsql / mysql / mariadb, a .sqlite[.gz] file for sqlite.

Configuration (config/database-backup.php / env)

Option Env Default Purpose
connection DB_BACKUP_CONNECTION DB_CONNECTION Connection to dump
disk DB_BACKUP_DISK local Destination filesystem disk
path DB_BACKUP_PATH slug of APP_NAME Root folder on the disk (so several sites can share one bucket)
compress DB_BACKUP_COMPRESS true gzip the dump before upload
retention.keep_last DB_BACKUP_KEEP_LAST 7 Keep at most N backups for the connection (0 = unlimited)
retention.keep_days DB_BACKUP_KEEP_DAYS 30 Delete backups older than N days (0 = off)
timeout DB_BACKUP_TIMEOUT 900 Max seconds for the dump
temp_directory DB_BACKUP_TEMP_DIR {system temp}/database-backup-{uid} Local scratch dir (dump/restore), resolved per user at runtime
binaries.* DB_BACKUP_BIN_MYSQLDUMP / DB_BACKUP_BIN_MYSQL / DB_BACKUP_BIN_PGDUMP / DB_BACKUP_BIN_PSQL / DB_BACKUP_BIN_MARIADB_DUMP / DB_BACKUP_BIN_MARIADB on $PATH Paths to mysqldump / mysql / pg_dump / psql
extra_options.* — see config Raw args appended per driver (mysql, mariadb, pgsql)

Backups are stored per connection as {path}/{connection}/{connection}-{database}-{Y-m-d_His}.sql (.sqlite for SQLite, .gz appended when compression is on). A short random suffix keeps backups started in the same second apart, and a .sha256 checksum is stored next to each backup and verified before a restore. The folder uses the connection name as-is. Backups written by older releases directly into {path}/ are still listed, restored and pruned when their name matches the connection and database exactly.

Connections are resolved like Laravel does: url / DB_URL is expanded, and for read/write splits the write host is used. PostgreSQL sslmode, sslcert, sslkey and sslrootcert are passed to pg_dump / psql; MySQL SSL PDO options (PDO::MYSQL_ATTR_SSL_CA, _CERT, _KEY, _CAPATH, _CIPHER, _VERIFY_SERVER_CERT) become --ssl-* flags. The MySQL password is passed in a private option file (--defaults-extra-file), not the environment. Local dump files are created with mode 0600 in a per-user 0700 temp directory.

Events

Drivers

Each database type is a small class implementing the Dumper contract (src/Dumpers/) and the Restorer contract (src/Restorers/):

Driver Backup Restore
pgsql pg_dump psql
mysql mysqldump mysql
mariadb mariadb-dump (falls back to mysqldump) mariadb (falls back to mysql)
sqlite VACUUM INTO snapshot atomic file swap

Testing

The integration tests back up and restore a real MySQL, MariaDB or PostgreSQL server; they are skipped unless DB_BACKUP_IT_DRIVER is set:

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of database-backup-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2|^8.3|^8.4|^8.5
illuminate/console Version ^11.0|^12.0|^13.0
illuminate/contracts Version ^11.0|^12.0|^13.0
illuminate/database Version ^11.0|^12.0|^13.0
illuminate/filesystem Version ^11.0|^12.0|^13.0
illuminate/support Version ^11.0|^12.0|^13.0
symfony/process Version ^7.0|^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package amdadulhaq/database-backup-laravel contains the following files

Loading the files please wait ...