Delete previous versions of ALL pages/content2 users found helpful
I'm developing a C5 site, and would now like to make it "live" (transfer to an external host etc)
Is there away to remove the change histories that I've accumulated during development, so that once live only "real" changes will be saved/recorded
It's ridiculous that an entire history of page and block revisions while developing a site will go right on up to the live site along with the content we want on the site.
What a bloated mess.
Development - play with ideas, make my mistakes, leave lots of unused versions.
Offline Stage and/or Online Stage - Install successful ideas, write content. No playing about because this will be moved or copied to the final site.
Final Site - what it says, no playing, no risks, just finished content copied or moved from the stage(s) when I am ready to go live.
At various points I copy the stage(s) back to the development, but I never copy development forward. When I am ready to go live, the online stage gets cleaned up and copied or moved forward to the live site.
asking how to delete all kinds of versions to start fresh... they don't make
it easy but I think I figured it out about 2:30 this morning.
Thanks for the feedback,
Once you have a clean install with your basic configuration, make a database backup. You can then simply replace the database with the backup to always get back to that point without having to do a clean install.
Same goes for backups at various stages of development.
PS, just re-read your post, maybe what you meant by start fresh was to remove version history for each page, not start fresh with C5. You can only do that on a page by page basis, but at least you can select all old versions of a page and delete them in one go.
Now that I have a whee bit more experience using C5 and mucking around with it under the hood so to speak...me thinks this might make for a good plugin.
May I suggest (in answer to my own question posted above in a previous message here) that a way to delete past revisions might lie through the following...
1. With a fresh install of C5, add a page. Call it junk or whatever you want.
2. Do a MySQL dump of the database and store it in a file.
3. Publish and then edit the page to create some revision.
4. Do a MySQL dump of the database and store it in a different file.
Now use Meld (a software program) available under Linux to compare the two data dumps.
The differences will point out which database tables are affected by a revision history being stored in the database.
Go in manually and delete all such revisions created and stored for the given page id created above.
Then run C5 for a bit, kick it's tires, make sure nothing breaks or otherwise runs weird and voila! Goodbye useless revision history (useless if one doesn't want it of course).
A PHP script could be written to loop through each page in your site and delete all revision history.
That's what I will personally do as time permits. If I perfect the above process...I'll make a plugin (or external PHP script that runs on the database to clean it up) out of it.
I think you might be on to something here - at least until C5 comes up with a real solution
to catch just such tips as yours, but it seems to have got lost too far down to be noticed over the weekend.
my site not live yet, but already have 5300+ block version, do not know how to clean this all
Actually i was looking for an add-on, because i was afraid of messing up the database...
For a handy solution, i'm happy with John's add-on now.
Once you have install with normal configuration, make a database backup(It's very important). You can then simply replace the database with the backup to always get back to that point without having to do a fresh install.
But versions are must be same because older versions has less tables than latest version