Platform.sh User Documentation

Transfer data to and from a Dedicated Gen 2 cluster

Try for 30 days
Flexible, version-controlled infrastructure provisioning and development-to-production workflows
Activate your trial

Transferring data to and from a Dedicated Gen 2 cluster slightly differs from the process on the Grid.

Back up your files Anchor to this heading

Platform.sh automatically creates backups of the Staging and Production environments of a Dedicated Gen 2 cluster every six hours. These are only useful to fully restore an environment and are managed by the support team.

You can make a manual local backup yourself by downloading data from your environment to your local system by running the following command:

platform scp -r remote:DIRECTORY_TO_SYNCHRONIZE LOCAL_DIRECTORY

This command copies all files from the DIRECTORY_TO_SYNCHRONIZE in the environment you want to back up to your LOCAL_DIRECTORY. Before running the command, make sure that you don’t overwrite local data (or do a backup first).

Back up your database Anchor to this heading

To back up your database, adapt and run the following command on your local computer:

platform db:dump --gzip 

For more backup options and examples, see how to export data from an SQL database.

Synchronize files from Development to Staging/Production Anchor to this heading

To transfer data into either the Staging or Production environment, download data from your Development environment to your local system and from there to your Production/Staging environment.

  1. To download data from your Development environment to your local system, adapt the following command:

    platform scp --environment DEVELOPMENT_ENVIRONMENT -r remote:DIRECTORY_TO_SYNCHRONIZE LOCAL_DIRECTORY
  2. To copy the local directory to the remote Staging/Production mount, adapt the following command:

    platform scp --environment TARGET_ENVIRONMENT -r LOCAL_DIRECTORY remote:DIRECTORY_TO_SYNCHRONIZE

Synchronize a database from Development to Staging/Production Anchor to this heading

To synchronize a database into either the Staging or Production environment, export the database from your Development environment to your local system and from there to your Staging/Production environment.

To synchronize your database:

  1. Export the Development database to your local computer:

    platform db:dump --environment DEVELOPMENT_ENVIRONMENT --file=dump.sql

    For more backup options and examples, see how to export data from an SQL database.

  2. Import the Development database dump file into the remote Staging/Production database:

    platform sql --environment TARGET_ENVIRONMENT < dump.sql

What’s next? Anchor to this heading

For more granular connection options, see SSH connection details.

Is this page helpful?