Hi all,
I'm having great fun with my first Discourse install - it's a fab bit fo kit! I'm new to Ruby et al and looking for a spot of help with kununa.rb
I can get the script to run, having searched a lot but there is an issue with the script.
In the latest version of kunena the 'categories' table is different - field 'parent' is now called 'parent_id' and I've no idea how the older tables were setup, but when changing the field value in the kunena.rb script the categories import doesn't work as it should.
Not knowing enough about Ruby I can't quite figure out how the import process is working. What am I not doing?
Any help greatly appreciated, any more details needed please let me know.
Here's what's happening:
changed kunen.rb portion (changed 'parent' to 'parent_id')
create_categories(@client.query("SELECT id, parent_id, name, description, ordering FROM jos_kunena_categories ORDER BY parent_id, id;")) do |c|
h = {id: c['id'], name: c['name'], description: c['description'], position: c['ordering'].to_i}
if c['parent_id'].to_i > 0
parent = category_from_imported_category_id(c['parent_id'])
h[:parent_category_id] = parent.id if parent
end
h
end
and the output -
root@acc:/var/www/discourse# RAILS_ENV=production sudo -E -u discourse ruby script/import_scripts/kunena.rb
loading existing groups...
loading existing users...
loading existing categories...
loading existing posts...
loading existing topics...
fetching Joomla users data from mysql
fetching Kunena user data from mysql
creating users
1464 / 1464 (100.0%)
[..list of category names...]
creating topics and posts
3 / 23141 ( 0.0%) Parent post 0 doesn't exist. Skipping 5: Moderator Help!
4 / 23141 ( 0.0%) Parent post 0 doesn't exist. Skipping 6: Back End Login
5 / 23141 ( 0.0%) Parent post 0 doesn't exist. Skipping 7: Article creators
6 / 23141 ( 0.0%) Parent post 7 doesn't exist. Skipping 8: Article creators
7 / 23141 ( 0.0%) Parent post 8 doesn't exist. Skipping 9: Article creators
8 / 23141 ( 0.0%) Parent post 9 doesn't exist. Skipping 10: Article creators
9 / 23141 ( 0.0%) Parent post 7 doesn't exist. Skipping 12: Article creators
10 / 23141 ( 0.0%) Parent post 12 doesn't exist. Skipping 13: Article creators
11 / 23141 ( 0.0%) Parent post 5 doesn't exist. Skipping 14: Moderator Help!
12 / 23141 ( 0.1%) Parent post 12 doesn't exist. Skipping 15: Article creators
13 / 23141 ( 0.1%) Parent post 15 doesn't exist. Skipping 16: Article creators
14 / 23141 ( 0.1%) Parent post 16 doesn't exist. Skipping 17: Article creators
15 / 23141 ( 0.1%) Parent post 14 doesn't exist. Skipping 18: Moderator Help!
16 / 23141 ( 0.1%) Parent post 0 doesn't exist. Skipping 19: Avatars
17 / 23141 ( 0.1%) Parent post 7 doesn't exist. Skipping 20: Article creators
21 / 23141 ( 0.1%) Parent post 19 doesn't exist. Skipping 24: Avatars
23 / 23141 ( 0.1%) Parent post 0 doesn't exist. Skipping 26: Acceptable Useage Policy
it makes the first few categories - not quite correctly then refuses to import any posts - It seems that the initial categories aren't being created properly so it doesn't know where to import the posts.
Cheers all,
Dave