Delete previous versions of ALL pages/content

Permalink 2 users found helpful
Hi All

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

View Replies: View Best Answer
Mnkras replied on at Permalink Reply
Mnkras
not easily at this time
carlos123 replied on at Permalink Reply
Okay...if it's not easy can you or someone else at least give us the name of the tables involved in storing old revision content so that we might figure out how to do our own deletion?

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.

Carlos
ToddBjarnson replied on at Permalink Reply
Ya I have the same problem, but I'm still in development! I can't even start fresh with a theme anymore. The whole project is basically ruined. Going to WP tomorrow probably this is so fail.
JohntheFish replied on at Permalink Reply
JohntheFish
The solution is more one of organisation of the project before you start. I have been working with 3 or 4 installations for each project:

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.
ToddBjarnson replied on at Permalink Reply
Thank you JohntheFish, that kind of answers my question but I'm really
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,

TB
JohntheFish replied on at Permalink Reply
JohntheFish
For a fresh start the easy option is to reinstall.
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.
carlos123 replied on at Permalink Reply
Hmmm...very interesting.

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.

Carlos
fowlesp replied on at Permalink Reply
Hi Carlos,

I think you might be on to something here - at least until C5 comes up with a real solution
codingpenguins replied on at Permalink Reply
This is very interesting, but the way I do it (which I have yet to have complaints) is go through all pages/files and only keep the latest version. Then go to the CollectionVersions in the database and change the cvID to 1 and change the cvcomments to "Initial Version", check cvIsApproved, and verify cvAuthorUID, cvApproverUID is 1.
JohntheFish replied on at Permalink Reply
JohntheFish
I started a threadhttp://www.concrete5.org/community/forums/customizing_c5/organising...
to catch just such tips as yours, but it seems to have got lost too far down to be noticed over the weekend.
fastcrash replied on at Permalink Reply
fastcrash
still not easily at this time ?

my site not live yet, but already have 5300+ block version, do not know how to clean this all
keeasti replied on at Permalink Reply
keeasti
In 5.6.1.2 I was able to clear out all old versions by running a slightly modified version of the 'Remove Old Page Versions' job.
okapi replied on at Permalink Reply
okapi
Cool, but too bad you did not share your solution...
JohntheFish replied on at Permalink Best Answer Reply
JohntheFish
okapi replied on at Permalink Reply
okapi
Wow, thank you so much, John! An add-on like that has been on my personal wish-list for a long time! That tool works perfectly, thanks for your work, thanks for providing it for free!

Cheers,
Michael
keeasti replied on at Permalink Reply
keeasti
In case anyone is interested in doing it manually, have a look here:
http://www.concrete5.org/community/forums/usage/clear-out-version-h...
keeasti replied on at Permalink Reply
keeasti
@okapi - the solution was actually in a thread you posted on ages ago ;)
okapi replied on at Permalink Reply
okapi
You're right, i'm sorry, i didn't remember.
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.
keeasti replied on at Permalink Reply
keeasti
:)
Jupiter replied on at Permalink Reply
Jupiter
Please reinstall concrete5 ....this is best option..
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
keeasti replied on at Permalink Reply
keeasti
I think if you just want to delete old versions of pages then John's fine add-on or the manual method probably is less disruptive
okapi replied on at Permalink Reply
okapi
"Extreme clean" by JohntheFish totally fits my needs (delete ALL page versions) and is very easy to use. So for me, it's the best option.