Download the PHP package luyadev/luya-module-exporter without Composer
On this page you can find all versions of the php package luyadev/luya-module-exporter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download luyadev/luya-module-exporter
More information about luyadev/luya-module-exporter
Files in luyadev/luya-module-exporter
Package luya-module-exporter
Short Description The exporter module allows you to easy download the full databse and storage data from a project to import them local.
License MIT
Homepage http://luya.io
Informations about the package luya-module-exporter
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!
How to use luya proxy instead: https://luya.io/guide/concept-depandsync#sync
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.
Installation
Add the exporter module to your composer.json:
Set up you your application configuration as follows :
And finally run the ./vendor/bin/luya migrate
and ./vendor/bin/luya import
commands.
Using the exporter module
Now you can install a cronjob or run the command when doing deployment to prepare the download:
In order to download the above created files, just go into:
https://example.com/exporter?p=EnterYourSecureRandomToken and your zip will be downloaded.
Attention! HTTP sniffers can read your plain token.
Importing from a remote host
To import a database from a remote host, you can use this command:
Attention! This command will drop all tables in your current database and replace them with the remote export.
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.
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()
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: