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 -p --all-databases | gzip > backup.gz
To make a backup of specific database(s):
mysqldump --skip-lock-tables --hex-blob -p --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:
- Create a database service or open an existing one
- Click Restore button
- Choose a provider
- Enter backup’s path and filename of an archive
- Click Restore data