Version Control Best Practise

Hi All

I have a question about version control best practise - This issue has been discussed a few times before but most articles I looked at are 5 or more years old

Since MODX snippets and chunks are stored in the database, it makes it tough for a version control system to track changes

I think it could be overkill to track all database changes and find a way of packaging them so they can be deployed in liquibase or similar

The best approach I’ve seen so far is to call custom php files from a template, from this point the custom code is managed on the file system rather than the database, so can easily be managed by Git - But, at this point I guess we’ve moved away from the design of MODX and perhaps missing out on some key caching features of snippets and chunks

I know PIMCORE manages this by saving all data as php files, which are then sync’d with the database

Any suggestions / tips here would be most welcomed - I have raised this question as I don’t want to be managing multiple websites by manually entering php / html code into a GUI

Many thanks,
Jon

Not sure it answers the whole question but I use VersionX. Simple and very powerfull.

1 Like

Have a quick look here: https://docs.modx.com/current/en/building-sites/elements/static-elements#automatic-static-elements-creation

This is also very powerful: https://docs.modmore.com/en/Open_Source/Gitify/index.html

Hope that helps for the moment?

1 Like

Hi @jenswittmann

Static Elements seems to be exactly what I’m looking for - I’ve just upgraded to modx 2.7 to use the automated feature, which works great for new chunks and snippets. Do you know if there is a way to create the static elements for existing chunk and snippets?

I’m hoping that I don’t need to manually change them all via the Manager

Many thanks,
Jon

Maybe one of this Plugins can help you? :slightly_smiling_face: