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.

Best Method for Staging new updates to an active site

October 24, 2008 1:06pm

Subscribe [4]
  • #1 / Oct 24, 2008 1:06pm

    Joe Wolin

    206 posts

    I’m getting ready to do a semi-major update to the look of an active site and would like to know the best method for “staging” these updates.  The content (weblogs) for the most part will remain the same, but I’m redoing the core templates (look and links). 

    I want the current site to remain active and be able to test and develop with new templates.  Then when all is good, make the switch over to the new design.

    Can someone recommend a technique they use in doing this sort of overhaul so as not to disrupt the current site?

  • #2 / Oct 24, 2008 1:25pm

    Crssp-ee

    572 posts

    How many templates, templates groups are there, it seems like it would be necessary to back then up first, then duplicate them. Working with the duplicated ones for the new design?
    Interesting to see what great advice you get then analog, there just may be better methods.

    You didn’t want to do it on a local machine but on the live server? might help to know…

  • #3 / Oct 24, 2008 1:26pm

    Lisa Wess

    20502 posts

    I just set up new template groups, something like new_blah; then when it’s ready to go live, remove the new_ and rename the old ones old_.

  • #4 / Oct 24, 2008 1:30pm

    Joe Wolin

    206 posts

    I’d prefer to work on them live.

    Currently I’ve been just renaming them (as suggested) but it starts to mess with the urls and I have to manually keep things straight in my head. 

    I’m looking for some kind of “publish as preview” type of system where I can change the current template, and view it as an administer, but not yet release it for publication. 

    Does such a feature exist?

    thanks…

  • #5 / Oct 24, 2008 1:47pm

    Crssp-ee

    572 posts

    This post may be some help, explains how to setup a preview template:
    http://www.nsteffen.com/archives/view/setting-up-a-preview-page-in-expressionengine/
    Might help with the mechanics anyways.

  • #6 / Oct 24, 2008 1:50pm

    Joe Wolin

    206 posts

    Thanks….

  • #7 / Oct 24, 2008 1:52pm

    Crssp-ee

    572 posts

    Hey Viget had a post also, check this one too:
    viget.com/inspire/building-vigetcom-in-ee-part-1
    Most of these refer to previewing posts and not templates, so it’s not quite the same :(

  • #8 / Oct 24, 2008 1:58pm

    Crssp-ee

    572 posts

    Barking up the wrong tree maybe, check:

    EE docs Template Access Restriction this ones a control panel functionality badda-bing-ee.
    Mentioned here by one D2:
    http://www.derekallard.com/blog/post/setting-up-live-look-in-expressionengine

  • #9 / Oct 24, 2008 2:47pm

    Joe Wolin

    206 posts

    Great thanks for the tips T.Gee., I’ll try to incorporate these into a new workflow…

  • #10 / Oct 24, 2008 2:50pm

    Satdaya

    41 posts

    Not sure if this is exactly what you are looking for - development environment based on entries or templates. 

    What we do is use a set of assigned variables at the top of EVERY template even if not all variables are used in that template (important for the find/replace function, read on and you’ll see why).

    Then in every single path, permalink, embed, etc, use the assigned variable for the template group.

    For example:

    {assign_variable:main_group="site"} 
    {assign_variable:lib_group="home"}
    
    {embed="{lib_group}/.header" page_title="Welcome"}
    
    <div id="nav">
    <a href="http://{path={main_group}/index">Home</a>
    <a href="http://{path={main_group}/about">About</a>
    </div>

    So, with this scenario we have two template groups: site and lib (short for library).

    When site is launched and we need to start working on more templates, make modification to existing templates, etc - we duplicate all the groups, adding _dev to each group’s name. In this example, we would create site_dev and lib_dev.  Then we do a find/replace of the assigned variables in the newly created dev groups like so:

    Find
    {assign_variable:main_group="site"} 
    {assign_variable:lib_group="home"}
    Replace with
    {assign_variable:main_group="site_dev"} 
    {assign_variable:lib_group="home_dev"}

    Then every time we finish with changes and are ready, we “push” dev to live by shutting down the site, backing up the original groups by renaming something like site_backup, and then duplicating the dev groups.  In this example, we’d be duplicating site_dev and lib_dev. 

    Then, do a find replace on the new groups like so:

    Find
    {assign_variable:main_group="site_dev"} 
    {assign_variable:lib_group="home_dev"}
    Replace with
    {assign_variable:main_group="site"} 
    {assign_variable:lib_group="home"}

    Double check everything on the (offline) live site to make sure you did good.  Then turn the site back online and after a few days or weeks, delete or store offline the backup versions, whatever toots your horn.

    This is useful only if you have a really big site with lots of moving parts, though.  And you can royally screw up easily with one step, only the most careful, meticulous person who knows EE well should be in charge of pushing dev to live.  It saves time and allows us to work comfortably in the dev version, fully test out new functionality, etc without worrying about screwing up the live site. 

    Is this the best method?  Probably not.  A little crazy, maybe.  But it’s pretty easy once you get the hang of it, have the system set up… it only takes 15 minutes to push dev to live.  And it’s a 100% EE based solution, no worrying about integrating with another solution such as file versioning like Subversion, saving templates as files, etc etc.

    I’m curious to see if anyone else thinks that it’s a good way to handle development versions of sites or not.  A while ago I needed to set up a dev version and didn’t have time to get all involved with researching best solutions, etc, and thought of this simple solution and it ended up serving our purposes great and we’ve stuck with that method for a while now.

    Oh, also - in case it’s not already obvious, the main reason we are sure to use assigned variable for every single reference to a template group is so that everything in _dev links to one another in all _dev groups - while everything in the live site links to one another.  It basically allows us to fully maintain two “mirror” sites. 

    Note that there is no security set up with this scenario - my perspective is that if someone unwittingly stumbles on the dev version, most likely through search engine, it is a mirror site anyway so they should see pretty much the same thing as the live site - if they hit a dead page because we’re fiddling with it, oh well, it happens.  I’m not crazy about leaving dev wide open - it’s just tricky figuring out a way to lock the dev version without creating a lot of additional work to “unlock” once dev is pushed to live.  Probably a plugin or something would resolve that.

    Hope that helps! 😊

  • #11 / Oct 24, 2008 3:03pm

    Joe Wolin

    206 posts

    Lisi,

    Thanks for introducing your system of deploying new templates.  Like you said, this is a personal preference for people, but there are certain best practices make life easier. 

    I like to work from an SVN database on my local machine, but that doesn’t necessarily help with displaying the “prototype” page. 

    One though is to put some conditions in the active sites template and serve up the prototype if you have permissions.

    ExpressionEngine is a great community of people and I appreciate all the constructive feedback…

  • #12 / Oct 24, 2008 3:25pm

    Crssp-ee

    572 posts

    Find
    {assign_variable:main_group="site_dev"} 
    {assign_variable:lib_group="home_dev"}
    Replace with
    {assign_variable:main_group="site"} 
    {assign_variable:lib_group="home"}

    I’m curious then Lisi, when you are talking about search and replace, how is that done EE control panel or a mySQL query command or something?

    [edit]: I see it’s a plugin maybe then?
    Find and Replace plugin
    I’m not sure my server supports this, it’s not mentioned in my php info anyways:
    This plugin works pretty much the same as the php str_replace() function?
    Guess I could test that easily enough.

  • #13 / Oct 24, 2008 3:32pm

    Satdaya

    41 posts

  • #14 / Oct 24, 2008 3:39pm

    Crssp-ee

    572 posts

    Any ideas if there’s something that should show up in my phpinfo() to verify I can use the str_replace() function, nothing shows up with “replace”. I don’t see any requirements for it
    Guess I could ask my host, sounds like something that ought to be and maybe will be in V.2 search and replace was mentioned, maybe it’s still the plugin.

  • #15 / Oct 24, 2008 3:47pm

    Satdaya

    41 posts

    I’d try the plugin.

    Sorry I can’t help with anything related to php.  Not my area. :-(

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

ExpressionEngine News!

#eecms, #events, #releases