scandipwa / create-magento-app

A zero-configuration tool-chain which allows to deploy Magento 2 application in minutes!
https://docs.create-magento-app.com
Open Software License 3.0
31 stars 20 forks source link

Dumping and copying database to the root of the project. #121

Open u-03c9 opened 1 year ago

u-03c9 commented 1 year ago

Is your proposal related to a problem?

When we want to export the database dump file, we first need to look for the name of the docker volumn that's running mariadb, then we run: docker exec <mariadb_volumn_name> mysqldump magento --single-transaction --no-tablespaces -u magento -pmagento --result-file=/tmp/dump.sql

then we need to copy the dump file from the docker to our project root. docker cp <mariadb_volumn_name>:/tmp/dump.sql ./dump.sql

Describe the solution you'd like

add an extra command to automate dumping and copying the file to the root of the project while still being able to pass arguments to mysqldump.

for example:

npm run export-db -- --file-name="april-6.sql" --single-transaction --no-tablespaces

Describe alternatives you've considered

creating a shell script for each project, which is not really the best idea :)

Additional context

-