Importing remote database

Currently, only SSH protocol is supported!

To import database from remote server use import-db command with --remote-db option:

yarn import-db --remote-db ssh://my-username@my-server.com

CMA will connect via ssh to your server, create 2 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.

Is there a reason to use import from remote db when possible?

There is a good reason for it! The dump file created by this command is much smaller than dump files that are created the usual way. This is because we omit orders and customers data when we're creating dump file so it comes in a much smaller size.

For example, a dump from a database could weigh 2.7GB, now using this import feature size will be reduced to 4MB.

Why 3 dump files?

The reason to make 3 dump files is simple: mysqldump utility cannot make dump files with only a few tables without data, --no-data option is a boolean so we have only 2 options, either include data or not.

dump-0.sql file contains all the database tables with data, except for the order and customer-related tables. dump-1.sql file contains only orders and customer-related table structures, without data. dump.sql file is made from concatenating dump-0.sql with dump-1.sql , which are downloaded from your remote server, so it's a full dump file.

Last updated