Keeping your online store secure and with fewer bugs is one of the top priorities of each merchant. That's why you want to have not only Magento up to date but also all third-party modules.

Updating extension is not a hard task but can be challenging if you perform it for the first time. If you are not a technical person, we always recommend to use a professional upgrading service by Magento Specialists. If you wish to update Magento 2 extension by yourself please follow steps bellow:

(In the guide, we update module Company_ModuleName).

1. Create a backup of your Magento 2 files and database.

2. Define using which method the extension has been originally installed.

If the extension files located in the folder vendor/company/module-name, then the extension was installed using the Composer and you need to use the Composer for the upgrade.

If you can find extension files in the folder app/code/Company/ModuleName, then the extension was installed manually using e.g. FTP/SFTP and you need to use FTP/SFTP to upgrade it.

Upgrade/Update Magento 2 Module Using The Composer

1. Open CLI (Command Line Interface)

2. Navigate to Magento 2 root folder.

3. Run the commands:

composer remove company/module-name
composer require company/module-name ^x.x.x
# replace x.x.x with the version you want to use
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy

Upgrade/Update Magento 2 Module Using FTP/SFTP

1. Download the latest extension archive.

2. Extract the files on your computer.

3. Using FTP/SFTP client upload new files to your server (replace all existing files if needed).

Note that if in an archive you can see "app" folder then "app" folder should be uploaded to the root folder of your Magento. If there is some other folders and files e.g: "registration.php", "etc", "Model", "Plugin", "Block", then upload all these files and folders to app/code/Company/ModuleName.

Update Magento 2 extension via FTP

4. Open CLI (Command Line Interface)

5. Navigate to Magento 2 root folder.

6. Run the commands:

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy

 

FAQ:

1. What is PHP Composer?

It's the package manager for the PHP, it allows you to manage dependencies of Magento2 extensions and PHP libraries. It also facilitates the upgrade process.

2. Does the Composer package exist for the extension?

If you use Magefan extension, then answer is YES. You can install and update any Magefan extension via Composer. Please contact extension vendor to find out if their extension can be installed/updated via the Composer.

 3. What to do if I get error "Module 'Company_Module' from 'app/code/Company/Module' has been already defined in 'vendor/company/module'." ?

  Please check this article.

Do you have more questions? Please let us know in the comments below.