PDA

View Full Version : tips on switching between 6.5.x and 7.x?



peterw
2007-04-06, 13:07
The last time I tried running 7.x on my Linux development system, it seemed to make changes to the MySQL databases that caused problems when I shut down 7.x and tried to start 6.5.x back up. Should I be doing something like renaming ~/Cache so that 6.5.x and 7.x don't try to use the same files? Any other tips on switching back and forth between the versions? Greg's posted a message recently that reminds me I should start working on porting my code to 7.x...

Thanks,

Peter

JJZolx
2007-04-06, 13:32
Why not run both? Create two databases.

mherger
2007-04-08, 22:51
> Why not run both? Create two databases.

Maybe Peter would be thankful for some detailed information on how to do
this.

--

Michael

-----------------------------------------------------------------
http://www.herger.net/SlimCD - your SlimServer on a CD
http://www.herger.net/slim - AlbumReview, Biography, MusicInfoSCR

jonmyatt
2007-04-12, 02:14
> Why not run both? Create two databases.

Maybe Peter would be thankful for some detailed information on how to do
this.

I'd be interested too.

erland
2007-04-12, 09:56
The last time I tried running 7.x on my Linux development system, it seemed to make changes to the MySQL databases that caused problems when I shut down 7.x and tried to start 6.5.x back up. Should I be doing something like renaming ~/Cache so that 6.5.x and 7.x don't try to use the same files? Any other tips on switching back and forth between the versions? Greg's posted a message recently that reminds me I should start working on porting my code to 7.x...

I'm not sure if this is the best way, but this is how I have setup several slimserver versions on the same linux(ubuntu) machine earlier.

1.
Make sure you have MySQL installed

2.
Start and connect to the installed MySQL instance and create an empty MySQL database for each slimserver version, with the MySQL tool of your choice, I use a SQLyog running under wine. I have tree databases: slimserver63, slimserver65, slimserver70
By creating the database in the standard MySQL installation, the databases is not stored in the Cache directory.

3.
Create a user in the MySQL database that have full access to the databases created in step 2.

4.
I install the different slimserver versions by downloading and extracting the *.tar.gz version of slimserver. I have the different versions installed as:
/opt/slimserver63
/opt/slimserver65
/opt/slimserver70

5.
I have tree configuration files:
/etc/slimserver63.conf
/etc/slimserver65.conf
/etc/slimserver70.conf

6.
In each of the configuration files mentioned in step 5 I have changed the database properties to:


dbpassword: squeeze
dbsource: dbi:mysql:hostname=127.0.0.1;port=3306;database=sl imserver65
dbusername: squeeze

The dbsource property points to different databases in the different files, with the names created in step 2.

7.
I have a small script that creates two links:
ln -s /etc/slimserver65.conf /etc/slimserver.conf
ln -s /opt/slimserver65 /opt/slimserver

This script is executed to change the active slimserver version and points the links to the correct directory/file depending on the version specified as in-parameter.


After this I can run the script in step 7 to change to another slimserver version, and to run slimserver I just run:
/opt/slimserver/slimserver.pl

With this setup each slimserver version has it completely separate MySQL database and also a separate configuration file. The Cache directory is the same which can cause problems sometimes, but the setup can be easily changed in the same principle to also switch to different Cache directories if neccesary. Most of the time the Cache directory isn't a problem since the database isn't stored in it with this setup.

JJZolx
2007-04-12, 13:22
I'm not sure if this is the best way, but this is how I have setup several slimserver versions on the same linux(ubuntu) machine earlier.

Just a couple things to add to this which should apply to all platforms...

I use a separate cache directory for each server. There are enough issues with SlimServer's caching that sharing a cache folder probably just complicates, particularly if you run more than one SlimServer at the same time. I just keep a separate directory structure to keep the cache and server log(s).


\slim
..\dot6
..\..\cache
..\..\logs
..\dot7
..\..\cache
..\..\logs
..\dot8
..\..\cache
..\..\logs

If you want to run more than one server at a time then you'll need multiple IP addresses bound to the server. Specify the cache folder and IP address in the command-line options for each server.


--playeraddr 192.168.9.6 --cliaddr 192.168.9.6 --streamaddr 192.168.9.6 --httpaddr 192.168.9.6 --cachedir D:\slim\dot6\cache --logfile D:\slim\dot6\logs\server.log

On a Windows server, if you want to run all of the SlimServers as services, then it takes a bit of work using srvany, manually installing the services and then a bit of editing of the services parameters in the registry. If anyone's interested I'll see if I can write something up detailing how to do this.

peterw
2007-04-12, 16:29
Erland, you're dedicated! That just looked far too painful.

I've now got my laptop set up so I can switch between 6.5 and 7.x fairly easily.

Essentially, I copied my slimserver.pref into my Slimserver 7.x directory (an unpacked .tar.gz Slimserver distribution), made its slimserver.pl not executable (to reduce the chance of my running it by mistake) and then set up this script:


