This is not expected. Can you check with phpMyAdmin to see what’s in those columns for the old data?
Thread Starter
pepe
(@pputzer)
I’ll have a look at the database later today.
Thread Starter
pepe
(@pputzer)
Unfortunately, the tables contain “0.0.0.0” š
We removed the code that drops the old columns, to avoid this issue in the future.
Thread Starter
pepe
(@pputzer)
So is there any way to convert the previous data from a DB backup?
Yes, absolutely. You can import the table wp_slim_stats from your backup as wp_slim_stats_old, and then use an UPDATE statement where you join both wp_slim_stats and wp_slim_stats_old by their id and assign wp_slim_stats.ip = inet_ntoa( wp_slim_stats_old.ip). Does it make sense?
Thread Starter
pepe
(@pputzer)
Yes, thanks, I’ll do that.
Awesome. Same thing you want to do for other_ip.
Thread Starter
pepe
(@pputzer)
Fortunately, only two hits in the early hours of today could not be recovered. Thanks!
Great, thank you for reporting back and for making this info available to other users.
Thread Starter
pepe
(@pputzer)
I used the following SQL statements:
update <prefix>_slim_stats join <prefix>_slim_stats_old on <prefix>_slim_stats.id = <prefix>_slim_stats_old.id set <prefix>_slim_stats.ip = inet_ntoa(<prefix>_slim_stats_old.ip) where <prefix>_slim_stats.ip = '0.0.0.0';
update <prefix>_slim_stats join <prefix>_slim_stats_old on <prefix>_slim_stats.id = <prefix>_slim_stats_old.id set <prefix>_slim_stats.other_ip = inet_ntoa(<prefix>_slim_stats_old.other_ip) where <prefix>_slim_stats.other_ip = '0.0.0.0';
<prefix> of course needs to be replaced with the actual database/blog prefix.
Fantastic, thanks for sharing.