Page 1 of 1

customer_ip data

Posted: Sat Apr 17, 2021 11:08 pm
by Sukumar
My database getting bloated by lots of unnecessary data. I wonder is it safe to delete the data from customer_ip table. it is 3.5m now. and could someone please advice how to remove the session data safely without crashing the site.
thank you in advance

Re: customer_ip data

Posted: Mon Apr 19, 2021 6:39 pm
by paulfeakins
It's a good idea, but you obviously have to be careful to only remove the right stuff!

Re: customer_ip data

Posted: Tue Apr 20, 2021 12:31 pm
by DBI
Yes that's safe. Make a backup of the table (you can download it if you're trying to save space on the server) and then delete away.

You can keep recent entries with a query similar to this:

Code: Select all

delete FROM `oc_customer_ip` WHERE `date_added` < '2021-04-19'
That would delete everything from 04-18 and older. You can change the criteria to anything you want (for example just 2021 would delete everything from 2020 and older).