Magento in version 2.1 and 2.2 is a stable and reliable e-commerce platform, which offers an enormous amount of solutions and possibilities to customers. Unfortunately, like any technology, it is not free from mistakes. In a few paragraphs below I will present to you what happened to one of our clients and how we helped them.
Everything began with a bit panicking email from an overseas client received at the early morning hours, saying that:
“The entire catalog of products has vanished! Both on the front and back end, there are no products online (…) Really need some urgent help!”
Which, as we checked, unfortunately, happened to be true.
As the first action, we contacted the admins immediately and asked them to check for backups. In the meantime, we had copied all the orders from the recently emptied database. It was a very important step – as we got to know afterward the backup base had not all the orders. Some of them had been made in the time period between the moment of deletion and hour of backup taken.
With the news that the backup database is ready on the Amazon Web Service server, we could change the adequate setting in the configuration to connect Magento store to the backup version. The broken one was disconnected, and the one which still had all the products and categories come back from death. There was still a mismatch in orders, but with a copy of the newest one, we were safe. The solution was not so complicated – manually adding a couple of them, so the store was back on their feet and running smoothly. The whole process took just a couple of hours.
What was left? – find a reason what caused such a grave error and got a couple of grey hair to our client. Recreating the database for thousands of products with multiple attributes would not be a piece of cake.
We asked how do they got to know that the products are gone, and were informed that it happened during populating some categories. A deeper investigation and insight into logs showed that it happened due to mass delete action made from a computer matching the employee’s ones who was working with adding new products. Putting two and two together it resulted that it was Magento 2.1 fault. (If you are interested you can find some more information about the issue here).
While deleting some products and selecting “Delete” twice all products will be removed. It is not a really uncommon situation, that when selecting many products to be deleted, after confirmation with “OK”, waiting time for action is quite long. During that time you may start wonder: “Did I choose the correct button?” so you repeat action – still while Magento is running the previous action. Or you maybe had just gone to get a cup of coffee, coming back still seeing the process unfinished, you try again. Result: disaster! The bomb was dropped and all products are gone.
What is the solution for “mass action delete error”? Magento 2.3 introduced a fix for the erasing issue. Upgrading your website version will not only improve your security but also decrease potential errors in the code. Another option is to develop a custom patch for an error.
The second value lesson learned from that story is to always backup your database.
As I have mentioned in the opening paragraph every once in a while it occurs that some mistakes in the Magento core code exist. Pleased or not, we have to accept it and deal with them. Don’t worry though! Developers in Panda Group are here to help you!
1. Danger: db is gone! What to do?
2. Inform Panda Group developers about the problem.
We contact admins and restore a backup db, plus make sure that all orders are in the current db.
3. Find a cause. Prevent it from happening in the future.
4. Db is back on its place after a couple of hours, the store is functioning normally.