XoopsModules25x / newbb

Forum module for XOOPS
7 stars 19 forks source link

Import xForum to NewBB #76

Open walkero-gr opened 4 years ago

walkero-gr commented 4 years ago

Do you guys know if there is a process to import the forum data from xForum 5.85 stable to NewBB 5.0 Final? I need to update the forum of a website that has more than 117672 posts. So I need a way to transfer that information, without losing anything. I can work on SQL queries to transfer that information, but before I do that I would like to know if there is already something like that somewhere.

Thank you for your help.

cesagonchu commented 4 years ago

Did you see this message? https://xoops.org/modules/newbb/viewtopic.php?post_id=358804#358804

walkero-gr commented 4 years ago

@cesagonchu To be honest, I searched the xoops website but didn't see that post in search results. Thanks for pointing me to that direction.

I had a fast check on a couple of tables and seems that there are differences on structure, mostly on added columns. I haven't done yet an in depth investigation, because I wanted first to ask in case someone knew something I didn't find. But it seems that I will need to prepare a process for this transformation before this is applied on production.

Thanks again for your message.

cesagonchu commented 4 years ago

I don't know if it can help you but on this link: https://xoops.org/modules/news/article.php?storyid=5728 in the comments, migration scripts are proposed from D3Forum to X-Forum and an upgrade script from Newbb to X-Forum

walkero-gr commented 2 years ago

The queries I used to do the transfer are below. These might be useful to someone else.

  TRUNCATE `xoops_newbb_archive`;
  TRUNCATE `xoops_newbb_attachments`;
  TRUNCATE `xoops_newbb_categories`;
  TRUNCATE `xoops_newbb_digest`;
  TRUNCATE `xoops_newbb_forums`;
  TRUNCATE `xoops_newbb_moderates`;
  TRUNCATE `xoops_newbb_online`;
  TRUNCATE `xoops_newbb_posts`;
  TRUNCATE `xoops_newbb_posts_text`;
  TRUNCATE `xoops_newbb_reads_forum`;
  TRUNCATE `xoops_newbb_reads_topic`;
  TRUNCATE `xoops_newbb_report`;
  TRUNCATE `xoops_newbb_stats`;
  TRUNCATE `xoops_newbb_topics`;
  TRUNCATE `xoops_newbb_type`;
  TRUNCATE `xoops_newbb_type_forum`;
  TRUNCATE `xoops_newbb_user_stats`;
  TRUNCATE `xoops_newbb_votedata`;

  INSERT INTO xoops_newbb_categories(cat_id, cat_image, cat_title, cat_description, cat_order, cat_url)
  SELECT cat_id, cat_image, cat_title, cat_description, cat_order, cat_url
  FROM xoops_xf_categories;

  INSERT INTO xoops_newbb_forums(forum_id, forum_name, forum_desc, parent_forum, forum_moderator, forum_topics, forum_posts, forum_last_post_id, cat_id, hot_threshold, forum_order, attach_maxkb, attach_ext, allow_polls)
  SELECT forum_id, forum_name, forum_desc, parent_forum, forum_moderator, forum_topics, forum_posts, forum_last_post_id, cat_id, hot_threshold, forum_order, attach_maxkb, attach_ext, allow_polls
  FROM xoops_xf_forums;

  INSERT INTO xoops_newbb_online(online_forum, online_topic, online_uid, online_uname, online_ip, online_updated)
  SELECT online_forum, online_topic, online_uid, online_uname, online_ip, online_updated
  FROM xoops_xf_online;

  INSERT INTO xoops_newbb_posts(post_id, pid, topic_id, forum_id, post_time, uid, poster_name, poster_ip, subject, icon, attachsig, approved, post_karma, attachment, require_reply)
  SELECT post_id, pid, topic_id, forum_id, post_time, uid, poster_name, poster_ip, subject, icon, attachsig, approved, post_karma, attachment, require_reply
  FROM xoops_xf_posts;

  INSERT INTO xoops_newbb_posts_text(post_id, post_text, post_edit)
  SELECT post_id, post_text, post_edit
  FROM xoops_xf_posts_text;

  INSERT INTO xoops_newbb_reads_forum(read_id, uid, read_time, read_item, post_id)
  SELECT read_id, uid, read_time, read_item, post_id
  FROM xoops_xf_reads_forum;

  INSERT INTO xoops_newbb_reads_topic(read_id, uid, read_time, read_item, post_id)
  SELECT read_id, uid, read_time, read_item, post_id
  FROM xoops_xf_reads_topic;

  INSERT INTO xoops_newbb_report(report_id, post_id, reporter_uid, reporter_ip, report_time, report_text, report_result, report_memo)
  SELECT report_id, post_id, reporter_uid, reporter_ip, report_time, report_text, report_result, report_memo
  FROM xoops_xf_report;

  INSERT INTO xoops_newbb_topics(
    topic_id, topic_title, topic_poster, topic_time, topic_views, topic_replies, topic_last_post_id, forum_id, topic_status, type_id,
    topic_sticky, topic_digest, digest_time, approved, poster_name, rating, votes, topic_haspoll, poll_id)
  SELECT
    topic_id, topic_title, topic_poster, topic_time, topic_views, topic_replies, topic_last_post_id, forum_id, topic_status, topic_subject,
    topic_sticky, topic_digest, digest_time, approved, poster_name, rating, votes, topic_haspoll, poll_id
  FROM xoops_xf_topics;
mambax7 commented 1 year ago

Thank you for sharing the queries!