ikechukwukalu/databasebackup

A laravel package for backing up database with local and remote connection.

v2.0.1 2024-11-01 23:59 UTC

This package is auto-updated.

Last update: 2024-12-02 00:11:26 UTC


README

Latest Version on Packagist Quality Score Code Quality Known Vulnerabilities Github Workflow Status Total Downloads Licence

A laravel package for backing up database with local and remote connection.

REQUIREMENTS

  • PHP 7.3+
  • Laravel 8+

STEPS TO INSTALL

composer require ikechukwukalu/databasebackup

BACKUP DATABASE

Set the following parameters in your .env file and run sudo php artisan database:backup to backup database.

DB_BACKUP_PATH="/db/backup/${APP_NAME}"
DB_BACKUP_COMMAND="sudo mysqldump --user=${DB_USERNAME} --password=${DB_PASSWORD} --host=${DB_HOST} ${DB_DATABASE} | gzip > "
DB_BACKUP_SSH_USER=root
DB_BACKUP_SSH_HOST=127.0.0.1
DB_BACKUP_FILE="backup-${APP_NAME}-db"
DB_BACKUP_FILE_EXT=".gz"
DB_REMOTE_ACCESS=false

Or this

DB_BACKUP_PATH="/db/backup/${APP_NAME}"
DB_BACKUP_COMMAND="sudo mysqldump --user=${DB_USERNAME} --password=${DB_PASSWORD} --host=${DB_HOST} ${DB_DATABASE} > "
DB_BACKUP_SSH_USER=root
DB_BACKUP_SSH_HOST=127.0.0.1
DB_BACKUP_FILE="backup-${APP_NAME}-db"
DB_BACKUP_FILE_EXT=".sql"
DB_REMOTE_ACCESS=false

PUBLISH CONFIG

  • php artisan vendor:publish --tag=db-config

LICENSE

The DB package is an open-sourced software licensed under the MIT license.