DDEV provides integration with the Platform.sh Website Management Platform, which allows Platform.sh users to quickly download and provision a project from Platform.sh in a local DDEV-managed environment.
ddev get ddev/ddev-platformsh (platformsh/ddev-platformsh) for more complete Platform.sh integration.
DDEV’s Platform.sh integration pulls databases and files from an existing Platform.sh site/environment into your local system so you can develop locally.
Platform.sh Global Configuration¶
You need to obtain and configure an API token first. This is only needed once.
- Login to the Platform.sh Dashboard and go to Account → API Tokens. Create an API token DDEV can use.
- Add the API token to the
web_environmentsection in your global DDEV configuration at
Platform.sh Per-Project Configuration¶
- Check out the site from Platform.sh and configure it with
ddev config. You’ll want to use
ddev startand make sure the basic functionality is working.
PLATFORM_ENVIRONMENTvariables to your project.
Or with a command from your terminal:
ddev pull platform. After you agree to the prompt, the current upstream databases and files will be downloaded.
- Optionally use
ddev push platformto push local files and database to Platform.sh. The
ddev pushcommand can potentially damage your production site, so we don’t recommend using it.
Managing Multiple Databases¶
If your project has only one database, it will automatically be pulled into and pushed from DDEV’s
If your project has multiple databases, they’ll all be pulled into DDEV with their respective remote names. You can optionally designate a primary to use DDEV’s default
'db' database, which may be useful in some cases—particularly if you’ve been using the default solo-database behavior and happened to add another one to your project.
You can designate the primary database using the
PLATFORM_PRIMARY_RELATIONSHIP environment variable:
You can also do the same thing by running
ddev pull platform and using the
ddev pull platformwill connect to Platform.sh to download database and files. To skip downloading and importing either file or database assets, use the
- If you need to change the
platform.yamlrecipe, you can change it to suit your needs, but remember to remove the
#ddev-generatedline from the top of the file.