We have an EE site that uses one database. That database is used for both production and for development. If we push a new template to our dev environment will we ever run into an issue where the template syncs to the database and makes it available in production, too?

What about if we have save_tmpl_files enabled? Will that prevent any syncing?

1 Answer 1


Here's how it works. Out of the box templates are stored in the database. When you allow the template "to be saved as a file" it also copies the template to a location of your choice as a .html file.

Personally I use this all the time as then you can get your templates under version control, refactor them to a controlled directory ect. Not to mention the easiness of writing templates with your chosen IDE, rather than via the EE (In your face) interface.

When you are saving templates as files, and you change a template file externally from EE, EE will load the template from the database or file depending on which is most recent (see Saving templates as text files for full details), until you syncronise your templates (Design > Templates > Syncronise Templates). This screen exposes and compares the template last save with the file last save and allows you to update DB templates with the latest file.

This way, if you turn 'Save Template Revisions' (Design > Templates > Global Preferences) you can use that tool to go back through saved DB templates, update via the file, sync (causes a new entry in the DB), continue to roll back or proceed as required.

So, in summary by trying to drive 2 EE sites from one database the answer is yes, pushing a template to the dev box will cause the Database to syncronise eventually, making the template available on the live server. You're best bet is to seperate the databases. It seems likee folly to try to drive both the dev and live from the same DB, as anything you do on dev will effect live, and dev in turn will suffer from live loading as well. If you must why not set up a cron to regularly duplicate the live database to a development database, if you're really worried about indexes???

  • This was a big help. Really appreciate the informative reply! Commented Jun 15, 2015 at 17:08
  • Glad I could help :) FYI, if you set up a database sync, you can keep seperate dev and live template files, you'll just need to re-sync your files after each DB copy.
    – Blatant
    Commented Jun 16, 2015 at 8:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.