Search code examples
phpgitsvnversion-controljoomla

How to use source control with Joomla while allowing users the ability to continue making content changes on the production server?


Scenario:

My team manages multiple Joomla websites for our clients. While we manage the development/hosting of the sites, the clients do all of the content updates (creating articles, content, uploading images etc...)

We run these websites in the following standard configuration where we have

  • A development server
  • A staging server
  • A production server

The client makes all of the content updates to the production server (on a daily basis). The other two servers are used primarily for new development and testing.

We currently are using, BitBucket as our SVN for these websites (we are just starting out with this). Currently all files pertaining to the website are stored in the repo.

The Problem

Based on our current setup, if a developer makes changes to the dev environment, and that change set is then pushed to the production environment, we end up overwriting all of the content updates that our clients have made in the production environment.

My Question

How do we successfully utilize a source control system, and maintain the flexibility to allow our clients to continue to make updates directly on the production server, without forcing them to make content changes on dev, staging, and then production?


Solution

  • While you briefly described your workflow, there are some things to be considered. There is no general rule, but look into the following suggestions:

    • Put into version control JUST the extensions you have developed (template, components, plugins etc.). The customizations are anyway the only things you add to Joomla. Hopefully no core hacks. Alternatively if you really want to version the whole installation, you should at least ignore media folders that are changed by the clients / you. I see no need to put the whole Joomla site under version control.

    • I imagine your clients are not actually changing PHP scripts, just media files and database entries. You should only push to production code and / or database schema changes.

    • If you are relying on a commit - push to FTP feature, or manually pushing files, I would suggest looking into building a distributable version of your changes, in a form of a package that can be deployed via the Extension manager. Building packages can be done in one click with a tool like Phing. For example if you make some changes to the template, create a new template version, create the package and update first the staging server / testing server and if all goes well, the production.