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

import data from 2309 to v0.19.0 is force closed. #3299

Closed
rsyqvthv opened this issue Mar 30, 2020 · 4 comments
Closed

import data from 2309 to v0.19.0 is force closed. #3299

rsyqvthv opened this issue Mar 30, 2020 · 4 comments
Labels
question Not really an issue, but more of a question about how something works

Comments

@rsyqvthv
Copy link

I was using NewPipe PR#2309 Version 0.420.6969,
export database to new release v0.19
the v0.19 won't start after import database, ui error shows then force closed.

I can import feed if I dump them from the v0.420
but I would like to keep my bookmarks, I have lots of them in pr#2309, manually doing this is extremely time consuming.

I tried to do with SQL, but I am really a noob of that, really no idea what's different of tables between my pr#2309 and v0.19

how can I achieve to import bookmarks and settings from my current pr#2309 to new release v0.19?

Thanks.

@TobiGr
Copy link
Contributor

TobiGr commented Mar 30, 2020

@rsyqvthv All versions in the PR were 0.420.6969 AFAIK (btw. a nice name @mauriciocolli). The database structure was changed multiple times in that PR. So there are no migrations in the app. However, you might want to post your table structure here and maybe someone has time to help you.

@TobiGr TobiGr added the question Not really an issue, but more of a question about how something works label Mar 30, 2020
@rsyqvthv
Copy link
Author

rsyqvthv commented Mar 30, 2020

thanks reply me quickly,

I export my PR version database to the zip file.
extract the newpipe.db from the zip
using DB Browser for SQLite to open this db file
and export the database structure as pr-newpipe.db.sql

any one would like to help me can download this sql file here:
https://www.codepile.net/raw/mzmWJZPl.sql

===

I had tried bit to compare this structure to the v0.19 version, only diff I can tell is:

add "sort_order" column to "feed_group"
add "index_feed_group_sort_order" index ON "feed_group"

I tried to manually add these, but still have the ui error, subscription error .... then force stop.

====

:(

@rsyqvthv
Copy link
Author

I find a way to sort out this problem by:

open db file use sqlite tool (in PC)

dump 2309 database backup and extract newpipe.db, move to PC, rename it as 2309.db
do the same to v0.19, rename to 019.db

open both of them with DB Browser for SQLite in 2 windows,
put them side by side for good ref.

solve table structure difference first,
as I found in last reply
there is only one in feed_group

in 2309.db window:

  • right click feed_group in database structure table, then choose modify
  • add new field name it as sort_order, type as integer, and we should click NN (no null) next to it, but currently I can't, I have to do the next step then back to here to check NN. now click OK to save modification.
  • goto browse data tab, and select feed_group in drop menu, there is a new col with all NULL there, I input sequence number from 0 to each of row, like if I have 4 groups, I will put 0,1,2,3 for each row.
  • than back to database structure, modify the feed_group again, click the NN in sort_order row, then save.

export tables from 2309 db
in 2309.db window:
file > export > export SQL
select following tables:

feed
feed_group
feed_group_subscription_join
feed_last_updated
playlist_stream_join
playlists
remote_playlists
search_history
stream_history
stream_state
streams
subscriptions

then save to file, I name it as 2309.sql

clean up in 019.db
before input the exported sql file to 019, I do the clean up first to make sure there isn't any conflict.
in 019.db window:
run following sql in tab execute SQL

DELETE FROM feed;
DELETE FROM feed_group;
DELETE FROM feed_group_subscription_join;
DELETE FROM feed_last_updated;
DELETE FROM playlist_stream_join;
DELETE FROM playlists;
DELETE FROM remote_playlists;
DELETE FROM search_history;
DELETE FROM stream_history;
DELETE FROM stream_state;
DELETE FROM streams;
DELETE FROM subscriptions;

import to 019.db
in 019.db window:
file > import > database from SQL file
choose the exported file 2309.sql
it will popup a notice, choose no
then save the change, close the database.
to verify the change is saved, open the 019.db again, to check if everything imported.

import to newpipe v0.19
now rename the 019.db back to newpipe.db
replace the same name file in the dump zip file (newpipedata) of 019, which I did in very first place.
transfer this file to mobile
import newpipedata to newpipe.

:)

===
conclusion,
I think it must be also some format changed from 2309 to v0.19,
not only structure changed.

@Stypox
Copy link
Member

Stypox commented Apr 27, 2020

A month has passed, I think this can now be closed ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Not really an issue, but more of a question about how something works
Projects
None yet
Development

No branches or pull requests

3 participants