XF 1.4 Soft Deleting via DB Query

Xanin

Member
I recently migrated an ancient Active Forums site to Xenforo, by way of a manual conversion to phpBB. In the process I forgot to drop the soft-deleted posts from ActiveForums, and now I have roughly a thousand messages that should be deleted that aren't. Since I retained the IDs, can I simply run a query along the lines of this
Code:
UPDATE xf_posts
WHERE post_id IN (long list here)
SET message_state = 'deleted';
to set them all to a soft-deleted state, or are there other tables I would need to update as well?
 
The relevant tables are:

xf_thread
xf_post
xf_deletion_log

Here is a query example involving these tables:

https://xenforo.com/community/resources/soft-delete-all-moderated-posts-queries.371/

Thank you, this is most helpful. since my posts aren't currently marked for moderation, I assume I can dispense with any of the moderated relating items, and narrow it down a bit for replies:

Code:
INSERT INTO xf_deletion_log (content_type, content_id, delete_date, delete_user_id, delete_username, delete_reason)
SELECT 'post',post_id,UNIX_TIMESTAMP(),1,'admin','manually moved from moderation to soft delete'
FROM xf_post
WHERE post_id IN(427091,427021,427034,427089,427090,427093. etc)

UPDATE xf_post
SET message_state = 'deleted'
WHERE post_id IN(427091,427021,427034,427089,427090,427093. etc)


But my post content isn't deleted in XenForo yet - that is what I am trying to rectify :/
 
Back
Top Bottom