How to Recover Posts/Threads/Messages from a Deleted User in XenForo

Tutoriel How to Recover Posts/Threads/Messages from a Deleted User in XenForo

Add-on xenforo 2

Ressources et modules complémentaires pour XenForo 2

Styles xenforo 2

Styles / Thèmes et apparence pour xenforo 2

Templates xenforo 2

Codes pour modifier les templates sur xenforo 2

Section Premium

Add-on et Styles pour membre Premium
How to Recover Posts/Threads/Messages from a Deleted User in XenForo

Tutoriel How to Recover Posts/Threads/Messages from a Deleted User in XenForo

Catégorie Catégorie Tutoriel
Titre du sujet Titre du sujet How to Recover Posts\/Threads\/Messages from a Deleted User in XenForo
Auteur de la discussion Auteur de la discussion laurent68
Date de début Date de début
Réponses Réponses 0
Affichages Affichages 157
Réaction Réaction 1
Dernier message par Dernier message par laurent68

laurent68

Fondateur

Staff
fondateur
Réputation: 100%
Discussions
4 858
Messages
12 619
Solutions
85
J'aime
7 897
Points
198
If you've deleted a user in XenForo and their posts or private messages are still showing up, you can reassign that content to a new user with a simple SQL script. This tutorial covers how to do that for public posts and private conversations.

Script for Public Posts and Threads​

Run this SQL script to update posts, threads, and profile posts for a deleted user:

SQL:
UPDATE xf_post SET username = 'NewUsername', user_id = NEW_USER_ID WHERE username = 'OldUsername'; UPDATE xf_thread SET username = 'NewUsername', user_id = NEW_USER_ID WHERE username = 'OldUsername'; UPDATE xf_profile_post SET username = 'NewUsername', user_id = NEW_USER_ID WHERE username = 'OldUsername'; UPDATE xf_profile_post_comment SET username = 'NewUsername', user_id = NEW_USER_ID WHERE username = 'OldUsername';

Script for Private Messages​

To update private messages and conversations, use this script:

SQL:
UPDATE xf_conversation_message SET username = 'NewUsername', user_id = NEW_USER_ID WHERE username = 'OldUsername'; UPDATE xf_conversation_master SET username = 'NewUsername', user_id = NEW_USER_ID WHERE username = 'OldUsername'; UPDATE xf_conversation_recipient SET user_id = NEW_USER_ID WHERE user_id = (SELECT user_id FROM xf_user WHERE username = 'OldUsername');

How to Use​

  1. Replace OldUsername with the deleted user's name.
  2. Replace NewUsername and NEW_USER_ID with the new user's details.
  3. Make sure to back up your database before running the script!
These scripts will reassign all relevant content from the deleted user to the new user. That’s it! Quick and simple. Let me know if you have any questions or run into issues!

Source : How to Recover Posts/Threads/Messages from a Deleted User in XenForo
 
Contenu similaire Les plus vues Voir plus
Retour
Haut Bas