I'm having a bit of trouble trying to get Magento to play nice inside a Docker container. Here's my situation:

  • I'm using Magento2 (1.0.0-beta)
  • I've already provisioned a MySQL database with Magento's sample data and configuration using the CLI's setup:install
  • Running setup:install inside a Docker at provision time successfully sets up Magento2 but overwrites the database

The question I have is how does one provision a new Magento machine from a fresh install but using an existing database and configuration? Are there specific files I need to copy off a master instance? And what is the best way to install all the cache files that setup:install does and warming everything up without mangling the shared database?

  • You say you have a database already, but want to run setup:install again? I suspect you don't want to run setup:install. AOE had some tools for M1 to set up config files and database settings more easily. We may still have some gaps to do this with M2, but are definitely interested in plugging those gaps.
    – Alan Kent
    Commented Aug 13, 2015 at 6:19
  • Care to divulge more? Commented Aug 13, 2015 at 6:22

3 Answers 3


It will be saved in the folder I have done kindly refer this image enter image description here


We probably need finer grained CLI commands. We got the CLI up, but have to iron out some wrinkles still.

For example, we need also to support a cluster of web servers talking to one database. Here we want to do one upgrade, not one per web server. We are talking about options here internally at the moment.

Feel free to raise as a GitHub issue to track - what you want is reasonable functionality to add into the product. You are not doing anything wrong.


In Magento2 ,If you need to get the backup of your db,media,code then you should you CLI.

setup:backup [--code] [--media] [--db] [--magento-init-params="..."]

1.setup:backup --code

2.setup:backup --db

3.setup:backup --media

Use the following command from you root folder in magento2 to take a backup for your DB

php bin/magento setup:backup --db

For the further reference Kindly refer the below Magento2 Github URL https://github.com/magento/magento2/blob/develop/setup/src/Magento/Setup/Test/Unit/Console/Command/BackupCommandTest.php

  • But then how does one restore it? Commented Aug 24, 2015 at 6:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.