I have three environments, Production, Staging, and Integration, I'd like to sync Integration DB and Code as its parent environment, which is Staging.

How could I sync the database and the code?

1 Answer 1


You can use Magento Cloud CLI to do it, you just need to change to your integration branch and run it:

Sync Database

magento-cloud sync data 

Sync Code

magento-cloud sync code 

Sync Media

zip -r -9 var/media.zip pub/media/ -x 'pub/media/catalog/tmp' -x 'pub/media/catalog/product/cache/' -x 'pub/media/tmp/'

Move the zip to your local machine and transfer it to your integration env.

magento-cloud scp -r remote:var/media.zip ./ -e staging
magento-cloud scp -r ./media.zip remote:var/ -e integration
  • My current branch is integration (In Pro plan), it shows error [ClientException] Client error response [url] ap-3.magento.cloud/api/projects/xxxxxx/environments/integration/… [status code] 400 [reason phrase] Bad Request [message] The server could not comply with the request since it is either malformed or otherwise incorrect. [detail] {"error":"Can not synchronize data with parent environment."} [title] Bad Request. Is this command only works for Starter plan?
    – leo
    Commented Dec 10, 2021 at 8:43

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.