2017 © Pedro Peláez
 

symfony-bundle syncbundle

Symfony2 Bundle that handles the synchronization between a production site and test/development servers

image

kmj/syncbundle

Symfony2 Bundle that handles the synchronization between a production site and test/development servers

  • Tuesday, March 29, 2016
  • by demoboy
  • Repository
  • 1 Watchers
  • 1 Stars
  • 549 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 3 % Grown

The README.md

KMJSyncBundle

Welcome to the KMJSyncBundle. The goal of this project to ease the hassle of getting live data to your development and testing servers. This bundle takes the specified folders and the production database and compresses them into a tar file. The development servers can then request the latest backup, download it, and install it., (*1)

1) Installation

KMJSyncBundle can conveniently be installed via Composer. Just add the following to your composer.json file:, (*2)

// composer.json
{
    // ...
    require: {
        // ..
        "kmj/syncbundle": "dev-master"
    }
}

Then, you can install the new dependencies by running Composer's update command from the directory where your composer.json file is located:, (*3)

    php composer.phar update

Now, Composer will automatically download all required files, and install them for you. All that is left to do is to update your AppKernel.php file, and register the new bundle:, (*4)

// in AppKernel::registerBundles()
$bundles = array(
    // ...
    new KMJ\SyncBundle\KMJSyncBundle(),
    // ...
);

2) Configuration

This bundle comes with a few configuration options., (*5)

api_syncing:
   dir:                 #The working directory for the bundle, no data is stored here. Defaults to %kernel.root_dir%/cache/sync
   backups:             #The directory to store all the backups. Defaults to %kernel.root_dir%/Resources/backups
   compression:         #The compression method to be used for the backup files. Only supported one at the moment is tar
   numberofbackups:     #The number of backups to keep Defaults to 3
  
   ## ALL OF THESE ARE REQUIRED ##

paths:                  #Array of directories to compress
      - path:           #The path for the folder to be backed up. Example:%kernel.root_dir%/../web/uploads

   database:            #Production database credentials
      type: mysql       #Mysql is the only supported type
      host:             #Production server database host
      database:         #Production server database name
      user:             #Production server database username
      password:         #Production server database password 
   ssh:
     host:              #Production server host name
     port: 2100         #Production server port
     username:          #Production server username
     path:              #Path to the root of the site

3) Usage

On the production server a command like, (*6)

app/console kmj:sync:backup --env=prod

will generate a backup file to that the other development and testing servers can download it, (*7)

On your testing servers all you need to do is run, (*8)

app/console kmj:sync:sync

This will download the backup file, extract it's contents, dump the current database and reload it with production data and finally move any folders to their original location., (*9)

The Versions

29/03 2016

dev-master

9999999-dev http://github.com/Demoboy/SyncBundle

Symfony2 Bundle that handles the synchronization between a production site and test/development servers

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

by Kaelin Jacobson

sync synchronization kmj