Jump to content

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


vaise

Recommended Posts

vaise

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

I dont want to use all my history.

Whats the process ?

Link to comment
Share on other sites

Happy2Play

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
Link to comment
Share on other sites

Happy2Play

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

Link to comment
Share on other sites

vaise

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.

Link to comment
Share on other sites

vaise

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.....

Link to comment
Share on other sites

vaise

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

Will do some more checking ./ compares

Link to comment
Share on other sites

vaise

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.

Link to comment
Share on other sites

vaise

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

Link to comment
Share on other sites

vaise

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 ?  

Link to comment
Share on other sites

Happy2Play

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.

Link to comment
Share on other sites

vaise

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.

Link to comment
Share on other sites

  • 3 weeks later...
Happy2Play
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.

 

Link to comment
Share on other sites

vaise
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 ?

Link to comment
Share on other sites

Happy2Play
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;

 

Link to comment
Share on other sites

vaise

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

Link to comment
Share on other sites

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...