Import scripts vbulletin5.rb

There are no Error messages during the import - only a few warnings for invalid user email addresses when the create_users function runs. But the user import is successful in the end. Here is the log (I removed the warnings as they contained customer email addresses):

importing posts...
5 / 5 (100.0%)  [290527 items/min]                                                            
importing attachments...   
20182 / 5 (403640.0%)

Here is where I think it only sees my five categories as posts and imports them. And does not know what to do with all the attachments for the actual topics that weren’t imported?

Disclaimer:

Initially, the import failed because the vBulletin database I was given did not have a table customprofilepic - I added an empty table here.

And there were no custom avatars - so the AVATAR_DIR, referenced in the import script, is just an empty folder I created. I commented out the following lines in the import script that were referencing those assets:

create_users(users, total: user_count, offset: offset) do |user|
        username = @htmlentities.decode(user["username"]).strip
        {
          id: user["userid"],
          name: username,
          username: username,
          email: user["email"].presence || fake_email,
          admin: user['admin'] == 1,
          password: user["password"],
          website: user["homepage"].strip,
          title: @htmlentities.decode(user["usertitle"]).strip,
          primary_group_id: group_id_from_imported_group_id(user["usergroupid"]),
          created_at: parse_timestamp(user["joindate"])
          # post_create_action: proc do |u|
          #   @old_username_to_new_usernames[user["username"]] = u.username
          #   import_profile_picture(user, u)
          #   import_profile_background(user, u)
          # end
        }
      end

But to my understanding, those changes only affect the user creation. And the users are created successfully.

This is the full import script that I am using: