Import database dump

yarn import-db [dump file path] or npm run import-db [dump file path]

Imports database dump into MySQL container.
Note 1: To be able to import a database dump application must be running. Note 2: It is recommended to run the start command after running database import to ensure that configuration is up-to-date.

Command options

-r, --remote-db

Imports database from the remote server. Currently, the following protocols are supported:
  • ssh://
yarn
npm
1
yarn import-db --remote-db ssh://[email protected]
Copied!
1
npm run import-db -- --remote-db ssh://[email protected]
Copied!
Now it will connect via ssh to your server, create dump files (dump-0.sql and dump-1.sql), download them to your projects root folder, merge them into single dump.sql and import to your local instance with applied fixes.
To learn more about this option, read the following guide:

--with-customers-data

Does not exclude customers and orders data when importing local and remote database.
yarn
npm
1
yarn import-db ./dump.sql --with-customers-data
2
yarn import-db --remote-db ssh://[email protected] --with-customers-data
Copied!
1
npm run import-db ./dump.sql -- --with-customers-data
2
npm run import-db -- --remote-db ssh://[email protected] --with-customers-data
Copied!
If you are importing a remote database and using this option, CMA will create only one dump.sql file with all data inside it.

Usage example:

1
yarn import-db ./dump.sql
2
... # output
3
4
# or with npm
5
npm run import-db ./dump.sql
6
... # output
Copied!
Last modified 4mo ago