Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Robert Rawson 13 posts 33 karma points
    Jun 17, 2013 @ 12:00
    Robert Rawson
    0

    Umbraco Demo Site Advice

    Hello,

    We have built an umbraco demo site to showcase the CMS to our potential clients.  We want to make the URL available with some common login details that we can leave with the client so they can have a play with the system etc but we would like the system to restore itself back to its original state each night and I was wondering what might be the best way to do this.

    I was tinking about scripting the DB out as a .sql and running it as a scheduled task each evening which would run the sql script against the DB each evening.  But I am unsure how the umbraco.config would behave, I assume I might need to automate the site to republish also?

    If anyone has any tips on how they might have achieved this I would be extremely grateful.

    Thanks

  • Robert Rawson 13 posts 33 karma points
    Jun 18, 2013 @ 11:44
    Robert Rawson
    0

    ok, update.

    I have created an sql of the db and am running a scheduled task which runs the .sql against the DB, this rebuilds the DB to its original state and I can this runs successfully in the back end.  However due to cache etc the front end is still seeing the amended content.  I have to republish the page/site to update it.

    Is there anything I can schedule to republish all pages or delete cache to force an umbraco rebuild?

     

    thanks

  • Funka! 398 posts 661 karma points
    Jun 18, 2013 @ 19:33
    Funka!
    0

    I wonder if you could write a shell script to (1) stop IIS, (2) copy something like a clean /App_Data/umbraco.config.ORIGINAL over the existing umbraco.config file, (3) clean out (delete) the /App_Data/TEMP/ExamineIndexes folder, then (4) restart IIS?

    Let us know what you end up with!

  • Rich Green 2246 posts 4008 karma points
    Jun 19, 2013 @ 10:09
    Rich Green
    0

    Hey,

    Just write something to delete Umbraco.Config, Umbraco will automatically recreate it.

    Rich

  • Robert Rawson 13 posts 33 karma points
    Jun 19, 2013 @ 11:27
    Robert Rawson
    0

    Hi,

    Just an update, deleting the umbraco.config didnt work.

    What we have done is the following. 

    • Scripted Out the database as a .sql
    • Create a SQL schedule that runs the sql script against the DB which rebuilds it
    • Created a generic handler in the solution which called the republish method detailsed in http://bit.ly/12Jpgy4 - everytime the page is called the handler runs which calls the republish method in the API
    • Set our website monitoring software to visit the page which triggers the republish.

    Hope this helps someone creating a self resetting Umbraco site, if anyone knows of a more efficient way to achieve this, I would be grateful.

  • Rich Green 2246 posts 4008 karma points
    Jun 19, 2013 @ 13:17
    Rich Green
    0

    Hey Robert,

    Well done for updating the post with solution.

    Be interested to know what you mean by deleting the web.config not working if the pages within the scripted site are published.

    Rich

  • Robert Rawson 13 posts 33 karma points
    Jun 19, 2013 @ 14:57
    Robert Rawson
    0

    When I manually deleted the umbraco.config the site did not seem to automatically regenerate a new one and the old content remained.

  • Rich Green 2246 posts 4008 karma points
    Jun 19, 2013 @ 14:58
    Rich Green
    0

    Strange.

    Glad you go it sorted!

    Rich

  • Funka! 398 posts 661 karma points
    Jun 19, 2013 @ 18:58
    Funka!
    0

    Hi Robert,

    Is it possible that the umbraco.config file was cached in memory and thus deleting it didn't work? Hence my suggestion of stopping IIS then restarting it. Does that work if you try it?

    Good luck!

  • Robert Rawson 13 posts 33 karma points
    Jun 21, 2013 @ 15:10
    Robert Rawson
    0

    Restarting IIS is not an option to us.  Just FYI, rather than using SQLScripts to rebuild the db as i was getting loads of syntax errors, backed up the DB as a .bak and run the following query on a schedule which works perfectly :)

     

    USE master

    GO

     

    ALTER DATABASE UmbracoDB SET SINGLE_USER WITH ROLLBACK IMMEDIATE

    GO

     

     

     

    RESTORE DATABASE UmbracoDB FROM DISK=N'D:\websites\Umbracodemo\UmbracoDB.BAK' WITH  FILE = 1, 

    NOUNLOAD,  REPLACE,  STATS = 10

    GO

     

    ALTER DATABASE UmbracoDB SET MULTI_USER

    GO

  • Funka! 398 posts 661 karma points
    Jun 21, 2013 @ 19:49
    Funka!
    0

    What about touching (re-copying over itself) the web.config, which causes the app pool to reset. (Instead of all of IIS.) Does this cause the umbraco.config file to be read back into memory from disk?

  • Anton 36 posts 67 karma points
    Jun 24, 2013 @ 16:46
    Anton
    0

    Hi,

    Sounds all very complex.  We went down the same road as you did and tried all the SQL restore tasks etc.  Finally we settled on simple xcopy command:

    1. Create good working version of Umbraco site (fully published content) using SQLCE (SQLCE uses the *.SDF file stored in App_Data)
    2. Duplicate the Web Root Folder - Call it "Restore" or something distinguishable
    3. Create a xcopy bat script
    4. Create a Windows Scheduled task to run every hour(or however frequent) to run bat file that will "Restore" and replace the contents of your web root.
    5. Note your DB since its also be restored to original snapshot 
    Here's our demo site with full access to Umbraco backend 
    Hope that helps.
    Anton
Please Sign in or register to post replies

Write your reply to:

Draft