• Resolved Ikvindlezenleuk

    (@ikvindlezenleuk)


    Hi, I upgraded last night to the new version and immediately noticed that all my historical data is gone. I rollbacked the update but the data is still lost. Is there anyway to get these data back?

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Danny van Kooten

    (@dvankooten)

    Hi @ikvindlezenleuk,

    Do you have access to your database in some way? If so, can you check the contents of the wp_koko_analytics_post_stats table?

    Did you completely uninstall the plugin through your WP Admin > Plugins page by any chance? (That will delete all database tables)

    Thread Starter Ikvindlezenleuk

    (@ikvindlezenleuk)

    II upgraded Koko Analytics and saw that my data was gone. Then I used the plug-in WP Rollback to go back to the previous version, but the data was still gone.

    I can check the contents of wp_koko_analytics_post_stats table. It has 73 rows. I’ve also checked the contents of this table for 3 other websites that I have: one has 90 rows (on this website I also updated the plug-in yesterday), one has 687 rows and the last one has 3508 rows. On these last two websites I didn’t update Koko Analytics yet.

    And when I check wp_koko_analytics_site_stats I see the following numbers: 1 row on the website I updated, 2 rows on another website I updated, 849 and 1321 rows on websites I didn’t update yet. So it appears that somehow while updating the plug-in all the historical data has diseappeared. And both websites had yesterday their best visitors day of this year 🙁

    Plugin Author Danny van Kooten

    (@dvankooten)

    Hi @ikvindlezenleuk,

    That is really strange. The upgrade does not touch the wp_koko_analytics_site_stats table at all and it is also not deleting any rows from the wp_koko_analytics_post_stats table, only modifying existing ones.

    I’ve checked WP Rollback, but from a quick glance, it doesn’t seem to be calling the uninstall.php file that we ship in Koko Analytics. When you completely remove a plugin through WP Admin > Plugins, this uninstall logic runs and in the case of Koko Analytics, all data is removed when it does. It sounds like that is what happened to you, but from a distance I can’t really tell why…

    However, the sad reality is that unless you have a back-up of your database from before the data was deleted, it sounds like your historical statistics are indeed gone.

    If you do have a database back-up (your webhost should make one on at least a daily or weekly basis), I would love to help you retrieve just the Koko Analytics tables and reinstate them for you.

    Let me know please.

    Best,
    Danny

    Thread Starter Ikvindlezenleuk

    (@ikvindlezenleuk)

    Hi Danny, thanks for the quick response.

    • I restored a back-up from last night (before the plug-in update) and it restored the data
    • After that I updated the plug-in and the statistics are still there, but page title and counts were missing
    • I clicked the migrate-button, the page title and counts appeared again

    So it all appears to be working again (thankfully). The only thing is that the migrate-button is still visible on top of the page, for two out of three websites that I updated. On one website the migrate-button didn’t appear at all

    Thanks for the offer to help, but I managed to do it myself.

    Plugin Author Danny van Kooten

    (@dvankooten)

    Hi @ikvindlezenleuk,

    Awesome – happy to hear it!

    What worries me a little is that the migration notice is not appearing. This would indicate that the migration didn’t actually finish properly and I am afraid that it will affect the stat collection going forward.

    • Are new stats coming in correctly? If yes, ignore the following two questions and we’re all good!
    • If not, can you check the table structure of the wp_koko_analytics_post_stats table? Is there a PRIMARY KEY on the date and path_id column?
    • Can you show the results of running the following database query? SELECT DISTINCT(post_id) FROM wp_koko_analytics_post_stats WHERE post_id IS NOT NULL AND path_id IS NULL
    • What happens if you click the “Migrate” button again? There is no visual feedback, but the page should load for a little while and then redirect you back to where you were with the migration notice gone, eventually (after it finishes).

    The migration notice only shows up on sites with more than 25.000 rows in their stats table. On smaller notice, it runs automatically. That may explain why you were not asked to migrate your data on one of your sites.

    Best, Danny

    Thread Starter Ikvindlezenleuk

    (@ikvindlezenleuk)

    The migration notice only shows up on sites with more than 25.000 rows in their stats table. On smaller notice, it runs automatically. That may explain why you were not asked to migrate your data on one of your sites.

    The website where the migrate-button is not showing is more like a test website with hardly any traffic, so that’s probably why I didn’t see a button.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘All statistics lost after update’ is closed to new replies.