从 Invision Power Board 迁移到 Discourse

is this offer still available ?
Getting to the point where I might have to pay IPB :sadpanda:

Want to convert from http://mandrivausers.org/

2 个赞

Hey, i will probably need to do a migration from IP Board v3.4.5 to Discourse at my job, any news about the import script? Would love to test it.

I wont promise that it will work for you, but I will try to clean it up and submit a PR in the next few days. If you have a budget, my contact info is in my profile.

3 个赞

I also need to do a migration from a bitrix based forum, so i’ll have to write a custom script anyway and figure out how all of this works, anything to save me some time would be extremely helpful. Thank you.

Here it is. The two sites that I imported with this code were wildly different. I hope that someone finds it useful.

https://github.com/discourse/discourse/pull/5543

11 个赞

Some version of this is in core now, so you probably don’t want to use what’s in the link above.

4 个赞

您能告诉我ipboard 4版本的导入脚本在哪里吗?
我在仓库里只看到了ipboard和ipboard3的导入脚本。
您是否支持将ipboard4迁移到Discourse?

我不知道。我猜 ipboard.rb 脚本是值得尝试的;我不知道我为哪个版本的 ipboard 写的。你只能用你的数据试试看是否有效。正如我(多年前)之前所说,当我最初编写 ipboard 脚本时,我尝试过的两个站点非常非常不同。

如果您对付费支持感兴趣,可以访问 Redirecting…

感谢您的回复。
我尝试使用我的数据,但它无法完成,因为它中断了。
它试图查找不存在于 4 版本中的表“profile_portal”。
我猜这个脚本是为 ipb3 或更低版本编写的。

我会考虑付费支持。

你好 @pfaffman ,请告诉我你是否可以支持。我想从 v2.3.6 导入,在将主题链接到 forum_id 时遇到问题,因为该版本没有 forum_id。你能告诉我哪个表保存了主题和论坛之间的链接值吗?

这是我现在导入主题的代码,它可以导入,但所有主题都去了“未分类”:

def import_topics
  puts "\n📌 Importing Topics..."
  total_count = mysql_query("SELECT count(*) count FROM iBB_posts WHERE new_topic = 1;").first['count']

  batches(BATCH_SIZE) do |offset|
    discussions = mysql_query(<<-SQL
      SELECT pid as tid, topic_id, post_title as title, post as raw,
             FROM_UNIXTIME(post_date) as created_at, author_id
      FROM iBB_posts
      WHERE new_topic = 1
      ORDER BY post_date ASC
      LIMIT #{BATCH_SIZE} OFFSET #{offset};
    SQL
    ).to_a

    break if discussions.empty?

    create_posts(discussions, total: total_count, offset: offset) do |discussion|
      {
        id: "topic-#{discussion['tid']}",
        user_id: user_id_from_imported_user_id(discussion['author_id']) || Discourse::SYSTEM_USER_ID,
        title: format_title(discussion['title']),  # Ensure titles are properly formatted
        raw: discussion['raw'],
        created_at: discussion['created_at'],
        post_number: 1
      }
    end
  end
end
def format_title(title)
  return "Untitled Topic" if title.nil? || title.strip.empty?
  CGI.unescapeHTML(title)
end
def import_replies
  puts "\n📌 Importing Replies..."
  total_count = mysql_query("SELECT count(*) FROM iBB_posts WHERE new_topic = 0;").first['count']

  batches(BATCH_SIZE) do |offset|
    comments = mysql_query(<<-SQL
      SELECT pid, topic_id, post as raw, FROM_UNIXTIME(post_date) as created_at, author_id
      FROM iBB_posts
      WHERE new_topic = 0
      ORDER BY post_date ASC
      LIMIT #{BATCH_SIZE} OFFSET #{offset};
    SQL
    ).to_a

    break if comments.empty?

    create_posts(comments, total: total_count, offset: offset) do |comment|
      topic_id = topic_lookup_from_imported_post_id("topic-#{comment['topic_id']}")
      next unless topic_id

      {
        id: "post-#{comment['pid']}",
        topic_id: topic_id,
        user_id: user_id_from_imported_user_id(comment['author_id']) || Discourse::SYSTEM_USER_ID,
        raw: comment['raw'],
        created_at: comment['created_at']
      }
    end
  end
end

您没有将类别传递给主题创建者,因此您需要修复它。

但我找不到任何 forum_id 在 ipb sql 数据库中可以使用

那么你不太可能获得免费的帮助来修复它。我认为还有另外两个 IPB 导入脚本;它们可能会提供一些线索。你只需要在数据库中查找一下,看看它们把它放在哪里。

如果你有预算,可以看看 Discourse Migration - Literate Computing 。如果你给我一个预算,我可以尝试匹配它。

2 个赞

我很感谢你的回应,但我特别想获得关于这个问题的技术指导,而不是服务报价,再次感谢你的快速回应。

抱歉,在无法查看您数据库的情况下,我无法了解其结构。

我所能告诉您的,也是我告诉您的,就是请您在数据库中查找分类信息所在的位置。主题记录中一定存在某个您遗漏的字段。有时它会链接到另一个包含分类 ID 的表,这时您需要执行连接操作。它可能只是有一个您意想不到的名称。

1 个赞