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
  • Is there a reason to use import from remote db when possible?
  • Why 3 dump files?
  1. Usage guide
  2. Importing database

Importing remote database

PreviousImporting databaseNextUsing Enterprise Edition

Last updated 2 years ago

Currently, only SSH protocol is supported!

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

yarn import-db --remote-db ssh://my-username@my-server.com
npm run 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: 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.

import-db
mysqldump