NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public NextPVR Support Linux v
« Previous 1 … 29 30 31 32 33 34 Next »
Moving records from windows to linux

 
  • 1 Vote(s) - 5 Average
Moving records from windows to linux
flyingsubs
Offline

Member

Posts: 85
Threads: 14
Joined: Jun 2018
#1
2019-10-01, 03:19 AM
So I'm trying to migrate from my windows instance to windows.

I see when I record using NPVR on the linux backend the recordings show up.  Is there anyway I can move my existing recordings from my windows box to my linux media folder and have NPVR see them? 

Thanks!
Flyingsubs
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 52,940
Threads: 956
Joined: May 2006
#2
2019-10-01, 03:10 PM (This post was last modified: 2019-10-01, 03:11 PM by mvallevand.)
Here is an example sqlite script that will copy the resume position, the deleted files (for avoid duplicates) and the recordings showing some of the cases you need to deal with for changing the mount point.

Code:
.open npvr.db3
attach '/v4/npvr.db3' as v4;
.databases

insert into recently_deleted select * from v4.recently_deleted where v4.recently_deleted.oid not in (select oid from recently_deleted);

insert into playback_position select * from v4.playback_position;

insert into scheduled_recording select * from v4.scheduled_recording where v4.scheduled_recording.oid not in (select oid from scheduled_recording);

update scheduled_recording
set filename = replace(filename,"\","/");

update scheduled_recording
set filename = replace(filename,"C:/movies/","/media/vista/");

update scheduled_recording
set filename = replace(filename,"C:/LiveTV/","/buffer/");

update scheduled_recording
set filename = replace(filename,"K:/","/recordings/");

update scheduled_recording
set filename = replace(filename,"k:/","/recordings/");

update scheduled_recording
set filename = replace(filename,"//172.16.3.244/Movies","/movies/");

Martin
flyingsubs
Offline

Member

Posts: 85
Threads: 14
Joined: Jun 2018
#3
2019-10-01, 03:19 PM
Oh that makes sense that the information is in the the database.  I'm assuming I need to copy over my V4 database to my Raspberry pi and then run through the steps below updating the location of my media folder and referencing the new database in V5?

-Flyingsubs
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 52,940
Threads: 956
Joined: May 2006
#4
2019-10-01, 03:34 PM
Don't overwrite the v5 database, the v4 npvr.db3 file can be with your recordings which I am assuming will be on share.

Martin
flyingsubs
Offline

Member

Posts: 85
Threads: 14
Joined: Jun 2018
#5
2019-10-01, 03:44 PM
I manually moved all my recordings to /media/recordings. I haven't set up a share since I am planning on decommissioning my windows machine assuming I can run everything on my Raspberry Pi. I have heard you don't want to override the DB.

I think I understand the code you have except for this section. All the update scheduled recordings. Are these all the different file locations for your media?

update scheduled_recording
set filename = replace(filename,"C:/movies/","/media/vista/");
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 52,940
Threads: 956
Joined: May 2006
#6
2019-10-01, 04:04 PM (This post was last modified: 2019-10-01, 04:05 PM by mvallevand.)
I just created some examples showing how someone might want to do conversion, you can use drive letters, folders, shares etc depending what the new base is going to be. In my case I do have media all over the place.

Martin
flyingsubs
Offline

Member

Posts: 85
Threads: 14
Joined: Jun 2018
#7
2019-10-01, 04:06 PM
Thanks! Much appreciated. Going to try this out.
flyingsubs
Offline

Member

Posts: 85
Threads: 14
Joined: Jun 2018
#8
2019-10-02, 01:06 AM
So I took your idea and tried Sudo and that got me a bit further. This time it's saying the database is locked, I tried stopping NPVR and making sure nothing is being recorded or streamed. Is there a process that needs to be stopped in order to free up the database?
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 52,940
Threads: 956
Joined: May 2006
#9
2019-10-02, 01:14 AM
(2019-10-02, 01:06 AM)flyingsubs Wrote: So I took your idea and tried Sudo and that got me a bit further. This time it's saying the database is locked, I tried stopping NPVR and making sure nothing is being recorded or streamed.  Is there a process that needs to be stopped in order to free up the database?
I never update a database while the servicr is running it should work fine if you stop the it assuming you have the filenames right.  You can try copying it somewhere to confirm

Martin
flyingsubs
Offline

Member

Posts: 85
Threads: 14
Joined: Jun 2018
#10
2019-10-02, 07:04 PM
I'm pretty sure I have the databases correct. I did a test with this statement and it returned results.

select * from v4.recently_deleted where v4.recently_deleted.oid

I stop NPVR with :
sudo service nextpvr-server stop

Are there any services that I need to stop? I can't seem to figure out what is causing the database to be locked. Any ideas?

Thanks!
Flyingsubs
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (2): 1 2 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  Linux Command Line To Initiate SchedulesDirect EPG Update LinuxDVR 1 253 2025-04-13, 06:35 PM
Last Post: mvallevand
  Linux install failed -- permission denied? FrogFan 4 555 2025-03-26, 12:39 AM
Last Post: FrogFan
  Is there a 'recommended' version/release of Linux? Bobthegoldfish 1 419 2024-12-24, 12:28 AM
Last Post: mvallevand
  Downgrade on Linux eriberg 3 496 2024-09-04, 08:46 PM
Last Post: mvallevand
  linux mint 22 bccicone 2 587 2024-08-01, 10:10 PM
Last Post: bccicone
  Client Recommendations on Linux devarionarias 6 1,697 2024-06-18, 04:31 PM
Last Post: devarionarias
  Linux setup - Help a Windows user... prothed 18 2,578 2024-06-03, 11:08 AM
Last Post: Rod Hutchinson
  Install NexPVR backend in Buildroot based Linux Tnix 3 1,084 2024-03-14, 11:50 AM
Last Post: mvallevand
  Remote NextPVR backup script for Linux snagglewest 2 648 2024-02-06, 05:44 PM
Last Post: snagglewest
  Importing recordings from linux VDR Nzbaxterman 18 2,116 2023-10-08, 12:03 AM
Last Post: mvallevand

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode