Vanilla2 Import - no avatars, no pdf attachments

AI 生成的摘要

A Vanilla2 forum was imported using the Vanilla2export.php script and the vanilla.rb importer, but user avatars and PDF attachments were not imported. buzzdev inquired if this is the intended behavior or a user error. zogstrip confirmed that the existing Vanilla importers do not support avatars or attachments, but invited buzzdev to submit a pull request to add this functionality. buzzdev asked for guidelines on extending importers, but zogstrip suggested simply improving the vanilla.rb file. mmuyskens later checked in to see if buzzdev had found a solution, specifically regarding Vanilla avatar importing.

Hello Discourse,
i’ve imported my existing Vanilla2 forum using the Vanilla2export.php and

RAILS_ENV=production ruby script/import_scripts/vanilla.rb /shared/export.csv

However user avatars and attachments were not imported.
On my original website i don’t see any GET requests for avatars and PDF attachments.

In the vanilla.rb importer, there is a reference to a photo:

u = { id: user[:user_id], email: user[:email], username: user[:name], created_at: parse_date(user[:date_inserted]), bio_raw: clean_up(bio_raw), avatar_url: user[:photo], moderator: @user_roles.select { |ur| ur[:user_id] == user[:user_id] }.map { |ur| ur[:role_id] }.include?(moderator_role_id), admin: @user_roles.select { |ur| ur[:user_id] == user[:user_id] }.map { |ur| ur[:role_id] }.include?(admin_role_id), }

Is it how the import is supposed to work - meaning, no avatar and attachment import or am i doing something wrong here?

Or are there perhaps some post-import tasks, which i missed?

Many thanxs for help
martin

I’m afraid none of the importers we have for vanilla supports avatars/attachments. If you feel like adding it, we would happily merge a pull request :wink:

Many thanxs! :smile:
I was unsure if it is “works as designed” or a user (my) error :blush:

Are there any guidelines regarding extending importers maybe?

Not that I know of. Just improve the code of the script/import_scripts/vanilla.rb file :wink:

@buzzdev - did you come up with a solution? Curious if anything has changed as far as Vanilla avatar importing.