Cotonti / Open Source PHP Content Management FrameworkContent Management Framework

Forums / Cotonti / Support / Auto-Prune - Siena

anotherfruit
#1 2011-04-10 10:03


Members

Hi,

I noticed auto-prune topics = 365 is the default setting of 0.9.0.

In our case the forum is used by a small group as web workspace on a daily basis since 2007 so we need all the posts available. I found the old posts in the db but setting autopruning to 10000 didn´t bring them back. Is there a fast way to undo the default auto-pruning?

Thanks in advance.

Added 1 months later:

--- push ---


This post was edited by anotherfruit (2011-05-12 15:53, 3 years ago)
Trustmaster
#2 2011-05-12 16:11


Administrators
Thanked: 229 times

You're right, auto-prune should be off by default. It will be so in 0.9.2.

Setting autoprune to 10000 cannot bring pruned topics back because they have been removed from the database. You need to restore the original dump and covert it again. Sorry for that :( I'll try to find a way how to do it without reimporting the entire database.

Added 1 hours later:

I was able to restore pruned topics on this site. The way i used is described below.

Requirements: I used mysqldump tool from UNIX shell, so it may require SSH to dump data remotely on server. Or you can run mysqldump on your local machine. It also requires that you run the latest Siena trunk >= r2092 or >= 0.9.2. Don't forget to disable auto-prune by setting it to 0 on your main Siena site before importing lost records.

Step 1. Restore your old Genoa site in a subfolder.

Step 2. Convert it to Siena.

Step 3. Dump the missing posts and topics using these mysqldump commands from shell:

mysqldump -u YOUR_USERNAME -p --no-create-info --skip-comments --insert-ignore --where='fp_updated < UNIX_TIMESTAMP() - 365*86400' YOUR_DATABASE sed_forum_posts > lost_posts.sql
mysqldump -u YOUR_USERNAME -p --no-create-info --skip-comments --insert-ignore --where='ft_updated < UNIX_TIMESTAMP() - 365*86400' YOUR_DATABASE sed_forum_topics > lost_topics.sql

Substitute YOUR_USERNAME and YOUR_DATABASE with your MySQL user name and MySQL database that you have just converted.

Step 4. Enter your site's phpMyAdmin, go to Import and import lost_posts.sql, then lost_topics.sql.

Step 5. Go to AdminCP => Forums => Categories and click "Resync". This will resync section counters.

Done.

May the Source be with you!

This post was edited by Trustmaster (2011-05-12 17:46, 3 years ago)