One of our system administrators noticed that the database of one our clients had grown to 6 Gigabyte. After a small investigation we decided to change the configuration and set a limit on the max number of versions. But to initiate this, we had to write a cleanup script first. After trying to run it on our staging environment, we noticed timeouts. After doing some research the problem seems to be that there huge amounts of documents in the table: tblWorkPage for the arabic language, this query results in:
COUNT(*) as nrofversions, fkPageID, tblWorkPage.Name
group by fkPageID, tblWorkPage.Name
order by COUNT(*) desc
nrofversions fkPageID Name93673 9050 صالة سكاي تيم93672 4194 البحث عن الرحلات93671 14075 (اجتماعات عالمية) مع الخطوط الجوية الصينية الجنوبية93663 10376 معلومات عن اجتماعات عالمية93662 4209 الخطوط الجوية الكينية93661 4208 خطوط دلتا الجوية 93660 4201 الخطوط الجوية الفيتنامية93657 14777 خطوط زيامن الجوية 93655 10377 مطار هيثرو في لندن93652 15274 الخطوط الجوية اللبنانية تنضم إلى سكاي تيم
The problem is that using the stored procedure: editDeleteObsoletePageVersions would take way to long to delete them.
So 2 questions:
-Is this a known error in episerver 6?
-How can we remove old those unwanted versions?
TableWorkPage has a lot of dependencys so removing the versions do take some time. I don't know if I would call it a known error, but more a feature that if you do not set the maxversion attribut all versions will be saved.
To remove the versions I would runt the SP in bulks. Contact EPiServerSupport as I do belive they might have a script ready for you.
Thanks for your answer, but all those versions where created exactly one minute after each other, so it seems that some automatic process created them, thanks for your suggestion.
Well if you get versions created exactly one minute after each other that in it self gives you a hint. Is there any schedule job running every minute on the site? Are you waiting for a minute anywhere in your code, etc?
I have been struggeling with this problem on a previous site. The problem was an automatic script that created a new version of the page every 15 minutes.
Since the problem was a few selected pages and subpages, my approach was to export and then import the affected node/nodes (EPiServer only exports the last published version). Then I deleted the old node/nodes with a SP, editDeletePage i think it was.
Btw, this was in Epi 5, but I guess it's the same thing now.
Good luck.. :)
No, we have some scheduled jobs, but those have nothing to do with those specific pages, i think it's some kind of glitch in Episerver where unpublished version and date goes wrong.
That's sad. Well, my approach might work to remove those unwanted versions, but it won't solve the problem in the long run.
Could be a bug in EPi but can't say it's something I have heared of before.
Can you reproduce the issue on a vanilla site with the alloy package?
Reproducing is hard, because it seems that the unwanted duplication is stopped, i am investigating the content tables in the database now.