Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to load backup #84

Open
GlitzaFlitzer opened this issue May 20, 2024 · 8 comments
Open

Unable to load backup #84

GlitzaFlitzer opened this issue May 20, 2024 · 8 comments

Comments

@GlitzaFlitzer
Copy link

Hey,
today I created a backup of my playback reporting with the aim of deleting reports that were not desirable in it. After editing, I deleted all my data and wanted to load the tsv file again using the "Load Backup Data" tab. Unfortunately, nothing happens. Is this option possibly buggy or is it just me? Thanks!

I use version 14.0

@ibndiaye
Copy link

ibndiaye commented Jun 3, 2024

Yep, I'm also experiencing this issue on jellyfin 10.9.4, I'll be able to post some more info soon.

@ibndiaye
Copy link

ibndiaye commented Jun 5, 2024

Yep, I'm also experiencing this issue on jellyfin 10.9.4, I'll be able to post some more info soon.

Jellyfin server running on ubuntu lxc:

Server version
10.9.4
Web version
10.9.4
Build version
10.9.4

Logs when loading the backup:

[2024-06-05 16:55:07.544 +00:00] [INF] PlaybackReportingActivityController Loaded
[2024-06-05 16:55:07.547 +00:00] [INF] Default journal_mode for "/var/lib/jellyfin/data/playback_reporting.db" is "delete"
[2024-06-05 16:55:10.106 +00:00] [INF] PlaybackReportingActivityController Loaded
[2024-06-05 16:55:10.109 +00:00] [INF] Default journal_mode for "/var/lib/jellyfin/data/playback_reporting.db" is "delete"
[2024-06-05 16:55:18.338 +00:00] [INF] PlaybackReportingActivityController Loaded

@Souperwilli
Copy link

I have the same issue running Jellyfin 10.10.13 in a Docker container, getting the same logs as @ibndiaye.
Are there any news on this topic?

@leolifely
Copy link

I have this issue as well, with Jellyfin 10.10.3 on Ubuntu Server 24.04.1 LTS, with these logs:
Dec 24 17:52:43 leoli jellyfin[52303]: [17:52:43] [INF] Default journal_mode for /var/lib/jellyfin/data/playback_reporting.db is delete Dec 24 17:52:43 leoli jellyfin[52303]: [17:52:43] [INF] PlaybackReportingActivityController Loaded Dec 24 17:52:43 leoli jellyfin[52303]: [17:52:43] [INF] Default journal_mode for /var/lib/jellyfin/data/playback_reporting.db is delete Dec 24 17:52:46 leoli jellyfin[52303]: [17:52:46] [INF] PlaybackReportingActivityController Loaded Dec 24 17:52:46 leoli jellyfin[52303]: [17:52:46] [INF] Default journal_mode for /var/lib/jellyfin/data/playback_reporting.db is delete

@Flo56958
Copy link

Flo56958 commented Jan 26, 2025

Same journal_mode issue when trying to load a backup with plugin version 15.0.0.0 and Jellyfin 10.10.4.

For anyone coming across this issue as well, I have created a workaround by manually editing playback_reporting.db with this short python script:

#EDIT THIS
DATABASE = "playback_reporting.db"
BACKUP = "backup.tsv"

import sqlite3
import csv
con = sqlite3.connect(DATABASE)
cursor = con.cursor()

with open(BACKUP) as fd:
    rd = csv.reader(fd, delimiter="\t", quotechar='"')
    for row in rd:
        query = f"INSERT INTO PlaybackActivity VALUES ({", ".join([f'"{x.replace('"', '""')}"' for x in row])});"
        cursor.execute(query)

con.commit()

It worked for me while Jellyfin was shut down. Hope it helps. The script does not check for duplicate insertion.

@nazgul6
Copy link

nazgul6 commented Mar 17, 2025

@Flo56958 - thanks! this worked to import the backup containing history for me as well. However, the users from the backup were imported as new users with names 'Not Known' instead of the history simply appended to existing users, which is what I would have expected given same user names in the backup file and the newly setup jellyfin instance. Did you run into this as well? Thanks!

@Flo56958
Copy link

Flo56958 commented Mar 18, 2025

@Flo56958 - thanks! this worked to import the backup containing history for me as well. However, the users from the backup were imported as new users with names 'Not Known' instead of the history simply appended to existing users, which is what I would have expected given same user names in the backup file and the newly setup jellyfin instance. Did you run into this as well? Thanks!

The users are saved by their uuids. I have also transferred the jellyfin.db which contained the old user ids. I think you need to find out which old ids map to which new ones and then update the old ids manually via the sql interface.

@nazgul6
Copy link

nazgul6 commented Mar 22, 2025

@Flo56958 , perfect, thanks, sorted it.

For future reference, to list the UUIDS from jellyfin.db, the command is:

sqlite3 jellyfin.db "SELECT Id, Username FROM Users;"

The UUIDs will be listed with dashes and capital letters, one should remove the dashes (I also made them all lower case to match the backup export).

Tip:
When editing .tsv from playback reporting to run find+replace, this is best done through a text editor as opposed to excel. Excel will mess up the first column of data, which is DD/MM/YYYY hh:mm:ss with seconds followed by seven further digits. If those are truncated (Excel seems to cut them off no matter what), the plugin won't pick up any of the data when re-imported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants