Jump to content

Playback Reporting - how to copy all history to new server ?


Recommended Posts

Posted

I am rollling out a new prod server - was on beta.

I dont want to use all my history.

Whats the process ?

Happy2Play
Posted (edited)

I would think just copying the database from one the other, but it has its own backup and restore function in plugin settings tab.

image.png.ae059494e3682bedfa25c1a93c28ebfd.png

Edited by Happy2Play
typo
  • Like 1
Happy2Play
Posted

May want to run the task as it appears to be set to run weekly.

Posted

Ah yes - of course - it backs up every day and keeps 30 - I will copy that over and do a restore as a test.  Cheers.

Posted

So - I did this as a test.

I copied the export to the new system.

Then did a load and selected it.

But I got a 0 items restores.

Still nothing showing in the tabs.....

Posted

Ignore that - there is historical data there - strangely not the the last month.

Will do some more checking ./ compares

Posted

HHmmm - Is it possibly using the emby server name in the queries ?

The new one is named 'Emby Live Server'

Nothing is showing in any of the tabs.

The default query and Example Query is pulling back data however.

Posted

It only seems to have imported a set of data for 2022.......

Posted

I stopped both servers - and copies the actual db file this time, and now all data is there.

Maybe a bug with the backup / restore ?  

Happy2Play
Posted

Possibly as I have mine set to forever but appears to only go back a year.  But if I remember correctly back then there was a issue with a change in the database.

But you would just have to open your tsv file and look at what data it has backed up.

Posted

The tsv file contains data from 2022 until now - so its all there.

The import process seems to only import a portion of 2022 for some reason.

  • 3 weeks later...
Happy2Play
Posted
On 3/2/2024 at 6:06 PM, vaise said:

The tsv file contains data from 2022 until now - so its all there.

The import process seems to only import a portion of 2022 for some reason.

Finally got around to looking at this and is due to db schema changes over time so only current table is backed up.

 

Posted
5 minutes ago, Happy2Play said:

Finally got around to looking at this and is due to db schema changes over time so only current table is backed up.

 

This would the 'backups' are no good then would it not ?

Happy2Play
Posted
Just now, vaise said:

This would the 'backups' are no good then would it not ?

Sort of as it is only for one table.  But the db itself has the info for each table.

I just merged them into one again.  Obviously everyone will have different table names per date from schema changes.  As each table has column changes.

INSERT INTO PlaybackActivity(DateCreated, UserId, ItemId, ItemType, ItemName, PlaybackMethod, ClientName, DeviceName, PlayDuration) SELECT DateCreated, UserId, ItemId, ItemType, ItemName, PlaybackMethod, ClientName, DeviceName, PlayDuration FROM PlaybackActivity_20190524_183338;

INSERT INTO PlaybackActivity(DateCreated, UserId, ItemId, ItemType, ItemName, PlaybackMethod, ClientName, DeviceName, PlayDuration, PauseDuration) SELECT DateCreated, UserId, ItemId, ItemType, ItemName, PlaybackMethod, ClientName, DeviceName, PlayDuration, PauseDuration FROM PlaybackActivity_20230427_121456;

 

Posted

Im dealing with incorrect play times now on the plugin thread - need to sort that out.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...