#!/bin/sh
cd /path/to/SlimServer_v2007-03-28
perl /path/to/SlimServer_v2007-03-28/slimserver.pl --playlistdir /path/to/SlimServer_v2007-03-28/playlists --cachedir /path/to/SlimServer_v2007-03-28/Cache --logfile /path/to/SlimServer_v2007-03-28/log.txt --prefsfile /path/to/SlimServer_v2007-03-28/slimserver.pref


Slimserver 7.x took care of setting up the MySQL instance using /path/to/SlimServer_v2007-03-28/Cache/MySQL instead of ~/Cache, so now I don't have trouble switching back to 6.5.x after shutting down 7.x

Now to update http://wiki.slimdevices.com/index.cgi?SwitchingFromSubversionBackToGeneralRele aseOrDowngradingSlimServer ...

-Peter

Triode
2007-04-13, 02:07
Please note that the new namespace based preferences code stores prefs files
in a directory, the default location of which can be overridden
by --prefsdir.
(--prefsfile is retained to specify the location of the old style preference
file during the migration)

> Code:
> --------------------
> #!/bin/sh
> cd /path/to/SlimServer_v2007-03-28
> perl /path/to/SlimServer_v2007-03-28/slimserver.pl --playlistdir
> /path/to/SlimServer_v2007-03-28/playlists --cachedir
> /path/to/SlimServer_v2007-03-28/Cache --logfile
> /path/to/SlimServer_v2007-03-28/log.txt --prefsfile
> /path/to/SlimServer_v2007-03-28/slimserver.pref
>
> --------------------

peterw
2007-04-14, 08:57
Please note that the new namespace based preferences code stores prefs files
in a directory, the default location of which can be overridden
by --prefsdir.
(--prefsfile is retained to specify the location of the old style preference
file during the migration)

Thanks for pointing that out! I'll update my script. What would you think about a single command-line arg like --rootdirectory that would specify the directory under which prefs, cache, etc. should be expected? Have Slimserver calculate the location of the other files based on --rootdirectory unless otherwise specified?

JJZolx
2007-04-27, 16:08
What would you think about a single command-line arg like --rootdirectory that would specify the directory under which prefs, cache, etc. should be expected? Have Slimserver calculate the location of the other files based on --rootdirectory unless otherwise specified?

I was just looking at this. I like the idea of a single command line option to specify the location of all of the dynamically written server data directories. I would add the bundled MySQL's data directory to it, as well.

Another similar option would also be convenient: A single command line option for specifying the server's IP address ("--ipaddress" ?), instead of requiring all of --playeraddr, --cliaddr, --streamaddr, --httpaddr. I'm guessing that nearly everyone using these runs the entire server from a single IP address.

JJZolx
2007-04-27, 17:14
Please note that the new namespace based preferences code stores prefs files
in a directory, the default location of which can be overridden
by --prefsdir.
(--prefsfile is retained to specify the location of the old style preference
file during the migration)

BTW, I just tried the new --prefsdir option thinking that the existing prefs directory would be migrated to the new location. It wasn't, but perhaps it's not intended to be.

If the designated prefs folder is empty then the server fails to start and nothing is logged.

Triode
2007-05-03, 13:01
> BTW, I just tried the new --prefsdir option thinking that the existing
> prefs directory would be migrated to the new location. It wasn't, but
> perhaps it's not intended to be.
>
> If the designated prefs folder is empty then the server fails to start
> and nothing is logged.

Hum - should definately startup and either migrate or re initialise prefs.
I can't remember which.

I'll look at, but not for a couple of days

Adrian

Triode
2007-05-04, 17:31
>> BTW, I just tried the new --prefsdir option thinking that the existing
>> prefs directory would be migrated to the new location. It wasn't, but
>> perhaps it's not intended to be.
>>
>> If the designated prefs folder is empty then the server fails to start
>> and nothing is logged.
>

I'm not seeing this - could you start with --debug prefs and post what you
see.

JJZolx
2007-05-04, 20:13
>> BTW, I just tried the new --prefsdir option thinking that the existing
>> prefs directory would be migrated to the new location. It wasn't, but
>> perhaps it's not intended to be.
>>
>> If the designated prefs folder is empty then the server fails to start
>> and nothing is logged.
>

I'm not seeing this - could you start with --debug prefs and post what you
see.

Hmmm, I seem to be getting different behavior when run as a service on Windows, which is my usual approach, and running from a command line. Run from the command line, the --prefsdir is picked up and used correctly.

The issue appears to be with the --prefsdir option itself. Now that I recall, I had the exact same problem with the --prefsfile option when SlimServer was run as a service.

http://bugs.slimdevices.com/show_bug.cgi?id=4253

Which debug switch would show me the command line options that are passed to SlimServer? I'm not sure the switch will work, as SlimServer doesn't start up when run as a service and either --prefsfile or --prefsdir is designated.