Magento – How to upgrade magento2 theme

magento2themeupgrade

I wants to update magento2 theme.

  • What is standard way to do this or just override files?
  • It's same as magento 1.9?
  • Whats care should be taken before and after upgrading?

Best Answer

I don't know exactly, what you want to do, so I'll try to guess. If it's not what you're asking about, please clarify your question.


Update an existing theme

If you did correct errors in the theme and you want to go live with the patched version.

  1. Just override the files in app/design/frontend/[Theme Author/Vendor]/[Theme Name].

  2. Tell Magento about the new files. This depends on your mode and cache settings:

    • Development mode: If your Magento cache is disabled, you don't have to do anything and the changes should be live instantly.

      Otherwise, you have to clear all (affected) caches either via administration panel or with Magento CLI command ./magento cache:clean.

    • Production Mode: You only have to run ./magento deploy:mode:set production to set Magento into temporary maintenance, deploy all files, clear caches and reactivate production mode afterwards.
  3. Profit!

Edit an existing theme

If you want to have some corrections on an already existing theme.

  1. Create new folders in app/design/frontend, so that you have app/design/frontend/[Your Name]/[Theme Name]
  2. Create barebone theme: See official Magento docs on creating a new frontend theme
  3. Tell Magento, which theme you want to override: See official Magento docs on theme inheritance
  4. Instead of overriding files in existing theme, just create/copy them with the same directory structure within your theme and apply the changes (you only have to copy the files you want to change).
  5. Tell Magento to use the new theme: See official Magento docs on applying a new theme
  6. Profit!

As this is a very short guide on adding a new theme, please read the documentation linked above with all linked documents (the ones in the left sidebar, too) to understand Magento theming correctly.

Note: Magento CLI

You have to run all commands as your Magento file system owner! Otherwise, Magento won't/can't use them.

Related Topic