Download the PHP package tradesy/innobackupex without Composer

On this page you can find all versions of the php package tradesy/innobackupex. 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 innobackupex

Innobackupex


Innobackupex is a perl utility created by Percona for creating and restoring filesystem backups for MySQL

This is a PHP Wrapper for Innobackupex that allows us to use Object-Oriented design to Backup/Restore MySQL servers and automates the archival of backups onto cloud storage solutions such as AWS S3 and Google Cloud Storage.

This package is created as a PSR-0 namespaced library that is installable via PHP Composer.

Very little configuration is required to use this library.

Requirements

Methodology

This library is useable in several different ways. The simplest method requires PHP and this library to be downloaded onto the MySQL Server itself.

Alternatively, we are able to use the PHP_SSH2 Library in order to run this library remotely against any server with mysql and ssh access.

Installation

Include this repository within your composer.json package of your library

Run composer install

If you want to test using Vagrant, be sure to install Ansible dependencies:

ansible-galaxy install -v -r ansible/requirements.yml -p ansible/roles

Configuration

MySQL Configuration

Enabling Optional Encryption of Archives via Encryption Configuration

Please note, it is not recommended to store credentials or keys in plaintext within your VCS repositories. The example above is just an example. You can either encrypt the backup script, or encrypt a file with the key in it that is loadable by your backup script, or possibly use environment variables or some other solution for sensitive information.

SSH Connection Configuration

We then use this configuration object to create a connection object:

Alternatively, instead of SSH'ing into your MySQL Box, you can also run this library directly on your server using a LocalShell/Connection Object

LocalShell Connection Configuration

Save Modules

Save Modules determine where we will store our backups. You can specify one or more save modules in an array

To date, we have only implemented AWS S3 and GCS Save Modules. The goal is to have additional modules implemented using the same interfaces for us to be able to archive onto more providers by simply adding the configuration to the save module array

AWS S3 Save Module

There are two ways to use the AWS S3 Save Module. We can either use AWS's PHP SDK to handle the upload for us (\Tradesy\Innobackupex\S3\Local\Upload), or if this is not desired, we can fallback to using the shell AWS cli (\Tradesy\Innobackupex\S3\Remote\Upload) which has it's own independent credentials and configuration

In order to use the local module, we must be using a LocalShell Connection as this library and composer dependency (AWS-PHP-SDK) is required.

With an SSH Connection, we are limited in that we don't have a copy of this library in th

Google Cloud Storage Save Module

At the moment, GCS PHP SDK is not capable of handling large file uploads without exhausting memory resources. Because of this, using the \Tradesy\Innobackupex\GCS\Remote\Upload module is suggested.

Now that you have a mysql configuration, connection, and save module objects, you are ready to create the Backup Object:

Full Backup Object

to run the backup script, simply call:

This stores a serialized PHP Object of type \Tradesy\Innobackupex\Backup\Info into the $save_directory with information about relevant incremental and full backups for later use by the restoration process or additional incremental backups

Incremental Backup

Create the Incremental object

Load the previous Backup Info serialized file

Create the Backup

Restoring from Backups

Please be sure to only run this when necessary and likely, on a non-production server as it will erase all existing MySQL Data.

The restoration process looks something like this:

Load Backup Info Object from disk

Use the same $mysql_config object as before.

Use localshell connection for fastest restoration:

Create desired restore modules

Create the Restore Object

When ready, simply call the restore method. All archives will be downloaded via the restore modules and prepared automatically. Additionally, the method will restore the database.

Sample Crontab

For more examples, please see the ./Examples directory or Tests

Testing

Configuration for AWS/GCS (Optional):

You must configure your aws cli by adding api key credentials to:
  /home/vagrant/.aws/boto

and configure gsutil by running 
    gsutil configure

 You may have to update tests to reference personal buckets as well.

Start Vagrant:

Log into VM:

vagrant ssh

CD to shared Directory:

cd /var/www

Install composer packages:

composer install --dev

Create an SSH Key

ssh-keygen ( press enter a few times )

cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

Run PHPUnit

./vendor/bin/phpunit -v --debug

To see full test coverage, run:

./vendor/bin/phpunit --debug --verbose  --coverage-html html

Currently at ~80% Test Coverage, 87.5% with GCS Local Module excluded

To Reset the Database after failed test suite:

On Host:

Known Bugs

GCS Local Module (PHP SDK) Doesn't Work. This is due to the utilization of file_get/put_contents which is unstable for large files. Please use GCS\Remote\Upload|Download Modules instead.

TODO

License

Copyright (c) 2016, Matt Margolin

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Author Information

Matt Margolin

mm0 on github


All versions of innobackupex with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
aws/aws-sdk-php Version 2.*
google/apiclient Version dev-master
monolog/monolog Version ^1.20
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 tradesy/innobackupex contains the following files

Loading the files please wait ....