Script Installer with existing installs

7 posts / 0 new
Last post
#1 Mon, 03/30/2009 - 10:46
rrhode

Script Installer with existing installs

Hey there,

I am not sure if this is possible but I can't find out how anywhere. I want to hook up existing installs of Joomla and whatever other scripts might happen to be installed to the Script Installer so it can update them to their latest versions. If there are 20 installs of Joomla on the server updating them all sucks. And if they weren't originally added to the server with the Script Installer then I don't get an option to upgrade them with it.

Thank you =)

Ryan

Mon, 03/30/2009 - 11:09
Joe
Joe's picture

This is, unfortunately, potentially quite challenging (and maybe not possible, depending on how closely your install matches what ours looks like). If your installs look <i>exactly</i> like what the Install Scripts creates, then it should be just a matter of making Virtualmin aware of your script. You would have to fake it out a bit, and create the scriptlog file manually (the easiest way would be to install Joomla somewhere using Install Scripts, and use the resulting file as a template), for each domain that has Joomla.

The file looks like this:

pass=
version=1.0.15
name=joomla
opts_path=/
opts_db=mysql_virtualmin
opts_dir=/home/virtualmin/public_html
partial=
desc=Under public_html
url=http://www.virtualmin.com/
user=
id=12160985992534
opts_newdb=

Where ID is the Virtualmin ID of the virtual server. You can find the ID with:

virtualmin list-domains --domain virtualmin.com --id-only

If you've done anything fancy with the install...like break out paths into other locations, run under something other than suexec+CGI or suexec+mod_fcgid or mod_php, or otherwise made serious changes, this isn't safe. Even if you haven't done anything funny, I would strongly recommend testing on a devel install first to be sure things are going to actually work and not cause subtle issues.

--

Check out the forum guidelines!

