the migration with data-migration-tool from older Magento to Magento 2.0.4 is completed.

But after migration I get the error in frontend:

Unable to load theme by specified key: 'themename'

This is a very strange error because the theme 'themename' doesn't exist.

The database table theme doesn't show this mysterious theme. The same in adminarea Content -> Themes. And I choose another theme in Configuration -> General -> Design. And the theme doesn't exist in app/design folder.

So from where is this theme coming? Perhaps a theme from older Magento I migrated? If so...how can I delete this old theme and solve this error?

I deleted the caches and var folder, generated the static files, compiled di.xml, set permissions. Nothing helps.

Additional adminarea doesn't load any css.

  • are you on a unix/linux system? Since it is not in your db theme table, you could try to search for it in your magento root dir with the following command: 'grep -r themename .' Apr 26, 2016 at 17:24

6 Answers 6


Thanks for your help.

I found 'themename' in database table design_change and delete the table content.

  • 3
    my database table design_change is already empty but still getting this issue Dec 5, 2018 at 8:35

To fix this I used:

SELECT * FROM `core_config_data` WHERE `path` LIKE '%theme_id%'

and then deleted my custom theme records.

I also had to empty the Magento var/cache directory.


Actually I tried that the problem was my old theme wasn't there anymore and I wasn't going to use it anymore cause it wasn't compatible with magento 2.. So there was a entry somewhere saying to go to my old theme and it was locked.. changing the theme in magento admin did nothing.. I tried it many times. user39120 gave me the hint of what to do.. While I didn't find it in design_change like he said. I was moving in the right direction. I will give a quick summary of what I did to help anyone with the same issue.

  1. Open phpmyadmin
  2. export your database to a xml file.
  3. if you database is big most text readers will not load it or will be painfully slow.. I ended up downloading glogg which worked really great.
  4. Search for your old theme name. in my case I searched "(OldThemeName)/default" 5 It will list all points on where it found the word string. just scroll up to find out which table it is located in. in my case it was in two tables.. Core_page and cms_page. In core page it was just referencing titles of widgets. Left those alone.. But in the cms_page I found two entries.. edited each one and deleted the (OldThemeName)/default from each one and saved. Went to my webpage and behold my pages loaded with my new theme.. issue resolved.. Big thanks to user39120 for putting me on the right path. Now I just got to rework the new theme.. that make take some time.
  • In my situation, the category page show this error: Unable to load theme by specified key: '5', which tables can I check this theme_id?
    – huykon225
    Feb 24, 2021 at 15:18

I know this is an old thread, but I found it and thought others might also.

user39120 gave a correct answer, but the same can be accomplished using the Admin interface, which is less prone to error than mucking around in the database.

In the Admin, go to Content=>Design Schedule and you'll see a number of rows. Open each row and click the DELETE button.

Now go to Content=>Configuration and and ensure that the "Theme Name" for each row is a valid theme for your implementation.

Flush the cache.

  • Best answer! +1
    – Akif
    Jun 24, 2021 at 13:40

In data migration from magento 1 to magento 2. Theme are not migrate because theme structure in magento 2 are very differnt from magento1.

Error availability because of your old theme not found in magento 2.

All data includes customer, order,Category and products are migrated from magento1 to magento 2.

You have to create your own theme inside app/design/{Packagename}/{theme} and you have to create your own theme.

you can start theme development using magento docs document, Theme Development

By default, After migration complete you have to set default theme using Admin

Stores -> Configuration -> General -> Design Tab

and set Luma theme to check frontend functionality.

Remove var folder and check again.


I had the same issue after migrating from Magento 1.7.02 to 2.1.1. My solution is to look in the core_config_data Table for the path "design/theme/theme_id". There you can find the name of the "wrong" migrated theme name.

  • After migration i also found a reference to an old theme in the table catalog_category_entity_varcher. After deleting all the records. The error was gone !
    – Cenzo
    Sep 1, 2016 at 7:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.