Migrating from Invision Power Board to 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 Likes

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 Likes

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 Likes

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

4 Likes

Can you point me where is import script for ipboard version 4?
I see only ipboard, and ipboard3 import scripts in repo.
Do you support migrating ipboard4 to discourse?

I don’t know. My guess is that the ipboard.rb script is the one to try; I have no idea what version of ipboard I wrote it for. You’ll just have to try with your data to see if it works. As I said (years) earlier, when I originally wrote the ipboard script, the two sites that I tried it with were very, very different.

If you’re interested in paid support, you can see Redirecting…

Thank you for reply.
I tried with my data, it cant complete, because it breaks.
It try to find table “profile_portal”, which does not exits in 4 version.
I guess that script is written for ipb3 or less.

I will think about paid support.

Hi @pfaffman , Please let me know if you can support . i want to import from v2.3.6 , have issues linking the topics to forum_id as this version dont have one can you please let me know which table hold the value to link between topic and forum

This is what i have for importing topics now , it can import but all topics are going to uncategorized,

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

You’re not passing a category to the topic creator, so you’ll need to fix that.

i will but i don’t find any forum_id in ipb sql database to use

Then it’s not likely you can get free help fixing it. I think there are two other IPB import scripts; they might offer some clues. You just have to look around the database and see where they put it.

If you have a budget, you can see Discourse Migration - Literate Computing . If you give me a budget, I can try to match it.

2 Likes

I appreciate the response, but I was specifically looking for technical guidance on the issue rather than service offers , thanks again for the quick response

Sorry that I can’t know the structure of your database without being able to see it.

All I can tell you, and what I told you, is to look in the database to find where the category is hiding. There must be some field in the topic record that you’re missing. Sometimes it’s a link to some other table that has the category id in it and your have to do a join. It’s probably just got some name that your don’t expect.