cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Admin Deleted "Base store" from a system "accidentally"

beastyisnt
Participant
0 Kudos
628

Admin Deleted "Base store" from a system "accidentally" What steps do we need to do to restore the storefront?

Any thoughts on what you would do if someone deleted your "Base store"?

1. Re-create "Base Store"

2. Associate orders to new "Base Store"

? Your thoughts?

Accepted Solutions (1)

Accepted Solutions (1)

mansurarisoy
Contributor

This is very unfortunate. We had the similar issue but luckily there was a backup so we were able to create BaseStore easily, and check the data if it's the same as previous version.

What I can give you as an advice would be:

  • Create BaseStore with an ImpEx (if you lucky you would have some ImpEx in your codebase)
  • Search for *-items.xml files in the project for type="BaseStore" this will give you all the attributes and relations for BaseStore type.
  • Check every item's table to see if there is a value on the column. Update the values via either SQL execution or ImpEx. Some tables should have values if they are not reached / queried from the table. Hybris do not use Foreign Keys, so deleting an item will not delete the values in a column (except many-to-many relations). orders and carts table would be one of them.
  • Unfortunately, hybris deletes many-to-many relations if one side is deleted. Having a backup is very helpful for relations, but if you have no backup you are on your own.

Hope this helps,

Good luck,

beastyisnt
Participant
0 Kudos

mansurarisoy, thank you. That was what our thought was as well... Took 12+ hours 🙂 but we got it done!!! Did you produce any other ways to backup "Configurations" for future proofing?

mansurarisoy
Contributor
0 Kudos

Hi beastyisnt, it took 3 hours for us even if we had the backup 🙂 I am happy to hear that you recovered the data.

Actually, we did not produce any solution yet for such scenarios. But what we have in mind is preventing deletion of such essential data (like BaseStore, BaseSite etc.).

Unfortunately it is not easy to design a backup for such "Configurations" since there can be many. But first thing that I can think of would be configuring periodic jobs to store some configuration as a Media file or in another database. Easiest way to achieve this (without any code development) would be ImpEx Export job. You can configure an ImpEx Export script and configure a Trigger (daily or weekly as you wish), then this job would produce Media (ImpEx Import script with CSV files) to be imported later on when needed. By doing so, you can easily modify the script when a change (new attribute) is made to configuration's model.

Answers (0)

Ask a Question
Top Q&A Solution Author