Under Consideration: Migrate the Forums to Discourse


 
Thread Tools Search this Thread
The Lounge What is on Your Mind? Under Consideration: Migrate the Forums to Discourse
# 15  
Old 03-10-2020
Status Update:

Code:
   262021 / 651396 ( 40.2%)  [590 items/min]

Reported bug in the vbulletin.rb script at meta discourse but will not post any more bugs regarding vB3.8.X migration to discourse over there.

Back to working on the migration.

Also, I am also considering to keep both forums up and running and leave this one at www.unix.com and keep the discourse.unix.com forum separate. Need to think about this and how it might hurt SEO for one site or the other in the future..
# 16  
Old 03-10-2020
Note:

I compared the "forums which ported to categories" against "forums which did not port to discourse categories" and the forums "which did not port" all had a parentid of -1,

So, I think this can be fixed by altering the "dumped DB" and changing all forum parentid to -1.

I will do this as a part of "round 2" after this migration test is done.

forum Table:

Under Consideration:  Migrate the Forums to Discourse-screen-shot-2020-03-10-22202-pmjpg
# 17  
Old 03-10-2020
Sidebar:

OK... looking at this:

discourse/vbulletin.rb at master . discourse/discourse . GitHub

The bug is in this block:

Code:
 def import_categories
    puts "", "importing top level categories..."

    categories = mysql_query("SELECT forumid, title, description, displayorder, parentid FROM #{TABLE_PREFIX}forum ORDER BY forumid").to_a

    top_level_categories = categories.select { |c| c["parentid"] > -1 }

    create_categories(top_level_categories) do |category|
      {
        id: category["forumid"],
        name: @htmlentities.decode(category["title"]).strip,
        position: category["displayorder"],
        description: @htmlentities.decode(category["description"]).strip
      }
    end

    puts "", "importing children categories..."

    children_categories = categories.select { |c| c["parentid"] != -1 }
    top_level_category_ids = Set.new(top_level_categories.map { |c| c["forumid"] })

    # cut down the tree to only 2 levels of categories
    children_categories.each do |cc|
      while !top_level_category_ids.include?(cc["parentid"])
        cc["parentid"] = categories.detect { |c| c["forumid"] == cc["parentid"] }["parentid"]
      end
    end

    create_categories(children_categories) do |category|
      {
        id: category["forumid"],
        name: @htmlentities.decode(category["title"]).strip,
        position: category["displayorder"],
        description: @htmlentities.decode(category["description"]).strip,
        parent_category_id: category_id_from_imported_category_id(category["parentid"])
      }
    end
  end

On work around I have which am looking at is to just rerun this script with a small change, making all categories top level for now:

Code:
 top_level_categories = categories.select { |c| c["parentid"]  > -2}.  # make all forums top-level categories

    create_categories(top_level_categories) do |category|
      {
        id: category["forumid"],
        name: @htmlentities.decode(category["title"]).strip,
        position: category["displayorder"],
        description: @htmlentities.decode(category["description"]).strip
      }
    end

and "false out"

Code:
if false
children_categories = categories.select { |c| c["parentid"] != -1 }
    top_level_category_ids = Set.new(top_level_categories.map { |c| c["forumid"] })

    # cut down the tree to only 2 levels of categories
    children_categories.each do |cc|
      while !top_level_category_ids.include?(cc["parentid"])
        cc["parentid"] = categories.detect { |c| c["forumid"] == cc["parentid"] }["parentid"]
      end
    end

    create_categories(children_categories) do |category|
      {
        id: category["forumid"],
        name: @htmlentities.decode(category["title"]).strip,
        position: category["displayorder"],
        description: @htmlentities.decode(category["description"]).strip,
        parent_category_id: category_id_from_imported_category_id(category["parentid"])
      }
    end
end

This might work better.
# 18  
Old 03-10-2020
I'm fairly confident now that, after the first "test migration" if over (in a day or so) , I can make this port work nicely with some simple modifications to the Ruby import script in the area of:

Code:
Forums to Categories
Custom BB Code Tags

Now, waiting for all the posts / replies to import and then the attachments.

I think there is a potential problem with attachment, so after it is all "done" in this test round, I will have info info to make more adjustments in the Ruby migration script.

