Jump to content



Photo
- - - - -

Database Check Tool


  • Please log in to reply
18 replies to this topic

#1   azer

azer
  • Members
  • 842 posts
  • Real Name:azer
  • Location:Paris, france

Posted 16 June 2009 - 14:18

http://addons.oscommerce.com/info/5962

This contribution will check your database for duplicate product names, products price $0, products no weight, duplicate products_to_categories, categories no products and more. Results have clickable buttons and links to delete records or edit them through categories.php in admin. Minimum file editing for easy install. Please see the readme file for installation instructions and additional notes. Enjoy! :)


it s defintly a usefull report tools since you can monitor some important catalog problems within our site

let's share and improve this tool

thanks to geoffreywalton and ohioman
MS2

#2   azer

azer
  • Members
  • 842 posts
  • Real Name:azer
  • Location:Paris, france

Posted 16 June 2009 - 14:23

I will do here a list of improvement i think we could work out :

REQ : Being able to update or change directly in the listing the field like with the contribution quick price update
BUG : Products with duplicate titles
i dont know why but i got several time the same product with the same model numer (id) so it s not a duplicate

like here :

70 1000-90-50 D-Squared2 - Chemise à M. L. - Multi 2006-03-05 20:55:04 D-Squared2 Click to delete record
71 1000-90-49 D-Squared2 - Chemise à M. L. - Multi 2006-03-05 20:55:05 D-Squared2 Click to delete record
70 1000-90-50 D-Squared2 - Chemise à M. L. - Multi 2006-03-05 20:55:04 D-Squared2 Click to delete record
71 1000-90-49 D-Squared2 - Chemise à M. L. - Multi 2006-03-05 20:55:05 D-Squared2 Click to delete record


MS2

#3   gameserv

gameserv
  • Members
  • 1 posts
  • Real Name:Janusz
  • Gender:Male

Posted 10 October 2011 - 10:02

Hello thanks for your contribution is very good.

But such a module is missing here that would make the order in my database if it can be embedded in it?
After removing the old card I have free product number in the database which is bypassed and add new card numbers, whether it is possible to add these new products of deleted numbers

#4   geoffreywalton

geoffreywalton

    OSC Aficionado

  • Members
  • 8,252 posts
  • Real Name:Geoffrey Walton
  • Gender:Male
  • Location:Norfolk, UK (close to the centre of the universe)

Posted 21 June 2014 - 10:59

New version released for v 2.3.4.

Have just read above posts and see duplicate product description chck does not cater for multi-language shops.

 

Cheers

 

G


Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

Virus Threat Scanner
My Contributions
Basic install answers.
Click here for Contributions / Add Ons.
UK your site.
Site Move.
Basic design info.

For links mentioned in old answers that are no longer here follow this link Useful Threads.

If this post was useful, click the Like This button over there ======>>>>>.

#5   geoffreywalton

geoffreywalton

    OSC Aficionado

  • Members
  • 8,252 posts
  • Real Name:Geoffrey Walton
  • Gender:Male
  • Location:Norfolk, UK (close to the centre of the universe)

Posted 21 June 2014 - 11:27

Release 1.5 sorts above.

 

HTH

 

G


Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

Virus Threat Scanner
My Contributions
Basic install answers.
Click here for Contributions / Add Ons.
UK your site.
Site Move.
Basic design info.

For links mentioned in old answers that are no longer here follow this link Useful Threads.

If this post was useful, click the Like This button over there ======>>>>>.

#6   chilinotes

chilinotes
  • Members
  • 31 posts
  • Real Name:Oliver
  • Gender:Male
  • Location:Frankfurt / Main, Germany

Posted 23 June 2014 - 13:22

Hi,

 

a really usefull contrib. Thank you very much.

 

Is it possible to ignore title-duplicates in different languages?

 

Thank you

Ollie


Sometimes systems that should not work, work nevertheless.


#7   14steve14

14steve14
  • Members
  • 3,787 posts
  • Real Name:Steve
  • Gender:Male
  • Location:Dorset UK

Posted 01 November 2014 - 08:45

@geoffreywalton

 

In the latest version I just noticed that there was a language define error and the manufacturers name title is not shown correctly. Maybe the package needs updating.

 

In the langauge file there is

 

define('HEADING_ACTION_MANUFACTURERS_NAME', 'Manufacturer');

 

but in the includes/function/dbcheck.php there 5 instances of

 

