1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.4 Delete all threads,category and reset Id.

Discussion in 'XenForo Questions and Support' started by nguyenhuuhung, Jun 22, 2015.

  1. nguyenhuuhung

    nguyenhuuhung Active Member

    i want to delete all threads,category and reset Id : D
    Please help me.!
    Thank you in advance!
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    It would be simpler to do a clean installation, unless there is some reason you don't want to do that?
     
    nguyenhuuhung likes this.
  3. nguyenhuuhung

    nguyenhuuhung Active Member

    Yes.I just wanted to delete threads,category and reset ID to 1
    User,addon,template,comment post profile.I want to keep them. :D
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    There is no option to reset IDs.
    It would require manipulating the database directly.
     
    nguyenhuuhung likes this.
  5. nguyenhuuhung

    nguyenhuuhung Active Member

    Will you use MySQL Query?
    Can you guide me?
     
  6. nguyenhuuhung

    nguyenhuuhung Active Member

    Can i use this SQL ??
    I don't want to delete users! :(
    Code:
    DELETE FROM xf_user_group WHERE user_group_id >= 5;
    DELETE FROM xf_user WHERE user_id != 1;
    DELETE FROM xf_admin WHERE user_id != 1;
    ALTER TABLE xf_user_group
    AUTO_INCREMENT = 5;
    ALTER TABLE xf_user
    AUTO_INCREMENT = 2;
    TRUNCATE TABLE xf_thread;
    ALTER TABLE xf_thread
    AUTO_INCREMENT = 1;
    TRUNCATE TABLE xf_post;
    ALTER TABLE xf_post
    AUTO_INCREMENT = 1;
    DELETE FROM xf_user_authenticate WHERE user_id != 1;
    TRUNCATE TABLE xf_user_group_relation;
    TRUNCATE TABLE xf_user_ban;
    TRUNCATE TABLE xf_user_external_auth;
    TRUNCATE TABLE xf_user_alert;
    TRUNCATE TABLE xf_user_follow;
    TRUNCATE TABLE xf_user_news_feed_cache;
    
    DELETE FROM xf_user_option WHERE user_id > 1;
    DELETE FROM xf_user_privacy WHERE user_id > 1;
    DELETE FROM xf_user_profile WHERE user_id > 1;
    TRUNCATE TABLE xf_user_status;
    TRUNCATE TABLE xf_user_trophy;
    TRUNCATE TABLE xf_admin_log;
    ALTER TABLE xf_admin_log
    AUTO_INCREMENT = 1;
    TRUNCATE TABLE xf_conversation_master;
    ALTER TABLE xf_conversation_master
    AUTO_INCREMENT = 1;
    TRUNCATE TABLE xf_conversation_message;
    ALTER TABLE xf_conversation_message
    AUTO_INCREMENT = 1;
    TRUNCATE TABLE xf_conversation_recipient;
    TRUNCATE TABLE xf_conversation_user;
    TRUNCATE TABLE xf_error_log;
    TRUNCATE TABLE xf_forum;
    ALTER TABLE xf_forum
    AUTO_INCREMENT = 1;
    TRUNCATE TABLE xf_forum_prefix;
    TRUNCATE TABLE xf_link_forum;
    TRUNCATE TABLE xf_import_log;
    TRUNCATE TABLE xf_ip;
    ALTER TABLE xf_ip
    AUTO_INCREMENT = 2;
    TRUNCATE TABLE xf_liked_content;
    ALTER TABLE xf_liked_content
    AUTO_INCREMENT = 1;
    TRUNCATE TABLE xf_moderation_queue;
    TRUNCATE TABLE xf_moderator;
    TRUNCATE TABLE xf_moderator_content;
    ALTER TABLE xf_moderator_content
    AUTO_INCREMENT = 1;
    TRUNCATE TABLE xf_node;
    ALTER TABLE xf_node
    AUTO_INCREMENT = 1;
    TRUNCATE TABLE xf_poll;
    ALTER TABLE xf_poll
    AUTO_INCREMENT = 1;
    TRUNCATE TABLE xf_poll_response;
    ALTER TABLE xf_poll_response
    AUTO_INCREMENT = 1;
    TRUNCATE TABLE xf_poll_vote;
    TRUNCATE TABLE xf_profile_post;
    ALTER TABLE xf_profile_post
    AUTO_INCREMENT = 1;
    TRUNCATE TABLE xf_search;
    TRUNCATE TABLE xf_search_index;
    TRUNCATE TABLE xf_session;
    TRUNCATE TABLE xf_session_activity;
    TRUNCATE TABLE xf_thread_user_post;
    TRUNCATE TABLE xf_thread_watch;
    TRUNCATE TABLE xf_thread_read;
    TRUNCATE TABLE xf_permission_cache_content;
    TRUNCATE TABLE xf_permission_group;
    TRUNCATE TABLE xf_warning;
    ALTER TABLE xf_warning
    AUTO_INCREMENT = 1;
    TRUNCATE TABLE xf_moderator_log;
    ALTER TABLE xf_moderator_log
    AUTO_INCREMENT = 1;
    TRUNCATE TABLE xf_forum_watch;
    TRUNCATE TABLE xf_forum_read;
    TRUNCATE TABLE xf_report;
    TRUNCATE TABLE xf_report_comment;
    ALTER TABLE xf_report
    AUTO_INCREMENT = 1;
    ALTER TABLE xf_report_comment
    AUTO_INCREMENT = 1;
    TRUNCATE TABLE xf_stats_daily;
    TRUNCATE TABLE xf_user_confirmation;
    ALTER TABLE xf_thread_read
    AUTO_INCREMENT = 1;
    TRUNCATE TABLE xf_attachment;
    TRUNCATE TABLE xf_attachment_data;
    TRUNCATE TABLE xf_attachment_view;
    ALTER TABLE xf_attachment
    AUTO_INCREMENT = 1;
    ALTER TABLE xf_attachment_data
    AUTO_INCREMENT = 1;
    TRUNCATE TABLE xf_user_field_value;
    TRUNCATE TABLE xf_user_field;
    TRUNCATE TABLE xf_thread_prefix;
    ALTER TABLE xf_thread_prefix
    AUTO_INCREMENT = 1;
    TRUNCATE TABLE xf_thread_prefix_group;
    ALTER TABLE xf_thread_prefix_group
    AUTO_INCREMENT = 1;
    
     
  7. Brogan

    Brogan XenForo Moderator Staff Member

    It's not something I have looked in to, so I couldn't comment on whether that is accurate or comprehensive.
     
    nguyenhuuhung likes this.

Share This Page