Page 1 of 1

Easy updating code across various sites

Posted: Mon Mar 20, 2006 9:24 am
by asgerhallas
Hi,

Some years ago I startet programming a CMS that I've used for a whole bunch of sites. Now it's getting outdatet, and I'm planning to start again with a new one. But this time I'd like to plan it a little better. The thing of most importance to me, is the posiblity to upgrade the CMS easily on all running sites. I've thought about letting all the sites share the same code like this:

/web/CMS/ver1
/web/CMS/ver2
/web/CMS/ver3
/web/CMS/ver3_specialclient
/web/CMS/...

/web/site1
including from /web/CMS/ver3
/web/site2
including some from /web/CMS/ver3_specialtclient
and the rest from /web/CMS/ver3
/web/site3
including from /web/CMS/ver1

I would let a config-file decide which objects/files to include from where, and in that way be able to control which version they use, and maybe include some slightly altered objects from other directories in case someone needs a special version of the CMS.

Now my questions:
1. Is this a good way to solve the versioning/upgrading problem?
2. I need a database to keep the content, but the structure of this database may grow from version to version. Is it a good idea to have a central database storing content for all the sites? Or is there another way to easily update the structure of all the databases used for each site?

Hope you can help me figure this out...

/Asger

Posted: Mon Mar 20, 2006 11:32 am
by ed209
This is an issue I will be tackling soon also. I'm not sure how big the web sites are that rely on your CMS or how much functionality there is, but for my project where the sites are small (max 10 pages) I am thinking of having a central CMS and updating the web sites html pages. As they are all on the same server I can just copy the changes to the root folder for that site. That way I only have the CMS in 1 place.

I think blogger.com do the same thing - only via ftp details you submit.

Posted: Mon Mar 20, 2006 12:00 pm
by Christopher
I have a set of applications that are delivered from multiple servers, each with hundreds of subsites. I do something like you describe with application directories outside of HTML space and different sub-sites running different versions. It is a Front Controller design so that is very easy. Each sub-site has its own config file, but all have identical index files. New sub-sites are created on the latest code, old ones are left on their codebase. Upgrades of sub-sites to the latest version of the code is only done as needed. I use rsync (over SSH) and custom rollout/rollback shell scripts to keeps the codebases on all servers in sync.

Posted: Tue Mar 21, 2006 7:55 am
by jmut
I guess it depends on the control you have over stuff.
But I would go with subversion/cvs.

Re: Easy updating code across various sites

Posted: Tue Mar 21, 2006 8:35 am
by Roja
asgerhallas wrote:1. Is this a good way to solve the versioning/upgrading problem?
Research version control systems. CVS and SVN are key examples. Both can deeply improve the situation you describe.
asgerhallas wrote:2. I need a database to keep the content, but the structure of this database may grow from version to version. Is it a good idea to have a central database storing content for all the sites? Or is there another way to easily update the structure of all the databases used for each site?
A suggestion I'd make here is adodb, and its xmlschema.

As the database changes, you can import the new xmlschema, which will automatically perform any changes needed - ie, alter table, add row, etc. Its really quite amazing once you start working with it.

Any questions, let me know, and I'll be happy to explain further.

Posted: Wed Mar 22, 2006 3:41 am
by asgerhallas
Thank you very much...!!!
I will look further in to subversion to see if it can help me carry this out... Actually, I can't really figure how it will help updating the codebase between multiple "ditributions" on the various sites. Can I have a hint?

And then ADOdb looks very cool! I've been looking a little into the PEAR DB-layer, what's the differences between the two of them? Which one should I choose?

aborint, you wrote that you leave the old sites on the old codebase and only update them if needed - but when you update them, how do you keep it simple, maintain compability and so on, if you have lots of sites?

Posted: Wed Mar 22, 2006 3:43 am
by Christopher
asgerhallas wrote:aborint, you wrote that you leave the old sites on the old codebase and only update them if needed - but when you update them, how do you keep it simple, maintain compability and so on, if you have lots of sites?
I write scripts that can do each upgrade.