pixel code
whatsApp Chat with us on WhatsApp
How to Restore a Product Attribute Deleted in Magento E-Commerce

by  David Dwyer on  15/05/2015

Introduction: About this Tutorial
Part of learning how to use a sophisticated e-commerce solution, involves making mistakes. As even the most experienced developer or webmaster can make mistakes we thought it worthwhile to consider which mistakes could cause the most harm and frustration. Hence we’ve pulled together this Magneto Troubleshooting Tutorial to cover the steps to take if you (Ed: or one of your junior colleagues) mistakenly delete an attribute set for your products in Magneto e-Commerce. 

While this scenario may seem unlikely, we've encountered multiple instances when a client comes to us for help after unknowingly deleting product attributes. 

What you may not know though is that there is a safety net and the good news is that Magneto e-Commerce stores your product attribute values even if the attribute was deleted from the current attribute set. The solution, laid out below, can help you get your magneto e-Commerce store back up and running smoothly. 

Not sure how to tackle this yourself? Inspire IT Services can help via our Developer SOS service (Ed: bit like the A-Team in that if no-one else is available to help, then we can).

Understand how attributes, data, and values are stored
Basically, if you don’t know in which table to look, the mistake of deleting an attribute can (and does) cause a huge headache. 

We’ve found that when you delete an attribute in Magento, all data associated with that attribute will be erased. Additionally, the values of each product for that attribute could also be erased.

To restore this information, you’ll need to explore the specific tables of the Magento database, which are listed below. 

Magento includes a system of customisable attributes for specific system “entities.” These entities are the categories, the clients, the products, and so on. For example a pen (Entity) might have blue ink (Attribute), or an Phone (Entity) might be an iPhone (Attribute) or Android (attribute) with Memory 16Gb (Attribute) or 32Gb (Attribute), etc. In essence Attributes explain/describe more about the Entity.

Within the administration, Magento allows you to add attributes for your products e.g. Collar Sizes (14”, 15”, 16”, 17”, 17.5”, 18”, 18.5”…) of a Shirt . If you want to add attributes for the other entities (such as clients or categories), you will need to install a module for that. We found several options you can install at Magento Connect, Magento's original marketplace for extensions that expand functionality of an e-Commerce site.

The configuration of attributes and their values are stored in various tables of the Magento database. This tool gives us great power in case we mistakenly delete an attribute. Otherwise, this mistake - deleting an attribute - can cause a huge headache.

Review the Magento database tables

Tables in Magento are:


Make a Copy of the Database

To restore your attribute, you must make a copy of the database. You will load it into a test database to find where your attribute appears.

To obtain which attribute that was deleted, we can compare the tables "eav_attribute" of the two databases, and the registry of the Magento backup. 

Restore the Current Database

Once the missing data is found, restoring the current database is your goal.

Once the "attribute_id" of the deleted attribute is identified, compare each of the tables by filtering by the attribute "attribute_id". Then, export these results and put them in the current Magento database.

For example, if your deleted attribute were “118," for the first table you would execute the following query.

select * from eav_attribute where attribute_id = 118

Tables such as "catalog_product_entity_datetime", "catalog_product_entity_int" and others contain the values for each product. It may be that when you are transferring them the system issues failures, because some products have already been deleted. 

In addition, for an attribute, only one of these tables has values associated with it, depending on the type of data it is. For example, if it is an integer type attribute, only the "catalog_product_entity_int" table will have values.

Once finished, you must update the indexes from the Magento administration panel. See “Update Magento indexes.”

Common Concerns in Magento
While Magento offers the benefits of an incredibly popular and robust sales platform, developers and web admins need to know how to fix some common errors when troubleshooting in Magento. A host of issues can ruin your customer’s online experience with your brand unless you know how to quickly resolve them. 

Frequently voiced concerns in Magento include how to: 

•    Reset Magento admin passwords
•    Speed up your Magento site (this is a massive issue as Magento is very server grunt intensive for your which when not properly resourced leads to frustration, in terms of fuel consumption consider it like an Aston Martin versus a bycycle)
•    Configure Magento with a new domain
•    Enable Search Engine Friendly URLs in Magento
•    Solve 'Access Denied' issues
•    Manage Magento site redirects
•    Redirect Magento to open through www
•    Disable 'compare products' functionality in your Magento store
•    Set up your Magento site blog
•    Set up Magento Custom User Groups
•    Activate multiple shopping cart rules for a single coupon
•    Switch off an extension quickly
•    Fix non-functional shopping cart rules
•    Stop Magento from logging you out too soon
•    Update categories that aren't registering on your front-end 
•    Change your Magento Admin URL
•    Disable Magento admin notifications
•    Disable the Compare products functionality
•    Resolve incorrect 503 error messages
•    Deleting the '.html' in your Magento URLs
•    Create 301 redirects for your Magento store
•    Set up a blog in Magento
•    Add a 'Contact Us' form in Magento
•    Create a Custom Users Group

We can advise on all of these topics, and more. 

Summary of Inspire IT Services

At Inspire IT Services, we create striking, high-impact e-Commerce websites.

Inspire’s highly experienced software engineers often work with the highly popular Magento platform. We can explore development and data restoration for a variety of e-Commerce platforms, including Magento, to ensure your web platform operates smoothly. 
If you have questions about Magento, e-Commerce websites, or your own online store, please contact us as soon as possible.  We would love to help you troubleshoot the problem, find a solution, and set your business up for success. 

e-commerce, Magento 1.9.x, Magento 2.x.x, Magento e-commerce, Online Stores
First Name
Last Name
How can we help?
To comply with data protection regulations (2018), we are unable to store and use your information unless you give us your permission. Please select Yes to allow this. View our data protection policy for details.
To comply with data protection regulations (2018), we are unable to store and use your information unless you give us your permission. Please select Yes to allow this. View our data protection policy for details.