Managing a Joomla Website Using Git?

I work at a large university, and I was commissioned to learn the version control system (git, svn, etc.) for managing websites. We use Joomla, which is heavily dependent on MySQL.

We currently have a barely functional system that uses a development server that clicks on a live server whenever we change a website. This is pain, and it does not always work. In addition, we can and often overwrite changes made by another developer.

We want to be able to manage content through the Joomla interface on the dev branch, and then make those changes to the test branch, and then to the master (live) branch.

Without being thrown into the weeds: my question, in fact, is a good strategy for managing websites using CMS, such as Joomla, which relies on a database?

+6
source share
1 answer

Since you also want to synchronize the database (the content is stored in db, while the images and media are on the file system), you need to execute a commit / push script to also upload the db to the file, and pull script to load the db. This can be done using pre and post hooks, http://githooks.com/ or google it.

However, there will be different parts of Joomla that you want to sync separately.

Consider three servers:

  • edit server: where content management
  • dev server: where extensions are tested and configured
  • test server
  • server

Consider three levels of information:

  • User and session data: this should not be synchronized at all, so that people do not log out, and if any users register on the production server, their username will be saved.

  • Content, user groups and assets (privileges): these are articles, news, images that must go from edit to test to production and dev (if you do not have rights for user-level content, i.e. each user has separate privileges for each content item)

  • Templates, extensions, modules, menu configurations: from dev to test to and change .

Each of these data groups will require that their own branch and their user pre-commit bindings be included in the commit / push corresponding database tables. The list of tables for each group depends on the extensions you use.

I wrote an article in Italian and for svn, but you can use some of the bash scripts that we use: http://www.fasterjoomla.com/joomla-tips/svn-per-joomla or translated by google http: // translate .google.com / translate? sl = it & tl = en & js = n & prev = _t & hl = it & ie = UTF-8 & u = http% 3A% 2F% 2Fwww.fasterjoomla.com% 2Fjoomla-tips% 2Fsvn-per-joomla

+3
source

Source: https://habr.com/ru/post/949474/


All Articles