Jump to content

How to mass unarchive topics with SQL

Recommended Posts

First step is to move posts from the archive database back into the regular one:

insert into ipb.posts
select archive_id,archive_show_edited_by,archive_edit_time,
from ipb_archive.forums_archive_posts

Replace ipb and ipb_archive with the correct database names for your installation.

You can restrict this to specific forums only by adding where archive_forum_id=X to the query (including the ones below).

The topics table need to be updated to reflect the change:

update ipb.topics set topic_archive_status=0

Then finally the archive table can be purged to save database space:

truncate table ipb_archive.forums_archive_posts

If you used a forum based restriction then adapt the query like so:

delete from ipb_archive.forums_archive_posts where archive_forum_id=X

Your topics should now be unarchived. If you're using any cache mechanism give those a refresh.

I've tested this on my very large boards where the combined posts table is over 9GB. Remember to check your MySQL query time limits so it doesn't get killed during the process.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...