How to change location of ini and db

General discussion about the media server. Feature requests. Hints, tips and tricks.
Post Reply
drew_sav
Posts: 2
Joined: Mon Apr 13, 2009 6:17 am
AV Hardware: Thecus N2100

How to change location of ini and db

Post by drew_sav » Mon Apr 13, 2009 7:38 am

Hi people,

After buying TwonkyMedia Server 5 i installed it on my Thecus N2100 and have come across a pretty annoying issue. The problem is that version 5 stores all data in the /var/twonkymedia folder, which is not allowed on this device. So on every reboot all my twonky settings are removed by the system. I would like to know how to move the /var/twonkymedia folder back to the install folder, or another folder of my choosing. I have tried it myself, but i don't know where i can move the /var/twonkymedia/twonkymedia-server.ini file where the installation is going to find it.

Thanks in advance,
Andrew

drew_sav
Posts: 2
Joined: Mon Apr 13, 2009 6:17 am
AV Hardware: Thecus N2100

Re: How to change location of ini and db

Post by drew_sav » Thu Apr 16, 2009 6:39 am

For anyone else having this issue, I have been able to overcome this on my Thecus N2100 NAS by creating a symlink on every boot right before the twonky media server starts. The symlink points to a settings folder i created in the original Twonky install folder (For me that's /raid/module/TWONKYMEDIA/). However, this is a simple workaround that will not be straight forward for the average user.

comboman
Posts: 1
Joined: Mon Apr 20, 2009 11:13 am
AV Hardware: Teac WAP-8500
Thecus N2100

Re: How to change location of ini and db

Post by comboman » Mon Apr 20, 2009 11:27 am

Hi,

I have the same problem with my Thecus N2100 and I'm glad to see there is a possible solution.
But unfortunately I am just starting with linux and so it is a little bit difficult to me.

Could you please describe more precise your way?
i.e. where did you create the symlink?

Thanks in advance,
Thomas

peterfu
Posts: 33
Joined: Thu Dec 22, 2005 12:12 pm
Location: Austria

Re: How to change location of ini and db

Post by peterfu » Sun Apr 26, 2009 8:53 am

Theres a simple solution for that.
For some of the folders the server needs, just modify the twonkymedia-server-default.ini file:
cachedir=/raid/data/module/TWONKYMEDIA/twonky/.Twonkymedia/Cache
dbdir=/raid/data/module/TWONKYMEDIA/twonky/.Twonkymedia/db
mediastatisticsdir=/raid/data/module/TWONKYMEDIA/twonky/.Twonkymedia/stat
uploadmusicdir=/raid/data/module/TWONKYMEDIA/twonky/.Twonkymedia/twonkymedia-server-uploaded-music
uploadpicturedir=/raid/data/module/TWONKYMEDIA/twonky/.Twonkymedia/twonkymedia-server-uploaded-pictures
uploadvideodir=/raid/data/module/TWONKYMEDIA/twonky/.Twonkymedia/twonkymedia-server-uploaded-videos
onlinedir=/raid/data/module/TWONKYMEDIA/twonky/.Twonkymedia/twonkymedia-server-online-data
This is an example of the Thecus N5200/N7700 module for a 5.x twonkymedia server. The default ini file is the ini file the server reads in if no user ini file is existing - so after You have changed the default one delete the user ini file and start the server.

You even can change these location with the web interface of the running server with a simple trick. Once You are on the configuration page put following in the adress filed of Your browser (here the example of changing the dbdir to /raid/data/myfolder):
http://<YOUR IP>:9000/rpc/set_option?dbdir=/raid/data/myfolder
This is then stored in the user modified ini file.


The location of the ini file itself can be given as parameter to the server on start:
/raid/data/module/TWONKYMEDIA/twonky/twonkymedia -inifile /raid/data/module/TWONKYMEDIA/system/etc/twonkyvision-mediaserver.ini
again this example is from the Thecus N5200/N7700 module.

br
Peter

peterfu
Posts: 33
Joined: Thu Dec 22, 2005 12:12 pm
Location: Austria

Re: How to change location of ini and db

Post by peterfu » Sun Apr 26, 2009 9:34 am

Add on:
You also might want to change the location of the log file, cause this is written in default to /tmp and fills up Your flash.
So add also as parameter in the startup script of the server
-logfile <your dir/log file name>
br
Peter

Post Reply