ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Advice moving DB templates to flat file

January 05, 2012 1:40pm

Subscribe [1]
  • #1 / Jan 05, 2012 1:40pm

    Trend Hunter

    81 posts

    Hi all,

    Will soon be running an upgrade from EE1.7 to EE2.3 (have done something of a test run on a dev server already). Although there is quite a bit to change in order to “convert” things over to a working format - I think I’ve got it mostly down.

    One thing I would like to do is move our templates from the DB stored method as we are currently using, to the file storage method such that templates then appear as php files under /templates in the expressionengine directory of the new EE2.3 app.

    Is anyone aware of known issues or problems when making this move? i.e. does something work one way if in DB stored mode but must be altered to be used in file mode (other than file permissions). Specifically I’m thinking about EE tags like {embed=..} and whatnot.

    Also would it be recommended to make this move at the same time as a 1.7 to 2.3 upgrade, or would it be best if the tasks were staggered?

    Thanks!

  • #2 / Jan 06, 2012 4:07pm

    Dan Decker

    7338 posts

    Hi Trend Hunter,

    There are no issues with using templates files, ExpressionEngine treats them exactly the same. I would suggest that you perform the update, then make sure everything is in working order and then turn on templates as files. Let us know if you need anything along the way!

    Cheers!

  • #3 / Jan 09, 2012 9:29am

    Trend Hunter

    81 posts

    Hey Dan,

    Thanks for getting back to us. Sounds good. Is there a particular way you suggest moving from DB stored templates to file stored templates? Is there some sort of script we can run to do the copy and create? or is it a manual process?

    (I assume the EE in browser template editor still works in the file scenario as well?)

    - John

  • #4 / Jan 10, 2012 8:41pm

    Sean C. Smith

    3818 posts

    John,

    In EE 2.x template files is super easy. First you need to go to Design > Templates > Global Preferences and turn on “allow templates to be saved as files” and fill in the correct “Basepath to Template File Directory”.

    Once you’ve done that go to esign > Templates > Syncronize Templates and then select the templates you would like to sync and hit submit. Voila, you’re done.

    If the file does not exist it will be created. If the file exists but the template in the database does not exist the database version will be created. And yes you can edit your templates in both the CP and your text editor of choice.

    Let me know if there is anything else I can help you with.

    Sean

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases