ipx-digital / db-copy
Copies your production database to your development environment.
Installs: 88
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 1
pkg:composer/ipx-digital/db-copy
Requires
- php: ^7.2
- vlucas/phpdotenv: >=2.6
README
Quickly and easily refresh your local MySQL database with production data by automating the process of copying your production database to your local development database.
Installation
- Use
composer require ipx-digital/db-copyin your project's directory to include it. - Since you're using this with Laravel, you likely already have a .env file with your developemnt database config variables. All you need to do is add the following for your production DB to your .env:
PRODUCTION_DB_CONNECTION=mysql
PRODUCTION_DB_HOST=<address to production DB>
PRODUCTION_DB_DATABASE=<database name>
PRODUCTION_DB_USERNAME=<mysql username>
PRODUCTION_DB_PASSWORD=<mysql password>
SSH_USERNAME=<only needed if you're connecting over SSH>
Usage
Simply use php artisan db:copy.
Disclaimer
We're dealing with databases here, so remember to be careful. Make backups often and be careful with protected data and PII concerns.