The DB Sync application was born because the development team needed to transfer data from prod to dev databases. This application drops, creates and transfers data from database-name to database-name_dev, if _dev does not exist, the application will create it.
PHP 8.2+- Packages
zip unzip libzip libzip-dev libpq-dev libpng-dev oniguruma-dev git lynx nodejs npm postgresql-client- PHP Extensions
php82-bcmath php82-bz2 php82-calendar php82-exif php82-gettext php82-opcache php82-pcntl php82-zip php82-pgsqlThis application is available in Github/Gitlab:
git clone git@github.com/celsonery/db-sync.git
or
git clone https://github.com/celsonery/db-sync.git- First you must create environment variables
export PGHOST=<ip-of-postgresql-server>
export PGUSER=<username-of-postgresql-user>
export PGPASSWORD=<password-of-postgresql-user>- Run these commands in the application folder in terminal or command prompt
composer update
php artisan key:generate
php artisan optimize
php artisan serveNow you must open your browser in the url shared by above command
- Build a docker image
docker build -t <image-name>:<image-version> -f docker/dockerfile- Run the docker container
docker run -itd --rm \
--name <container-name> \
-p <local-port>:8000 \
-e PGHOST=<ip-of-postgresql-server> \
-e PGUSER=<user-of-postgresql-user> \
-e PGPASSWORD=<password-of-postgresql-user-password> \
<image-name-created-before>Now you must open your browser in the http://localhost:8000
php artisan testXDEBUG_MODE=coverage php artisan test --coverage-html reports//reportsPlease see CHANGELOG for more details.
Thank you for considering contributing to the db sync! The contribution guide can be found in the Contribute documentation.
If you discover a security vulnerability within DB Sync, please send an e-mail to Celso Nery via celso.nery@gmail.com. All security vulnerabilities will be promptly addressed.
The DB Sync is open-sourced software licensed under the MIT license.