<td align="center" class="dataTableHeadingRow"><?php echo HEADING_ACTION_MANUFACTURER;?></td>

 

I changed the above to

 

<td align="center" class="dataTableHeadingRow"><?php echo HEADING_ACTION_MANUFACTURERS_NAME;?></td>

 

which matches the define in the language file.

 

 

By the way this is a gret addon and very helpfull. Thanks


REMEMBER BACKUP, BACKUP AND BACKUP

Whenever you feel sad, just remember that somewhere in this world there is an idiot pulling a door that says push.


#8   geoffreywalton

geoffreywalton

    OSC Aficionado

  • Members
  • 8,252 posts
  • Real Name:Geoffrey Walton
  • Gender:Male
  • Location:Norfolk, UK (close to the centre of the universe)

Posted 01 November 2014 - 16:10

define('HEADING_ACTION_MANUFACTURERS_NAME', 'Manufacturer');


Thanks for pointing that out.

I change the above to agree with the 5 so it now reads

define('HEADING_ACTION_MANUFACTURER', 'Manufacturer');

Version 1.7 uploaded.

Cheers

G
Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

Virus Threat Scanner
My Contributions
Basic install answers.
Click here for Contributions / Add Ons.
UK your site.
Site Move.
Basic design info.

For links mentioned in old answers that are no longer here follow this link Useful Threads.

If this post was useful, click the Like This button over there ======>>>>>.

#9   Mort-lemur

Mort-lemur
  • Members
  • 2,259 posts
  • Real Name:Heather
  • Gender:Female
  • Location:UK

Posted 03 November 2014 - 20:13

@geoffreywalton Great mod - thanks for uploading and supporting.

 

You mention in the install instructions that suggestions for expansion are gratefully accepted, well to make this tool a complete database check / cleaning tool it would be nice to see the following database features:

 

1) ability to identify and delete inactive customers - ones who have not visited the shop in a set period of time - time period selectable

2) ability to identify and delete orders at pending status over a certain age

3) ability to check integrity of orders - that all the data fields are filled as they should be (sometimes orders become corrupted especially after editing)

4) ability to clear sessions

 

Just some suggestions.........


Now running on a fully modded 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.


#10   geoffreywalton

geoffreywalton

    OSC Aficionado

  • Members
  • 8,252 posts
  • Real Name:Geoffrey Walton
  • Gender:Male
  • Location:Norfolk, UK (close to the centre of the universe)

Posted 03 November 2014 - 21:10

Thanks for coming up with suggestions.

The add-on is really to identify and repair inconsistent data rather than housekeeping.

1) ability to identify and delete inactive customers - ones who have not visited the shop in a set period of time - time period selectable
2) ability to identify and delete orders at pending status over a certain age
4) ability to clear sessions


1, 2 & 4 look like housekeeping and I am pretty sure I put clearing session in the db clear add-on.

3) ability to check integrity of orders - that all the data fields are filled as they should be (sometimes orders become corrupted especially after editing)


This one looks like fun, There are an awful lot of possible corruptions covered by "that all the data fields are filled as they should be".

If you are editing the db directly there are a multitude of possible errors you can make but if you are editng orders via a script/program if it corrupts an order then it would be better to corect that script rather than write a new one.

Cheers

G
Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

Virus Threat Scanner
My Contributions
Basic install answers.
Click here for Contributions / Add Ons.
UK your site.
Site Move.
Basic design info.

For links mentioned in old answers that are no longer here follow this link Useful Threads.

If this post was useful, click the Like This button over there ======>>>>>.

#11   discxpress

discxpress
  • Members
  • 462 posts
  • Real Name:Lecarl Butler
  • Gender:Male

Posted 31 January 2015 - 18:28

Hello,

 

I use this addon for version 2.3.4.  I have over 5000 products with duplicate names. It's tedious to delete them one by one so what's the SQL syntax to accomplish the same task in phpmyadmin?

 

Thanks in advance. 



#12   discxpress

discxpress
  • Members
  • 462 posts
  • Real Name:Lecarl Butler
  • Gender:Male

Posted 02 February 2015 - 15:17

@geoffreywalton

 

My shop version is 2.3.4 BS. I was trying to delete over 5000 occurrences of duplicate product names. It would be tedious to delete them one by one. Can you suggest an SQL statement that will find and list duplicate product names in phpmyadmin that will accomplish this?

 

Thanks for your time and assistance



#13   geoffreywalton

