Create Magento App
Create ScandiPWA AppScandiPWA DocsGitHub
v2
v2
  • 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
      • System Configuration File
    • Supported Magento versions
    • How does it work?
    • Limitations
    • What Is New in Version 2
  • Usage guide
    • Using console commands
    • Accessing Docker containers
    • Linking a Scandi Theme
    • Enabling XDebug
    • Enabling SSL
    • Configuring PHP
    • Configuring Multi-Store
    • Configuring NewRelic
    • Access on the local network
    • Using custom domain
    • Using Enterprise Edition
    • Using OpenSearch
    • Importing database
      • Importing remote database
    • Converting legacy Docker setup to CMA
    • Improve Performance
  • Container images
    • PHP Images
      • PHP 8.3
        • PHP 8.3 with Magento 2.4 extensions
        • PHP 8.3 with XDebug
          • PHP 8.3 with XDebug with Magento 2.4 extensions
      • PHP 8.2
        • PHP 8.2 with Magento 2.4 extensions
        • PHP 8.2 with XDebug
          • PHP 8.2 with XDebug with Magento 2.4 extensions
      • PHP 8.1
        • PHP 8.1 with Magento 2.4 extensions
        • PHP 8.1 with XDebug
          • PHP 8.1 with XDebug with Magento 2.4 extensions
      • PHP 7.4
        • PHP 7.4 with Magento 2.4 extensions
        • PHP 7.4 with XDebug
          • PHP 7.4 with XDebug with Magento 2.4 extensions
      • PHP 7.3
        • PHP 7.3 with Magento 2.4 extensions
        • PHP 7.3 with Magento 2.3 extensions
        • PHP 7.3 with XDebug
          • PHP 7.3 with XDebug with Magento 2.4 extensions
          • PHP 7.3 with XDebug with Magento 2.3 extensions
      • PHP 7.2
        • PHP 7.2 with Magento 2.3 extensions
        • PHP 7.2 with XDebug
          • PHP 7.2 with XDebug with Magento 2.3 extensions
    • ElasticSearch Images
      • ElasticSearch 6.8
  • Scripts Extensions
    • PHP Extensions
      • PHP Extensions Package
      • (deprecated) 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?

Was this helpful?

  1. Usage guide
  2. Importing database

Importing remote database

PreviousImporting databaseNextConverting legacy Docker setup to CMA

Last updated 3 years ago

Was this helpful?

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