Upgrade a git-based installation

This topic discusses how a contributing developer can update Adobe Commerce without reinstalling it. If you are not a contributing developer, see Perform an upgrade.

To upgrade if you are a contributing developer:

  1. Log in to your server.

  2. Switch to the file system owner.

  3. Change to the directory where you cloned the application. For example,

    code language-bash
    cd /var/www/magento2
    
  4. Save any changes you made to the composer.json file because the next steps overwrite it.

  5. Create a backup of your composer.json file.

    code language-bash
    cp composer.json composer.json.old
    
  6. Update your local repository to get the latest code:

    code language-bash
    git pull origin develop
    
    note note
    NOTE
    If git pull origin develop fails, see troubleshooting.
  7. Diff and merge your composer.json.old file with the composer.json file.

  8. Resolve dependencies and write exact versions to the composer.lock file.

    code language-bash
    composer update
    
  9. Update the database:

    code language-bash
    bin/magento setup:upgrade
    
  10. Clean the cache:

    code language-bash
    bin/magento cache:clean
    
recommendation-more-help
83a60e0e-8849-4685-a8cd-c129ecd795ea