Mon, 03/30/2009 - 11:10 (Reply to #2)
Joe
Joe's picture

BTW-I know a few folks have done this with success in the past, so it definitely can be done. I believe ronald was among the first to make it all spin, and he comments here quite a bit, so he might have something to add.

--

Check out the forum guidelines!

Sun, 04/05/2009 - 10:41 (Reply to #3)
rrhode

Hi there,

I am still trying to figure this out a bit. I managed to make it work on a test but can't seem to make it work all the time.

What I did is I made a copy of my site so I don't wreck the site. I made a test script install and found this scriptlog folder that you mentioned. I went into the folder and there are domain id folders. Inside these folders are files with some sort of id that doesn't seem to be the domain id but perhaps unique for each script install maybe based on the time or something. These .script files are the ones you mentioned if anyone is wondering. I managed to successfully upgrade from Joomla 1.5.9 to 1.5.10 on my test install. I could log in and everything works fine. The version is now 1.5.10.

I did the exact same things to the live install and it doesn't work. I don't really understand why it wouldn't. It shows up when I go to Install Scripts as an existing install, however the Script column is greyed out. This happened on my test server at first too and so what I did was I changed the opts_path to try to fix it. I changed it to /httpdocs and that didn't work. I tried it blank but that didn't work. Then I tried just / and that worked. Oddly enough it was / to begin with and it showed up as a grey box. It didn't make sense to me at the time and still doesn't really because this process doesn't work on the live site. It should just be / but it doesn't work. Everything else seems to be the way I had it on the test install.

The id field inside the .script files seems to correspond to the .script file name and not the domain id that I get when I run the command you mentioned. However on the test install I entered the id of the domain to get it to work. Neither of these work on the live install. In fact I am not even sure what to name the .script files or if it matters. They seem to show up as an installed script no matter what I name them.

I take the test script file that worked sucessfully and copy it to a new file inside the domain id# folder in the scriptlog folder. I then change the path to match exactly the same way but to the live site, the database name to match keeping the mysql_prefix, the id to match the domain or the name of the script (neither seem to work), and the version # is at 1.5.9 like the test script. Everything looks like it should work just like the test did but it shows a grey box for the Script column where it normally would show &quot;Joomla&quot; in that box. Trying to change the path doesn't work like it did on the test. I don't know why that would even work. I must be missing something or doing something wrong somewhere but I have no idea what.

Any ideas what I should do?

Ryan

Wed, 04/08/2009 - 03:18 (Reply to #4)
rrhode

Ok I figured this out. Here is what I did for anyone who wants to know.

Installed Joomla using Script Installer into a subfolder of the site I wanted to update. Lets call this the Temp Install.

Script Installer creates a .script file within the domain id# folder which is located in this folder:
/etc/webmin/virtual-server/scriptlog

As Joe mentioned you can get the domain ID by typing into SSH terminal:

virtualmin list-domains --domain yourdomain.com --id-only

I backed this new .script file up.

I modified this file to match my install that I wanted to update.

The lines I modified were:

<b>opts_db</b>
You have to be careful to leave opts_db=mysql_ and just put your datebase name after that. i.e. opts_db=mysql_joomla

<b>opts_dir</b>
This is the absolute path to the install you want to update. No trailing slash.

<b>desc</b>
This is just the description but I removed the subfolder from it.

<b>url</b>
The URL to the install you want to update. Includes trailing slash.

<b>user</b>
The admin username to login to Joomla with.

<b>opts_joomla_secret</b>
This is the secret string found inside the configuration.php of the install you want to update. In configuration.php it is the line with var $secret at the start. Enter it into the .script file without quotes.

<b>pass</b>
The admin password to login to Joomla with.

<b>version</b>
I had to roll this number back to the actual version of the install. i.e. 1.5.9

<b>opts_path</b>
This must be / if your install is in the public_html folder (or httpdocs in my case). If your install is in a subfolder (i.e. http://www.yourdomain.com/subfolder) this would be set to /subfolder with no trailing slash.

Once I save this file overtop of the .script file that the Script Installer created and go back into the Script Installer within Virtualmin I am able to upgrade the install.

I can then either manually remove the Temp Install and database that I installed with the Script Installer

OR

I can have the Script Installer remove it by uploading the original .script file that the Script Installer created for the Temp Install. When it updated the install I wanted to update it renamed the .script file so it is then possible to simply reupload the original .script file and it shows up in the Script Installer. Just be sure it is the right one so you don't remove your entire site.

Mon, 03/30/2009 - 18:51
rrhode

This is very good news =)

I am getting them to upgrade my port speed to 100MBPS because its just too damn slow on 10MBPS already. So hopefully that will speed things up a little and when they are done that I can test this out.

Where is this file you mention located at?

I normally haven't moved any files. It is all running under suexec+mod_fcgi if I remember correctly.

The only things are some have 3rd party extensions installed but I won't be doing this for any sites that have 3rd party extensions that modify any core files. It would be really nice to be able to learn how to custom make my own Script Installers but for now I just want to get things running smoothly.

BTW migrating to Virtualmin Pro from Plesk was near flawless. Thank you so much for that !!! You are all wonderful, wonderful people =)

PS. I bet you are wondering what was flawed now aren't you? Well I will tell you what was flawed. One of my users made a username root for a mysql database which conflicted in the passwd file with my systems root user. Took me awhile to figure that one out. There was something else as well regarding the inability to create log rotations. Some sites did it, some sites failed at it. I haven't had time to look into it any futher but when I enable it on a server manually it doesnt work. There were some other minor things which were probably the fault of the sites and databases I was migrating. All in all it went 100X smoother than I anticipated it to. I didn't even expect the migration option to be in there but when I found it I nearly crapped myself.

Mon, 03/30/2009 - 20:43 (Reply to #6)
Joe
Joe's picture

<div class='quote'>You are all wonderful, wonderful people =)</div>

Jamie and Eric are wonderful people. I'm fair to middlin', and a bit on the grouchy side most of the time. But, I try, anyway. ;-)

[quote]PS. I bet you are wondering what was flawed now aren't you? Well I will tell you what was flawed....[quote]

We take migrations very seriously. If you have any issues you need some help with, don't hesitate to file a ticket. Since this is a very mature market with well-established players, if we want to gain market share (we do!) we have to get people moving from cPanel and Plesk to Virtualmin. If it's hard to do, people just won't make the move. ;-)

I'm glad to hear your migration has gone pretty smoothly. Jamie has done a pretty impressive job with migrations. It's actually one of the more complicated aspects of the product, as I'm sure you can imagine. Nobody does things exactly the same (though there are some accepted industry best practices that most of us are following, in one form or another, so it's very rare to completely lose functionality or have it completely altered).

--

Check out the forum guidelines!

Topic locked