Edit in GitHubLog an issue

Change to a released version

This topic discusses how a contributing developer can change versions of Magento Open Source after cloning the develop branch. This might be necessary to perform some tasks that require a specific version other than develop.

The develop branch is the default branch, which means you get it by default when you clone the Magento Open Source GitHub repository. For some tasks, such as data migration from version 1.x to 2.x, you must switch to a release tag.

You have the following options:

  • (Easier). If you have not done any customizations, you should uninstall Magento Open Source and reinstall it with the released version. Uninstalling not only drops the database tables, it also clears the var directory, enabling you to start over with no issues.

    For more information, see Change versions by uninstalling the software

  • If you have done customizations and do not want to lose them, back up the system, switch to the released branch, and install in a new database instance.

    For more information, see Change versions by installing the software in a new database instance

    You can migrate your customizations (both in the file system and in the database) from the backups you made or directly using database and file system tools.

Change versions by uninstalling the software

To change versions after cloning:

  1. Log in to your web server as, or switch to, the file system owner.

  2. Use the following command to uninstall the Magento Open Source software:

    Copied to your clipboard
    php <your Magento clone dir>/bin/magento setup:uninstall
  3. Either remove your old Magento clone directory or update the software.

  4. If you have not already done so, clone the Magento 2 GitHub repository as follows:

    Copied to your clipboard
    git clone git@github.com:magento/magento2.git
  5. Change to release tag as follows:

    Copied to your clipboard
    git checkout tags/<tag name> [-b <branch name>]

    For example, to check out the 2.2.0 release tag in a new branch named 2.2.0, enter

    Copied to your clipboard
    git checkout tags/2.2.0 -b 2.2.0
  6. Install the Magento Open Source software using the command line.

Change versions by installing the software in a new database instance

To change versions after cloning:

  1. Log in to your Magento server as, or switch to, the file system owner.

  2. Create a new database instance for your installation.

  3. Back up the Magento file system, database, and media files:

    Copied to your clipboard
    php <magento_root>/bin/magento setup:backup --code --media --db
  4. Change to release tag as follows:

    Copied to your clipboard
    git checkout tags/<tag name> [-b <branch name>]

    For example, to check out the 2.2.0 release tag in a new branch named 2.2.0, enter

    Copied to your clipboard
    git checkout tags/2.2.0 -b 2.2.0
  5. Manually clear Magento var directories:

    Copied to your clipboard
    rm -rf <magento_root>/var/cache/* <magento_root>/var/page_cache/* <magento_root>/generated/code/*
  6. Install the Magento software in your new database instance.

    You must install using the command line.

  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.