Introduction

This article describes the process of importing existing database in D2C.

First step. Creating a backup

The easiest way is to use backup and restore features.

MySQL, MariaDB, Percona

To make a backup of all databases connect to a host and execute:

mysqldump --skip-lock-tables --ignore-table mysql.innodb_index_stats --ignore-table mysql.innodb_table_stats --hex-blob --all-databases | gzip > backup.gz

To make a backup of specific database(s):

mysqldump --skip-lock-tables --hex-blob --databases db1 db2 db3 | gzip > backup.gz

MongoDB

To make a backup of all databases connect to a host and execute:

mongodump --gzip --archive=backup.gz

To make a backup of specific database(s):

mongodump --db db1 --gzip --archive=backup.gz

PostgreSQL

To make a backup of all databases connect to a host and execute:

pg_dumpall --clean | gzip > backup.gz

To make a backup of specific database(s):

pg_dump --clean db1 | gzip > backup.gz

Second step. Restoring

To restore a database follow the next steps:

  1. Create a database service or open an existing one
  2. Click Restore button
  3. Choose a provider
  4. Enter backup’s path and filename of an archive
  5. Click Restore data