Update:
importing posts...
408233 / 651614 ( 62.6%)
This is not going to be difficult.. just a lot of work.
I thought, perhaps, because the discourse db is postgres and vb was mysql, this would be difficult; but it's not. The SQL is nearly the same, only commands, but the concept is mostly the same, SQL, tables, queries.
Getting "read into" Ruby take time, but it's not that hard. It's actually interesting and I'm starting to like it.
For example, the discourse system will not let me as the overall system admin change the user "Neo" from this forum to admin. The system bot tells me that it must send me an email which never comes because email is turned off for migration.
So, I looked at the users table in discourse, found a boolean for admin, did a simple SQL query and my status is now also "admin" for user Neo. This is probably not the best way to do things, but at least I can get around when I need to in the DB.
In addition, I have been decoding where the likes are stored when a user likes a post. There is a table called user_actions, and all likes and such user actions are recorded in that table.
discourse=# \d user_actions
Table "public.user_actions"
Column | Type | Collation | Nullable | Default
-----------------+-----------------------------+-----------+----------+------------------------------------------
id | integer | | not null | nextval('user_actions_id_seq'::regclass)
action_type | integer | | not null |
user_id | integer | | not null |
target_topic_id | integer | | |
target_post_id | integer | | |
target_user_id | integer | | |
acting_user_id | integer | | |
created_at | timestamp without time zone | | not null |
updated_at | timestamp without time zone | | not null |
Indexes:
"user_actions_pkey" PRIMARY KEY, btree (id)
"idx_unique_rows" UNIQUE, btree (action_type, user_id, target_topic_id, target_post_id, acting_user_id)
"idx_user_actions_speed_up_user_all" btree (user_id, created_at, action_type)
"index_user_actions_on_acting_user_id" btree (acting_user_id)
"index_user_actions_on_action_type_and_created_at" btree (action_type, created_at)
"index_user_actions_on_target_post_id" btree (target_post_id)
"index_user_actions_on_target_user_id" btree (target_user_id) WHERE target_user_id IS NOT NULL
"index_user_actions_on_user_id_and_action_type" btree (user_id, action_type)
So I decoded a like, and found:
discourse=# select * from user_actions order by created_at desc limit 10;
id | action_type | user_id | target_topic_id | target_post_id | target_user_id | acting_user_id | created_at | updated_at
---------+-------------+---------+-----------------+----------------+----------------+----------------+----------------------------+----------------------------
1065308 | 2 | 138019 | 377378 | 377381 | | 1 | 2020-03-13 13:49:39.284721 | 2020-03-13 13:49:39.380662
1065307 | 1 | 1 | 377378 | 377381 | | 1 | 2020-03-13 13:49:39.284721 | 2020-03-13 13:49:39.360154
1054388 | 1 | 1 | 377400 | 706814 | | 1 | 2020-03-13 13:32:43.396314 | 2020-03-13 13:32:43.527381
1054389 | 2 | 2 | 377400 | 706814 | | 1 | 2020-03-13 13:32:43.396314 | 2020-03-13 13:32:43.546778
882882 | 11 | 138027 | 377411 | 706825 | | 1 | 2020-03-13 09:11:37.832491 | 2020-03-13 09:11:37.832491
844710 | 12 | -2 | 377396 | -1 | | -2 | 2020-03-13 08:12:59.394389 | 2020-03-13 08:12:59.437878
844711 | 13 | 138027 | 377396 | -1 | | -2 | 2020-03-13 08:12:59.394389 | 2020-03-13 08:12:59.448827
844708 | 12 | -2 | 377394 | -1 | | -2 | 2020-03-13 08:12:59.053549 | 2020-03-13 08:12:59.108207
844709 | 13 | 138026 | 377394 | -1 | | -2 | 2020-03-13 08:12:59.053549 | 2020-03-13 08:12:59.153916
844706 | 12 | -2 | 377393 | -1 | | -2 | 2020-03-13 08:12:59.01556 | 2020-03-13 08:12:59.06146
(10 rows)
that action_type 2 is a "like".
The likes from vB come from a plugin and so they are not transferred to discourse in the migration; but since I have decoded how to "like" in the discourse DB, I think I'll write.a script to transfer all the likes from mysql / vb to postgres / discourse.
The problem with this is that the vb postids are not transferred to postgres, so I will need to write my first custom migration ruby script to transfer the likes when the migration script runs.
Anyone want to do this for us, if I provide both table schemas?