Page 1 of 1

Auto Update

Posted: Fri Sep 16, 2005 7:34 am
by kettle_drum
Hey all,

I have just finished developing a fairly large system that will be rolled out about 10-20 times a month to different clients and im already having trouble with updating the live code and am looking for any ideas/solutions that could be used to automatically update each site without manually uploading the new files.

The users are mainly not technical and so i dont really want the user to have to click a button within their admin area to activate the update but rather remotely update the code from an admin system on our end.

I of course have access to all the sites data via ftp/ssh so there is no trouble in uploading the new files etc so i could simply upload the files to all the sites and have done - but some updates may effect database structure and content so there will also need to be some kind of SQL file executed to provided these updates.

Any ideas on how to best do this? Or how have you done it on previous projects? Know of any open source systems that use a similar method to update the content?

I'd welcome any comments or ideas.

Posted: Fri Sep 16, 2005 7:48 am
by feyd
could upload the SQL file to them as well, along with a script that can execute that file and return a success result to your server. You'd them probably delete the update SQL and script.

Re: Auto Update

Posted: Fri Sep 16, 2005 8:38 am
by Roja
kettle_drum wrote: Any ideas on how to best do this? Or how have you done it on previous projects? Know of any open source systems that use a similar method to update the content?
Using Adodb's xml schema, you can send xml files that contain both sql data *and* schema changes. Adodb handles the whole thing transparently for the most part, changing any tables that need to be changed based on the schema.

That way, using just xml and a simple "update" page, you can update anything db-related.

Beyond that, ie, updating program code, is a little harder. Because so many sites vary in the user and permissions of apache (some running cgi, some running suphp, some running module) you either set the permissions to allow the webserver to overwrite the files (dangerous/bad), or make a directory that can accept drop in replacements (somewhat tricky).

Posted: Fri Sep 16, 2005 10:57 am
by timvw
Although i can't provide good examples anymore, but i believe ADOdb XML functionality was a major PITA..

Although i'm not very familiar with it, and i think it will take a week or 2 before it's released, you might want to have a look at the new PEAR (1.4) installer and use that for distribution of your files, think remote install..)

Posted: Fri Sep 16, 2005 12:07 pm
by Roja
timvw wrote:Although i can't provide good examples anymore, but i believe ADOdb XML functionality was a major PITA..
I've used it for about a year, and I can say that there is *one* place that I've found that to be 100% true: Cross-DB support.

Oddly, while adodb itself is built explicitly for cross-db support, I've run into dozens of problems with xml-schema's behavior on postgres. It was developed by different authors, and its not really being maintained, so unfortunately, that portion truly causes me serious pain.

With that said, on pure mysql, its *fanstastic*, and I honestly can't imagine an easier way to do sql-as-xml, from data to schema, all in under 50 lines (for the implementation, not the library itself) generally.

Its been bliss!