geoffreywalton

    OSC Aficionado

  • Members
  • 8,252 posts
  • Real Name:Geoffrey Walton
  • Gender:Male
  • Location:Norfolk, UK (close to the centre of the universe)

Posted 02 February 2015 - 21:26

Google

mysql how to delete duplicates

There are several solutions there.

HTH

G
Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

Virus Threat Scanner
My Contributions
Basic install answers.
Click here for Contributions / Add Ons.
UK your site.
Site Move.
Basic design info.

For links mentioned in old answers that are no longer here follow this link Useful Threads.

If this post was useful, click the Like This button over there ======>>>>>.

#14   14steve14

14steve14
  • Members
  • 3,787 posts
  • Real Name:Steve
  • Gender:Male
  • Location:Dorset UK

Posted 23 June 2015 - 08:34

I have just found that I have several products that have identical model numbers.

 

Using

SELECT products_model, COUNT(*) as count
FROM products
GROUP BY products_model
HAVING COUNT(*) > 1
 
I have found the matching products and model number in the database..
 
It may be good to add something like this in this module to improve it further. I have looked at the code in admin/includes/functions/dbcheck.php but I got lost straight away and adding it in is beyond my skills.
 
Others may benefit from having it added.

REMEMBER BACKUP, BACKUP AND BACKUP

Whenever you feel sad, just remember that somewhere in this world there is an idiot pulling a door that says push.


#15 ONLINE   clustersolutions

clustersolutions
  • Members
  • 296 posts
  • Real Name:Tim

Posted 24 June 2015 - 16:49

@Steve, I think there are instances where some store may have duplicated products_model number. For example, a product model would have multiple colors and since there wasn't a sku field so we had treated the products_id as the sku. Well, I haven't checkout the new product variant, but it may solve that problem. We had our own PV hack to simplify things...

 

So may be this isn't something that would be beneficial in the dbcheck.php...now, if you know for sure that you don't want duplicate products_model and this would be a more proactive approach...

 

              CREATE UNIQUE INDEX id_prod_model_uindex ON products(products_model) USING BTREE;

 

To remove unique index...

 

              DROP INDEX id_prod_model_uindex ON products;

 

Oh, you should also drop any existing product model index...to show products indexes...

 

              SHOW INDEX FROM products;

 

Remove index for products_model...

 

              DROP INDEX idx_products_model ON products;

 

then you can build the unique index to prevent duplicate products model...



#16   14steve14

14steve14
  • Members
  • 3,787 posts
  • Real Name:Steve
  • Gender:Male
  • Location:Dorset UK

Posted 24 June 2015 - 17:33

I thought I would just mention something as it may be something that others could find useful and beneficial. The code though was a bit above me.

 

I found my duplicates by working in the database and altered some so there were none. I am also looking into finding a bit of code or something that will check for duplicates when entering the model number in all new products, but that will happen when I get round to updating my store in the very near future.


REMEMBER BACKUP, BACKUP AND BACKUP

Whenever you feel sad, just remember that somewhere in this world there is an idiot pulling a door that says push.


#17 ONLINE   clustersolutions

clustersolutions
  • Members
  • 296 posts
  • Real Name:Tim

Posted 25 June 2015 - 18:18

@14steve14...I get you it's good to be helpful...good karma.

 

https://github.com/c...d833c2724a72c79

 

U can apply the changes I made to v1.8 form the commit above. I don't use this tool as I try to be proactive about things...about the unique index...it may be problematic for the non-technical as things are not transactional in OSC and no rollbacks so it can break some logic...

 

LMK if there are bugs...


Edited by clustersolutions, 25 June 2015 - 18:19.


#18   14steve14

14steve14
  • Members
  • 3,787 posts
  • Real Name:Steve
  • Gender:Male
  • Location:Dorset UK

Posted 26 June 2015 - 08:12

@clustersolutions

 

Whilst I was not implying that something should be done straight away, many thanks for that. Looking at the code you added I would have certainly messed it up, but seeing what you have done has helped me understand it a bit better. Again thanks


REMEMBER BACKUP, BACKUP AND BACKUP

Whenever you feel sad, just remember that somewhere in this world there is an idiot pulling a door that says push.


#19 ONLINE   clustersolutions

clustersolutions
  • Members
  • 296 posts
  • Real Name:Tim

Posted 26 June 2015 - 16:46

Your welcome! I was looking at the package and it was a quick mod...