Migrate Video Station Database

Questions about using 3rd party Media Streaming software may go here
Forum rules
Please note the disclaimer before modifying your Synology Product.
ammulder
I'm New!
I'm New!
Posts: 2
Joined: Tue Jun 16, 2015 3:11 pm

Migrate Video Station Database

Postby ammulder » Tue Jun 16, 2015 3:31 pm

I just upgraded both hard drives in a DS214play to bigger ones. I did a backup and restore to the new drives to get all the files and configuration moved over. But it lost all the video station data (which was extensively tweaked). I installed video station on the new drives and waited for indexing to finish to be sure, but the result was a mess -- images missing, episodes of TV shows separated into listings for different shows, and all that.

In order to recover, I shut down and put the old drives in, attached a USB drive, turned on ssh, ssh'd to the DS, and ran this to create a backup file of the video station database:

Code: Select all

pg_dump -U postgres -Fc -b -f /volumeUSB1/usbshare/videostation.dump video_metadata


(the name of the USB volume after the -f parameter may vary, or you can replace that with any destination file you like)

Then I shut down, put the new hard drives in (I had already run the initial restore to them), attached the USB drive, and started the DS again. I stopped video station, ssh'd in, and ran this to replace the video station database full of crap with all the info from the old drives:

Code: Select all

pg_restore -U postgres -c -d video_metadata /volumeUSB1/usbshare/videostation.dump


Again, the final path there should point to the database backup you created before, so the specific location may vary. The restore command gave a bunch of errors like this but they didn't seem to matter (I assume the specific object IDs just changed):

pg_restore: [archiver (db)] Error from TOC entry 2267; 2613 17072 BLOB 17072 postgres
pg_restore: [archiver (db)] could not execute query: ERROR: large object 17072 does not exist
Command was: SELECT pg_catalog.lo_unlink('17072');


Then I started video station again. It seems to have worked as desired -- all my shows and movies are listed again properly and their images are back.

For what it's worth this was with DSM 5.2-5565 Update 2 which uses PostgreSQL 9.3.6. I wouldn't have a lot of confidence it would work across different DSM versions (since they may have changed the database layout), but both old and new drives were on the same DSM version at the time I did it.
Squozen
Knowledgeable
Knowledgeable
Posts: 346
Joined: Wed Jan 09, 2013 1:35 am

Re: Migrate Video Station Database

Postby Squozen » Fri Dec 11, 2015 11:01 pm

Thanks for this. You've saved me some experimentation time! :mrgreen:

Just wanted to let you know that somebody appreciated your post.
paradeiser
Apprentice
Apprentice
Posts: 85
Joined: Mon Aug 09, 2010 10:57 am

Re: Migrate Video Station Database

Postby paradeiser » Wed Aug 03, 2016 1:41 pm

I just found your post and hoped it could help me to move my Video Station database to a new (restored) Synology.

But I get this error while trying to dump the data on a share on my old NAS

Code: Select all

pg_dump: [archiver (db)] connection to database "video_metadata" failed: FATAL:  Peer authentication failed for user "postgres"


i logged in via SSH as admin

DSM 6.0.1-7393 Update 2

any ideas? thanks a lot!
sincerly,
marko
DS210j | DS410 | DS211 | DS214 | DS216+II | DS916+
mathiasi
I'm New!
I'm New!
Posts: 2
Joined: Thu Aug 11, 2016 10:31 pm

Re: Migrate Video Station Database

Postby mathiasi » Thu Aug 11, 2016 10:33 pm

paradeiser wrote:I just found your post and hoped it could help me to move my Video Station database to a new (restored) Synology.

But I get this error while trying to dump the data on a share on my old NAS

Code: Select all

pg_dump: [archiver (db)] connection to database "video_metadata" failed: FATAL:  Peer authentication failed for user "postgres"


i logged in via SSH as admin

DSM 6.0.1-7393 Update 2

any ideas? thanks a lot!
sincerly,
marko


There should be a simple fix - After DSM 6, such commands should be run with sudo in front of the command in order to run as super user.
paradeiser
Apprentice
Apprentice
Posts: 85
Joined: Mon Aug 09, 2010 10:57 am

Re: Migrate Video Station Database

Postby paradeiser » Fri Aug 12, 2016 9:50 am

thanks a lot for the hint!

Eventually I figured out to try it as su (cant rercall the exact command… su -i or something like that) - which let me dump the database.
But as described before the import resulted in a lot of error messages. The end-result in VideoStation was very unsatisfying: Actually just the names of my personal libraries were restored, but no index, tags, artwork, watch-lists, etc. etc. this was all lost.
I ended up reinstalling VideoStation with a blank database and do it all from scratch :(
DS210j | DS410 | DS211 | DS214 | DS216+II | DS916+
cris73
I'm New!
I'm New!
Posts: 1
Joined: Sat Oct 08, 2016 8:44 am

Re: Migrate Video Station Database

Postby cris73 » Sat Oct 08, 2016 8:47 am

Just for the sake of other user who may have similar issue I used the command you posted prior upgrading between v.6 and another v,6 patch which i noticed wipe out the video station DB, had to use the sudo as suggested in the thread and the restore throw out a bunch of errors, but the result was satisfactory and I have my DB fully restored
User avatar
kpo
Student
Student
Posts: 62
Joined: Thu Jun 06, 2013 1:32 pm

Re: Migrate Video Station Database

Postby kpo » Thu Feb 23, 2017 6:37 pm

Hey guys is this procedure different from "Exporting metadata info" as described in here https://www.synology.com/en-global/knowledgebase/DSM/help/VideoStation/metadata ?
Synology DS213
WD Red 3Tb HDD
Tp-Link TL-WDR4300
Foscam FI-9805W
WDTV Live (WDLXTV)

Return to “Media Streaming Mods”

Who is online

Users browsing this forum: No registered users and 1 guest