2017 © Pedro Peláez
 

project luya-module-exporter

The exporter module allows you to easy download the full databse and storage data from a project to import them local.

image

luyadev/luya-module-exporter

The exporter module allows you to easy download the full databse and storage data from a project to import them local.

  • Wednesday, October 25, 2017
  • by nadar
  • Repository
  • 1 Watchers
  • 0 Stars
  • 973 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

LUYA EXPORTER MODULE

This module will not recieve any updates in future and will not release in a stable version as its not recomend to use, use the luya admin proxy instead!, (*1)

How to use luya proxy instead: https://luya.io/guide/concept-depandsync#sync, (*2)

The exporter module allowss you to easily download the full database and storage data from a project for a local import and thus, to setup a state of a website at a given time., (*3)

Installation

Add the exporter module to your composer.json:, (*4)

"luyadev/luya-module-exporter" : "1.0.0-RC4",

Set up you your application configuration as follows :, (*5)

'modules' => [
    // ...
    'exporter' => [
        'class' => 'luya\exporter\Module',
        'downloadPassword' => 'EnterYourSecureRandomToken',
    ],
]

And finally run the ./vendor/bin/luya migrate and ./vendor/bin/luya import commands., (*6)

Using the exporter module

Now you can install a cronjob or run the command when doing deployment to prepare the download:, (*7)

./vendor/bin/luya exporter/export

In order to download the above created files, just go into:, (*8)

https://example.com/exporter?p=EnterYourSecureRandomToken and your zip will be downloaded., (*9)

Attention! HTTP sniffers can read your plain token., (*10)

Importing from a remote host

To import a database from a remote host, you can use this command:, (*11)

./vendor/bin/luya exporter/database/remote-replace-local "mysql:host=localhost;dbname=REMOTE_DB_NAME" "USERNAME" "PASSWORD"

Attention! This command will drop all tables in your current database and replace them with the remote export., (*12)

To use this in a context where you aren't able to process user inputs (chained remote batch processing like in a deployer task) you can disable the security confirmation by adding the parameter --interactive=0. Obviously, this should be used with extreme caution to prevent any unwanted data losses., (*13)

For your safety there will be an automatically created database backup of the local db. The backup can be found in the local temporary system directory - the file name resembles like this: uniqid() . '-BACKUP-'.time(), (*14)

Using exporter as a deployer task

When using the LUYA deployer you may want to add the remote replace local command as a task and execute them when deploying the prep environment, here an example of what this could look like, you will find more information in the luya deployer docs:, (*15)

task('deploy:importProdDb', function() {
    cd('{{release_path}}');
    run('./vendor/bin/luya exporter/database/remote-replace-local "mysql:host=localhost;dbname=prod_database" "USER" "PASSWORD" --interactive=0');
})->onlyOn('prep');

after('deploy:luya', 'deploy:importProdDb');

The Versions

25/10 2017

dev-master

9999999-dev http://luya.io

The exporter module allows you to easy download the full databse and storage data from a project to import them local.

  Sources   Download

MIT

The Requires

 

sql php yii2 module yii export dev storage download luya luya-module preproduction

05/09 2017

1.0.0-RC4

1.0.0.0-RC4 http://luya.io

The exporter module allows you to easy download the full databse and storage data from a project to import them local.

  Sources   Download

MIT

The Requires

 

sql php yii2 module yii export dev storage download luya luya-module preproduction

11/04 2017

1.0.0-RC3

1.0.0.0-RC3 http://luya.io

The exporter module allows you to easy download the full databse and storage data from a project to import them local.

  Sources   Download

MIT

The Requires

 

sql php yii2 module yii export dev storage download luya luya-module preproduction

27/10 2016

1.0.0-RC2

1.0.0.0-RC2 http://luya.io

The exporter module allows you to easy download the full databse and storage data from a project to import them local.

  Sources   Download

MIT

The Requires

 

sql php yii2 module yii export dev storage download luya luya-module preproduction

12/09 2016

1.0.0-RC1

1.0.0.0-RC1 http://luya.io

The exporter module allows you to easy download the full databse and storage data from a project to import them local.

  Sources   Download

MIT

The Requires

 

sql php yii2 module yii export dev storage download luya luya-module preproduction

02/08 2016

1.0.0-beta8

1.0.0.0-beta8 http://luya.io

The exporter module allows you to easy download the full databse and storage data from a project to import them local.

  Sources   Download

MIT

The Requires

 

sql php yii2 module yii export dev storage download luya luya-module preproduction

14/06 2016

1.0.0-beta7

1.0.0.0-beta7 http://luya.io

The exporter module allows you to easy download the full databse and storage data from a project to import them local.

  Sources   Download

MIT

The Requires

 

sql php yii2 module yii export dev storage download luya luya-module preproduction

21/04 2016

1.0.0-beta6

1.0.0.0-beta6 http://luya.io

Yii2 LUYA Exporter Module

  Sources   Download

MIT

The Requires

 

sql php yii2 module yii export dev storage download luya preproduction

09/02 2016

1.0.0-beta5

1.0.0.0-beta5 http://luya.io

Zephir Luya Exporter Module

  Sources   Download

MIT

The Requires

 

sql php yii2 module yii export dev storage download luya preproduction