Download the PHP package tecactus/backap without Composer
On this page you can find all versions of the php package tecactus/backap. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package backap
Backap
Backap is a MySQL database backup manager written in PHP that can be bundled into a PHAR file. Backap aims to simply the process of dumping, restoring and syncing MySQL databases using simple CLI commands.
How do I get started?
You can use Backap in one of three ways:
As a Phar (Recommended)
You may download a ready-to-use version of Backap as a Phar:
The command will check your PHP settings, warn you of any issues, and the download it to the current directory. From there, you may place it anywhere that will make it easier for you to access (such as /usr/local/bin
) and chmod it to 755
. You can even rename it to just backap
to avoid having to type the .phar
extension every time.
Whenever a new version of the application is released, you can simply run the update
command to get the latest version:
As a Global Composer Install
This is probably the best way when you have other tools like phpunit and other tools installed in this way:
As a Composer Dependency
You may also install Backap as a dependency for your Composer managed project:
or
Once you have installed the application, you can run the help
command to get detailed information about all of the available commands. This should be your go-to place for information about how to use Backap.
Available Commands
init
the init
command creates a yaml configuration file called .backap.yaml
into the current directory.
The .backap.yaml
file structure is as follows:
backap_storage_path (optional)
In this attribute you can define the path where all the backup files generated with Backap will be stored.
This path MUST be ABOSULTE if is defined.
If any path is defined or if you omit this attribute, Backap will create a storage/database
folder into the current directory.
mysqldump_path (optional)
In this attribute you can define the path where mysqldump
is located.
This path MUST be ABOSULTE if is defined.
If any path is defined or if you omit this attribute, Backap will try to call the globally reference to mysqldump
.
mysql_path (optional)
In this attribute you can define the path where mysql
is located.
This path MUST be ABOSULTE if is defined.
If any path is defined or if you omit this attribute, Backap will try to call the globally reference to mysql
.
timezone (optional)
In this attribute you can define an specific timezone, this to know when the backup files were generated.
This timezone MUST have a VALID name.
For example:
If any timezone is defined or if you omit this attribute, Backap will use UTC.
enable_compression (optional)
Backap generates .sql
files by default, you can tell Backap to compress the generated backup file enabling compression then Backap will generate .sql.gz
files.
This value MUST be BOOLEAN if is defined.
If any value is defined or if you omit this attribute, Backap sets compression as false
by default.
default_connection (mandatory)
Backap needs to know which of your database connections will dump or restore, that's why you have to define a default connection to work on when you do not explicits define one.
The connection name MUST be DECLARED as an element on the connections array attribute.
connections (mandatory)
Backap can handle multiple database connections at the same time but first you have to define each one and asing them a diferent name.
Each connection MUST have HOSTNAME, DATABASE and USERNAME declared attribtues. PORT and PASSWORD are optional.
For example:
In the example we defined a connection named myconnection
.
Of course you can define many as you want:
cloud (optional)
Backap allows you to sync your backup files with cloud providers as Dropbox.
To enable this feature you must declare and array atribute called cloud
and inside them declare, with a unique name, each of the cloud adapters, as an array too, that will be available to sync.
For example:
Each provider requires diferent parameters thats why every adapter required diferent attributes but all of them MUST have an ATTRIBUTE called provider
.
For example:
Dropbox Adapter
To declare a Dropbox adapter you must define the following attributes:
- provider as dropbox
- access_token generated on Dropbox for Developers
- app_secret generated on Dropbox for Developers
- path will be the path inside your Dropbox
For example:
mysql:dump
The mysql:dump
command dumps the database for the default_connection
.
--connection, -c
You can explicit define one or more connections to be dumped
or
--no-compress
Disable file compression regardless if is enabled in .backap.yaml
file. This option will be always overwrited by --compress
option.
--compress
Enable file compression regardless if is disabled in .backap.yaml
file. This option will always overwrite --no-compress
option.
--sync, -s
You can sync dump files with one or more cloud provider at the moment the dump file is generated. This option will be always overwrited by --sync-all
option.
or
--sync-all, -S
Also you can sync dump files with all the defined cloud provider at the same time at the moment the dump file is generated. This option will always overwrite --sync
option.
or
mysql:restore
The mysql:restore
command restores the default_connection
database from a backup file.
The mysql:restore
command displays a list of all the backup files available only for the connection's database. Latest backup file is selected as default.
Then Backap ask for your confirmation to proceed with the database restoration.
--conection, -c
You can explicit define the connection name to be restored
or
--filename, -f
You can explicit define the backup file name to be restored
or
--all-backup-files, -A
The mysql:restore
command by default displays a list of all the backup files available only for the defined connection's database but you can use the --all-backup-files
option to return a list of all backup file generated by Backap. Latest backup file is selected as default.
or
--restore-latest-backup , -L
Explicit restore the latest backup file for the connection's database.
or
--yes, -y
The mysql:restore
command always ask for your confirmation to proceed but you can confirm it without seeing the confirmation prompt using the --yes
option.
or
--from-cloud, -C
Display a list of cloud providers where to retrieve backup files.
or
--from-provider, -p
Explicit define the cloud provider where to retrieve backup files
or
files
The files
command displays a table with detailed data about all the backup files stored on your backap_storage_path
--from-cloud, -C
Display a list of cloud providers where to retrieve backup files.
or
--from-provider, -p
Explicit define the cloud provider where to retrieve backup files
or
sync
The sync
command allows you to synchronize backup files with cloud providers. Pull files from cloud or push file to remote storage providers.
By default the sync
asks you to choose a provider from a list of current configured providers but you can explicit define a provider using the --provider
option.
push
The push
action will sync all your backup files stored locally to the remote selected provider.
or
or
pull
The pull
action will sync all your backup files stored on the selected provider to your local storage folder.
or
or
All versions of backap with dependencies
symfony/console Version ~2.0 || ~3.0
league/flysystem Version ~1.0
vlucas/phpdotenv Version ~2.2
nesbot/carbon Version ~1.0
illuminate/support Version ^5.1 || ^5.2
symfony/yaml Version ~3.0
league/flysystem-dropbox Version ~1.0
herrera-io/phar-update Version ^2.0