Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Restoring Newer Records To An Older Version Of Database Rate Topic   - - - - -

 
  • janskor
  • Member
  • Members
  • Join Date: 13-Jun 13
  • 24 posts

Posted 03 May 2014 - 05:14 PM #1

Admin-ing a multi-vendor system, and found vendors will still adding products to a category no longer in use, even though it was hidden. So from the categories set-up page, we deleted the category.

Little did we know this will also delete the underlying products! Even products that belong to other categories. Gone, and their product shots too.

We didn't catch it for a few hours, so in the meantime we had other new records added to the database and file system.

Now we're restoring from our last backup, and trying to figure out how to restore the additions made since the category deletion.

Is there a process for restoring new records to an older version of the database? Doing a diff on the tables is not straightforward because of the way the database repurposes deleted records.

CS-Cart definitely needs to add some kind of warning dialog to the delete categories command!

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11428 posts

Posted 03 May 2014 - 08:44 PM #2

It should only delete the product if that is the last reference to that product_id from ANY category.
I think you wanted 'Disabled' rather than 'Hidden' for your defunct categories.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19846 posts

Posted 05 May 2014 - 06:49 AM #3

It should only delete the product if that is the last reference to that product_id from ANY category.
I think you wanted 'Disabled' rather than 'Hidden' for your defunct categories.


Possibly the hidden category was defined as main for the products and active categories were defined as additional.

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11428 posts

Posted 05 May 2014 - 08:19 PM #4

I believe a product will not be deleted unless it is the last reference of all categories regardless of their status.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19846 posts

Posted 06 May 2014 - 07:13 AM #5

I believe a product will not be deleted unless it is the last reference of all categories regardless of their status.


Please check the fn_delete_category function. It does not take into account if product belongs to additional category.

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11428 posts

Posted 06 May 2014 - 06:11 PM #6

That's a new way of doing things. From what I read, if the product has the deleted category as the main category then it will delete the product. To me, that's a bug. In older versions it was by last reference and I think that's how it should be.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19846 posts

Posted 07 May 2014 - 07:08 AM #7

That's a new way of doing things. From what I read, if the product has the deleted category as the main category then it will delete the product. To me, that's a bug. In older versions it was by last reference and I think that's how it should be.


Checked in 2.0.x, 2.1.x, 2.2.x and 3.0x - the same behavior. Anyway, we are totally agree with you - that's a bug.

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.