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.
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?
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?
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.
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?
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,
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?
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
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
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!
Hey,
Just write something to delete Umbraco.Config, Umbraco will automatically recreate it.
Rich
Hi,
Just an update, deleting the umbraco.config didnt work.
What we have done is the following.
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.
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
When I manually deleted the umbraco.config the site did not seem to automatically regenerate a new one and the old content remained.
Strange.
Glad you go it sorted!
Rich
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!
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
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?
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:
is working on a reply...