Optional - Install sample data

If you need some example data when developing your store, you can install our sample data. This data simulates an active Adobe Commerce store including customers, products, and other data. This sample data works best with a new “blank site” Adobe Commerce on cloud infrastructure template installation when creating your project in your Integration environment.

We recommend installing sample data in your local Integration branches and environments. If you use this data in Staging or Production, you need to remove the information and products before going live.

Get started in a branch

We recommend working in a branch to add the sample data. The following information details how to set up a branch.

To get started with environment branches:

  1. On your local workstation, change to your Cloud project directory.

  2. Switch to the file system owner.

  3. Log in to your project.

    magento-cloud login
  4. List your projects.

    magento-cloud project:list
  5. List environments in the project. Every environment includes an active Git branch that contains your code, database, environment variables, configurations, and services.

    magento-cloud environment:list

    It is important to use the magento-cloud environment:list command because it displays environment hierarchies, whereas the git branch command does not.

  6. Fetch origin branches to get the latest code.

    git fetch origin
  7. Checkout, or switch to, a specific branch and environment.

    magento-cloud environment:checkout <environment-ID>

    Git commands only checkout the Git branch. The magento-cloud checkout command checks out the branch and switches to the active environment.

    You can create a new environment branch using the magento-cloud environment:branch <environment-name> <parent-environment-ID> command syntax. It may take some additional time to create and activate a new environment branch.

  8. Use the environment ID to pull any updated code to your local. This is not necessary if the environment branch is new.

    git pull origin <environment-ID>
  9. (Optional) Create a snapshot of the environment as a backup.

    magento-cloud snapshot:create -e <environment-ID>

Install sample data

To install sample data:

  1. If you have not done so already, check out the environment in which to install sample data.
  2. In a terminal, enter the following commands:

    <magento_root>/bin/magento sampledata:deploy
  3. Wait for components to update.
  4. Commit and push the changes:

    git add -A && git commit -m "Install sample data"
    git push origin <branch name>
  5. Wait for the project to deploy.
  6. Verify the installation was successful by going to your storefront main page in the Integration environment. You can locate the URL link to the storefront through the Project Web Interface.
  7. Take a snapshot of your environment:

    magento-cloud snapshot:create -e <environment ID>

You can start testing your development with live data!