Best way to clean up a concrete5 demo site

Permalink
We're in the process of setting up a concrete5 demo site so prospective clients can have a play with some of the modules we deem most interesting. So, let's say we've created a website, added a theme to it, arranged things a bit and added some content to each of the pages showcasing the modules.

Since we're demonstrating the administrative features of each module anyone can login and change things on the site. We'd like to reset the site to a clean version every hour.

We've already had a look at this How To:
http://www.concrete5.org/documentation/how-tos/developers/concrete5...

Using the method described in the how to it seems a bit complicated to re-include our own default content into the site after it gets reset.

We're wondering if it wouldn't in fact be easier to just create a script that wipes the DB clean and runs some SQL queries to put back all the tables and the data and, in a similar manner, wipes the home folder of the site clean and then puts back all the files and folders we originally had in our clean site.

Are there any problems with this clear and copy procedure? Perhaps some security issues we should consider that make a proper reinstall of concrete5 preferable?

Thanks!

whimsmedia
 
Mainio replied on at Permalink Best Answer Reply
Mainio
I think the described method in the how-to is the "best way" if you ask for best practices. You can also create your starting point with this:
http://www.concrete5.org/marketplace/addons/sample-content-generato...

Other (manual) option would be to setup the site and take a complete database backup at the point when you're satisfied with it. Also, backup the /files/ directory. And setup the script to import the whole dumped database and replace the contents of /files/ dir with its original content. In this case, no need to re-install concrete5 each time, just revert the database to the point where it was initially.

Antti
whimsmedia replied on at Permalink Reply
whimsmedia
Thanks for that additional link Antti!

The "manual" method you described is what we've setup as a test right now. However, instead of just wiping the files folder our script wipes out everything and replaces all files with those from the last "clean" backup.

We're just worried that by doing this we might be losing some important file permissions in the process in ways we don't realize at the moment.

Thanks again,

Chris
Mainio replied on at Permalink Reply
Mainio
No problem.

If you manually wipe out /files/ and then put the original /files/ to its place, I'd suggest just running
chown -R original_user:wwwprocess_group files/
chmod 775 files/


That will give all the necessary permissions for the web process to access that dir.
whimsmedia replied on at Permalink Reply
whimsmedia
UPDATE: We've set the file cleaning procedure to just erase the content of the files folder and then put back all the items stored in the clean backup. Files are automatically copied with the exact file permissions they originally had, 755 for most of them.

As far as we can tell It looks like the procedure works fine without any kind of errors or security issues.

I'm still going to mark the original answer as best answer as it does bring interesting information into play and, although the "manual" method works as well, the sample content package added on top of the reinstall reset script we originally found seems more suitable as "best practice".
sitodemmers replied on at Permalink Reply
Hi!

Ik like to achieve the same...could it be possible for you to help me out on this?
I would be forever greatfull!
Regards!

Sito