Create Magento App
Create ScandiPWA AppScandiPWA DocsGitHub
v1
v1
  • Create Magento App
  • Getting started
    • Getting Started
    • Prerequisites
      • Linux requirements
      • MacOS requirements
        • Apple Silicon
      • Windows requirements
    • Available commands
      • Start the application
      • Stop the application
      • Check application status
      • Enter application CLI
      • Explore application logs
      • Execute commands in Docker containers
      • Link a theme
      • Import database dump
      • ⚠️ Uninstall a project
    • Folder structure
    • Updating to New Releases
      • Testing Alpha Releases
    • Configuration File
    • Supported Magento versions
    • How does it work?
    • Limitations
  • Usage guide
    • Using console commands
    • Accessing Docker containers
    • Linking a Scandi Theme
    • Enabling XDebug
    • Enabling SSL
    • Configuring PHP
    • Use custom domain
    • Access on the local network
    • Importing database
      • Importing remote database
    • Using Enterprise Edition
    • Converting legacy Docker setup to CMA
    • Improve Performance
  • Scripts Extensions
    • PHP Extensions
      • ionCube Extension
  • Troubleshooting
    • Common Issues
    • CMA Debugging
    • Uninstall CMA
Powered by GitBook
On this page
  • yarn import-db [dump file path] or npm run import-db [dump file path]
  • Command options
  • Usage example:
  1. Getting started
  2. Available commands

Import database dump

PreviousLink a themeNext⚠️ Uninstall a project

Last updated 2 years ago

Since magento-scripts@1.3.0

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 command after running database import to ensure that configuration is up-to-date.

Command options

-r, --remote-db

Since magento-scripts@1.6.0

Imports database from the remote server. Currently, the following protocols are supported:

  • ssh://

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

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

Since mangento-scripts@1.6.1

Does not exclude customers and orders data when importing local and remote database.

yarn import-db ./dump.sql --with-customers-data
yarn import-db --remote-db ssh://my-username@my-server.com --with-customers-data 
npm run import-db ./dump.sql -- --with-customers-data
npm run import-db -- --remote-db ssh://my-username@my-server.com --with-customers-data

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:

yarn import-db ./dump.sql
... # output

# or with npm
npm run import-db ./dump.sql
... # output
start
Importing remote database