Step 2, Clone the project

To clone the project’s master environment:

  1. Log in to your local development machine as, or switch to, the Magento file system owner.
  2. Change to the web server or virtual host docroot.
  3. Log in to your project:

    magento-cloud login
    
  4. List your projects:

    magento-cloud project:list
    
  5. Clone a project.

    magento-cloud project:get <project ID>
    

    When prompted for a directory name, enter magento2.

  6. Change to the project directory.

    For example, cd magento2

  7. List environments in the project:

    magento-cloud environment:list
    

    magento-cloud environment:list displays environment hierarchies whereas git branch displays does not. If you have any nested environments, use magento-cloud environment:list.

  8. Fetch origin branches:

    git fetch origin
    
  9. Pull updated code:

    git pull origin <environment ID>
    

Change the Magento Admin URL, user name, and password

This section discusses how to change Magento Admin parameters for security reasons. If you change the variables in the master branch, you have to do it only once because other environments inherit the variables from master.

If your master branch is already configured, skip this section and continue with Step 3: Clone or branch an environment.

If you’re not sure whether or not the master branch has been configured, enter the following command:

	magento-cloud variable:get -e <environment ID>
  1. Set the variable values.

    magento-cloud variable:set <name> <value> -e <environment ID>
    
  2. To set the administrator’s user name to meister_x2U8 in the master environment, enter:

    magento-cloud variable:set ADMIN_USERNAME meister_x2U8 -e master
    
  3. Wait for the project to redeploy.
  4. To set the administrator’s password to admin_A456, enter:

    magento-cloud variable:set ADMIN_PASSWORD admin_A456 -e master
    
  5. Wait while the project redeploys.
  6. To set the Admin URI to magento_A8v10, enter:

    magento-cloud variable:set ADMIN_URL magento_A8v10 -e master
    
  7. Wait while the project redeploys.
  8. Log in to the Magento Admin using the values you just changed.

    The simplest way to do that is to use the environment routes that display when you redeploy the master branch. An example follows:

    Waiting for the activity ksvciptnzxfto (Steve Johnson added variable ADMIN_URL):
        Building application 'mymagento' (runtime type: php:7.0, tree: 07263ba)
        Slug already built for this tree id, skipping.
    
        Re-deploying environment k4wtvm7ogzr5s-master.
        Environment configuration:
            mymagento (type: php:7.0, size: S, disk: 2048)
            mysql (type: mysql:10.0, size: S, disk: 2048)
            redis (type: redis:3.0, size: S)
            solr (type: solr:4.10, size: S, disk: 1024)
    
        Environment routes:
            http://master-k4wtvm7ogzr5s.us.magentosite.cloud/ is served by application `mymagento`
            https://master-k4wtvm7ogzr5s.us.magentosite.cloud/ is served by application `mymagento`
    
    In the preceding example, go to `http://master-k4wtvm7ogzr5s.us.magentosite.cloud/magento_A8v10` and log in using the user name `meister_x2U8` and password `admin_A456`
    	
    
  9. Take a snapshot of the master branch:

    magento-cloud snapshot:create -e master
    

Next step

Step 3, Set up cron