Thanks for your replies.
So, I'm doing it but I have a query taking a very long time (more than 14 hours so far). I think it is long for a not so big forum ( 3145 topics, less than 33000 replies).
Code:
UPDATE jos_kunena_topics AS tt INNER JOIN ( SELECT m.thread, m.hold, COUNT(DISTINCT m.id) AS posts, COUNT(a.id) as attachments, MIN(m.time) AS mintime, MAX(m.time) AS maxtime FROM jos_kunena_messages AS m LEFT JOIN jos_kunena_attachments AS a ON m.id=a.mesid WHERE m.moved=0 GROUP BY m.thread, m.hold ) AS c ON tt.id=c.thread INNER JOIN jos_kunena_messages AS mmin ON c.thread=mmin.thread AND mmin.hold=tt.hold AND mmin.time=c.mintime INNER JOIN jos_kunena_messages AS mmax ON c.thread=mmax.thread AND mmax.hold=tt.hold AND mmax.time=c.maxtime INNER JOIN jos_kunena_messages_text AS tmin ON tmin.mesid=mmin.id INNER JOIN jos_kunena_messages_text AS tmax ON tmax.mesid=mmax.id SET tt.posts=c.posts, tt.attachments=c.attachments, tt.first_post_id = mmin.id, tt.first_post_time = mmin.time, tt.first_post_userid = mmin.userid, tt.first_post_message = tmin.message, tt.first_post_guest_name = mmin.name, tt.last_post_id = mmax.id, tt.last_post_time = mmax.time, tt.last_post_userid = mmax.userid, tt.last_post_message = tmax.message, tt.last_post_guest_name = mmax.name WHERE moved_id=0 AND (tt.id BETWEEN 1 AND 95020)