Skip to content

PHP script to execute Elasticsearch backups and restorations using S3

Notifications You must be signed in to change notification settings

not-empty/elastic-nomad-php

Repository files navigation

PHP Elastic Nomad

Latest Version PRs Welcome

PHP script to execute Elasticsearch backups and restorations using S3.

Installation

Release 1.0.0 Requires PHP 7.3

Release 2.0.0 Requires PHP 7.4

Sample

it's a good idea to look in the sample folder to understand how it works.

First you need to building a correct environment to install dependences

docker build -t not-empty/elastic-nomad-php -f ops/docker/dev/Dockerfile .

Access the container

docker run -v ${PWD}/:/var/www/html -it not-empty/elastic-nomad-php bash

Verify if all dependencies is installed (if need anyelse)

composer install --no-dev --prefer-dist

and run

php index.php {operation} {param}

Development

Want to contribute? Great!

The project using a simple code. Make a change in your file and be careful with your updates! Any new code will only be accepted with all viladations.

To ensure that the entire project is fine:

First you need to building a correct environment to install/update all dependences

docker build -t not-empty/elastic-nomad-php -f ops/docker/dev/Dockerfile .

Access the container

docker run -v ${PWD}/:/var/www/html -it not-empty/elastic-nomad-php bash

Install all dependences

composer install --dev --prefer-dist

Run all validations

composer check

Backup

If you want to run a backup you can run the command:

php index.php backup {param}

In the backup command the {param} is the name of the index.

Restore

If you want to restore your data in the elastic, you can run the command:

php index.php restore {param}

In the restore command the {param} is the name of the txt file located on storage/restore.

If you want to check if your data is on the elastic, you can use the collection available on /ops/collections.

Not-empty - Open your code, open your mind!