• Resolved alexzaragoza21

    (@alexzaragoza21)


    Hi Hector,

    I hope you don’t mind helping me again.

    I want to recover old data views.

    To be give you the details , I created courses before using LMS Plugin one. Then, I migrated to LMS Plugin 2. I managed to retain those courses with the same permalinks.

    My problem now is, the old data views of those courses are not displaying anymore. For example, it used to have like around 17K views but now, it shows 0/or no data so far. Is there a way that I can recover it?

    Thank you so much in advance Hector!

    Hope to hear from you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Hector Cabrera

    (@hcabrera)

    Hi @alexzaragoza21,

    WordPress Popular Posts associates views data with IDs. If your courses’ IDs changed due to the migration to LMS 2 (I assume that’s what’s happened from what you said) then that would explain why the views count is different now.

    If that’s indeed the case then to restore your views data you’d need to do any of the following:

    • update the IDs in WPP’s database tables (_popularpostsdata and _popularpostssummary)
    • see if there’s a way to restore the IDs your courses had before migrating to LMS 2.

    If that’s not the case and your courses still retain the same IDs as before the migration to LMS 2 then your problem is something else and I’d need more details so I can help you figure out what’s going on.

    Thread Starter alexzaragoza21

    (@alexzaragoza21)

    Hi Hector,

    Yes, because of the migration, our courses have different ids now. The permalinks are same but the ids are different.

    “update the IDs in WPP’s database tables (_popularpostsdata and _popularpostssummary)”

    Can you guide me doing this? We do want to retain those views or even pass it to our migrated courses.

    Thank you so much.

    Plugin Author Hector Cabrera

    (@hcabrera)

    Basically what you want to do is use the UPDATE TABLE statement to update the ID of every course in WPP’s database tables.

    For example:

    UPDATE TABLE wp_popularpostsdata 
    SET postid = NEW_COURSE_ID_HERE 
    WHERE postid = ORIGINAL_COURSE_ID_HERE;

    That would update the ID of a course in the _popularpostsdata table (where the total views count is stored).

    To update the ID on _popularpostssummary, where the Time Range views data is stored (last 24 hours, last 7 days, etc), you’d run a query like this:

    UPDATE TABLE wp_popularpostssummary 
    SET postid = NEW_COURSE_ID_HERE 
    WHERE postid = ORIGINAL_COURSE_ID_HERE;

    Of course, this is all assuming that:

    – You know the original IDs of the courses.
    – You have access to your database (either via phpMyAdmin or some other way).
    – You are at least somewhat familiar with MySQL databases. If you aren’t you can still try doing this yourself but it might be a better idea getting someone else to do this for you.

    Also:

    – Please create a backup of your database first so you can roll back changes if/when needed;
    – I recommend doing this either offline (on your computer) or on another server (eg. staging/dev site) and not on your live website. Or at least schedule a downtime window so your users know beforehand that your website will be down for maintenance for a few hours.

    Thread Starter alexzaragoza21

    (@alexzaragoza21)

    Hi Hector, Thank you so much! This is very helpful.

    I’ll folow this and try to do it in my own.

    Your support here is really amazing. More power to you! ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Recover old/lost data views’ is closed to new replies.