Is there an SQL script I can run that will archive my posts in the database rather than by using the Archive Admin option?
I have had a lot of activity and using the the admin option always timed out. I increased the timeout setting but it was running for 9 hours last night and did not complete. Obviously my site was running very slowly during that time.
I have this:
SELECT T_DATE, FORUM_REPLY.* FROM FORUM_REPLY LEFT OUTER JOIN FORUM_TOPICS ON FORUM_REPLY.TOPIC_ID = FORUM_TOPICS.TOPIC_ID WHERE T_LAST_POST < '20050301000000' AND FORUM_TOPICS.FORUM_ID IN (4, 1) AND T_ARCHIVE_FLAG <> 0
which will select each post to be archived but the logic to actually perform the archive is in a loop which I cannot replicate in pure SQL.
Have you tried running the archive in stages to try and avoid the timeout? I.e., Archive those posts older than a year first then 6 months and continue on down until you've archived all the posts you want to. If it's timing out on a year, you could make some edits to allow you to archive posts older than 18 months or 2 years first.
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.”
You could theoretically convert the script into a stored procedure and schedule it to run every so often. It is BETA so I would test it on a copy of your database first.