Plus, I get to learn a bit of "Ruby" along the way. Smilie
# 19  
Old 03-10-2020
Still chugging along:

Code:
   380575 / 651396 ( 58.4%)  [585 items/min]

FYI, discourse plugins on GitHub:

Search . topic:discourse-plugin org:discourse fork:true . GitHub
# 20  
Old 03-10-2020
Still moving along:

Code:
   463672 / 651396 ( 71.2%)  [579 items/min]

The only "cautionary" comment I have so far is that of the two people on the "discourse side of the house" I have interacted with so far, both "had their hands out" looking to make money off this migration. One guy was a hired gun "migration expert" who wanted money to help me and the other person was in the discourse forums, the other was a discourse server provider.

This jives with some of the posts I have read which stated that discourse was free and the developers and other make a lot of money on associated hosting and services.

That's a lot different than the Node-RED community I have been interacting with where both Node-RED is free and the community is a robust, friendly group of "makers" all showing off their skills and talents and sometimes over-projecting their skills to attract attention; but they are truly helpful to all, especially noobs.

Discourse, on the other hand, seems to want to steer noobs to paid services.

That is not a big negative; as everyone has a right to make a living; and I heard the owners of Discourse make a fortune.
This User Gave Thanks to Neo For This Post:
# 21  
Old 03-10-2020
Quick Q...
do I need a new account for the discourse "side of the house"?
Tried my creds from the main site, getting "Incorrect username, email or password"
Or it's not been "enabled/migrated" yet?
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Migrate from FTP to SFTP

Hi,I am using following code for FTP in shell script file and it is working.Now I want to migrate from FTP to SFTP.What code changes/steps I have to perform for SFTP ? ftp -in <<FIN open $SAP_UP_SERVER user $SAP_UP_USER $SAP_UP_PASSWORD asc put... (7 Replies)
Discussion started by: Nitin Varshneya
7 Replies

2. BSD

Migrate a Hard Disk

hi Has anyone already tried to migrate a hard disk with FreeBSD using recoverdisk? (1 Reply)
Discussion started by: ccc
1 Replies

3. Linux

Mysql Migrate

Hi , I would like to (MYSQL) migrate the all the data from solari's to linux box. I have checked whether mysql is installed or not. rpm -qa | grep -i mysql I confirmed !!!! I want to know the following points. 1) How can get to know what are mysql data files and location as well.... (4 Replies)
Discussion started by: Mani_apr08
4 Replies

4. Solaris

Migrate from MPXIO to Powerpath

Here is the issue: I am building a database server using Solaris 10x86 U8. The system is jumpstarted with mpxio enabled and booting from the san. We need to have powerpath 5.3 installed and would like to have powerpath take control of the the boot san as well or have mpxio control the san... (2 Replies)
Discussion started by: nabru72
2 Replies

5. Solaris

Can you migrate UFS to ZFS ?

I have some UFS volumes (non root), that I would like to change into ZFS volumes. Is this possible ? I think the only method is to create a new zfs volume and copy the data accoss, this would take a long time for us. Is there a quicker way ? Regards (5 Replies)
Discussion started by: wjones
5 Replies

6. Solaris

Migrate oracle solaris 5.8 5.9

If I have an oracle 9 database environment on a san running solaris 5.8 as the os. Can I plug the san into a Solaris 5.9 environment and have the database work ? - as long as binaries are on the san (1 Reply)
Discussion started by: tim-carroll@com
1 Replies

7. UNIX for Dummies Questions & Answers

Pipe not taken into consideration

I'm trying to see every file which my group (staff) has in a certain directory, recursively. The pipe ls -l -R | grep staff is not working exactly as I want, as for every directory to which my user does not have access, a line like: ls: ./directory/lost+found: The file access permissions do not... (5 Replies)
Discussion started by: panchopp
5 Replies

8. UNIX for Dummies Questions & Answers

How to migrate ?

Currently, I am planning a migration between machine which under True64UNIX. The new machine will run with higher version O/S. My question is, is there any solution on migrating one machine to another which with different O/S version? My goal is keeping minimum impact to the users. Excuse my... (1 Reply)
Discussion started by: coolmans
1 Replies
Login or Register to Ask a Question