Archiver not un-achiving topics
Submitted
Extreame™
, Apr 16 2012 07:44 AM | Last updated Apr 16 2012 07:44 AM
I have unarchived some topics, it has been over 24 hours and it still says:

I was unable to get any info on how long it takes.
IP.Board 3.3.1
This topic will be unarchived shortly.

I was unable to get any info on how long it takes.
IP.Board 3.3.1
| Status: | Fixed |
| Version: | 3.3.2 |
| Fixed In: | 3.3.3 |











15 Comments
Upgraded to 3.3.2 over 16 hours ago and I still do not have topics that have been archived, back from the abyss of the archiver
/* Now fetch the max/min if archiver is on */ if ( $this->settings['archive_on'] && $options['process'] > 0 && $restoreData['restore_min_tid'] && $restoreData['restore_max_tid'] ) { $date = IPS_UNIX_TIME_NOW - ( 86400 * intval( $this->settings['archive_restore_days'] ) ); $this->DB->build( array( 'select' => 'archive_id', 'from' => 'forums_archive_posts', 'where' => 'archive_content_date > ' . $date . ' AND archive_topic_id BETWEEN ' . intval( $restoreData['restore_min_tid'] ) . ' AND ' . intval( $restoreData['restore_max_tid'] ), 'order' => 'archive_topic_id ASC, archive_id ASC', 'limit' => array( 0, $options['process'] ) ) ); $o = $this->DB->execute(); while( $post = $this->DB->fetch( $o ) ) { $pids[ $post['archive_id'] ] = $post['archive_id']; } /* All done? */ if ( ! count( $pids ) ) { $restoreData['restore_min_tid'] = 0; $restoreData['restore_max_tid'] = 0; $this->setRestoreData( $restoreData ); } }We never check against a remote DB when loading the post IDs to restore and thus the code never restores anything.
The restore function only checks the local database.
This.. Leads to multiple issues.. Obviously, anyone who has a topic archived and is using a remote DB, can't unarchive it.. However.. A second thing that will have to be considered here is that if they flag a topic to be unarchived, the task runs normally, as if it completes successfully, because the forums_archive_posts table is empty.. So.. So far as the task is concerned, it runs through.. Doesn't do what it should, but, it THINKS it does.
This means, that even if the root problem here is fixed.. You're going to have topics that have topic_archive_status flagged at code 4, 'unarchiving', while the core_archive_restore table is cleared for the manual tids.. So.. In addition to the 'fix'.. Something will have to be done to scan for any topics with an archive flag of 4, get the list and add those back in to core_archive_restore's manual tids, otherwise, you'll wind up with 'orphan' topics that show as 'to be restored' that will never restore.
So, is this an issue for me, or are you just stating here what you have discussed on IM?
[attachment=39459:archiveupdate.zip]
Then run this script (upload into forum root)
[attachment=39458:333_archive_update_php.php]
Awesome work Matt (and everyone else)
Because, i'm working on a site right now where someone applied this and is NOT using remote archiving, and they can no longer restore topics..
So.. I'm assuming this patch is only a patch for the remote issue, and people using standard local archiving should NOT apply this?
I'll let him check your reply though.
Applied the fix (uploading the files and running the one on the forum's root).
Got this error on screen (running the archiver cron manually to see from the CP):
But the topic we was watching, was unarchived.
Don't know what about that error.
We are using external archive, on a separate DB.