Ning import script

Thanks @riking. Something like that will need to be added to the script.

@askmanny I notice that many users in Ning have “comments” attached to them, typically saying “Happy Birthday!”. Discourse doesn’t allow people to post public comments on user profiles. Any thoughts about how they should be imported?

We are having discussions about these kinds of comments, and how to go channel the need for them.

One possible approach is to create a Forum category that (moving forward) serves as a place for people to have more ‘general’ conversations like the ones people would have in the “town square”, more akin to the kinds of conversations that would happen between individuals, as opposed to community-wide topics. Makes sense?

Any thoughts?

1 Like

It would be nice if the user portion of the import would default the “last seen” to the “created date” of the account. By default, that should (if I understand the restrictions) cause anyone that created an account in the last 365 days [default] to receive an email digest from the forum.
As it is now, the system does not appear to email the digests to anyone until they login the first time to the migrated forums.

1 Like

Good idea. After doing that, the import scripts should also do this to get a better approximation for people who have posted:

UPDATE users
SET last_seen_at = last_posted_at
WHERE last_posted_at IS NOT NULL;

I’ll make the changes.

1 Like

That should probably exclude rows where last_seen_at is set, in case a future importer actually imports that data.

1 Like

It would be an improvement if the script would set the imported users default email settings to be the same defaults as any new user. Specifically the digest = weekly. At the moment, the import leaves the digest setting unselected.

It’s asking a lot of the users in a migration to have to proactively change settings and opt-in to the digest.

The digests for imported users are currently not enabled because of this line.

https://github.com/discourse/discourse/blob/master/script/import_scripts/base.rb#L104

As I see it this is done to prevent sending digests during / immediately after the import.

1 Like

@neil this feels like a bug to me. Shouldn’t email be globally disabled anyway during imports / migrations?

Yeah that’s a bug. Emails are disabled during import (as that code snippet shows), but we shouldn’t be changing default_digest_email_frequency. Digest emails won’t be sent during import. I’ll fix.

1 Like

When you import users, how do they get the welcome email?

Tell them to check /my/private-messages, it’ll be there.

Just reviewed the account of an imported user. None of the educational PM messages are sent.

Imported users don’t get sent a welcome email. Moving users to the new forums is typically done gradually, by posting announcements on the old forums, pinned topic(s) on the new forums, blog posts, etc. I think it also makes sense to seed the welcome private message for all imported users too, so I’ll look into adding that to our importers.

4 Likes

One issue we ran in to was that Ning refused to export all off the profile pictures using their export tool. We went ahead with the import, but that left the system in a weird state where the have a blank profile picture.

The side effect for new users is that they don’t know there is an important menu option!

Anyway to identify and correct affected accounts such that they pull the gravatar avatars as if they had never uploaded an image?

any updates on this importer? is it functional now?

Should be we have used it 3 times with 2 customers. We always check importers into the source tree at the usual location.

1 Like

any tutorial on how to use it? i’m just new to discourse and would want to migrate my json files to discourse over the weekend.

Assuming you have a fully functional Discourse development environment:

  • put your Ning json files in one directory
  • edit ning.rb and put the path in JSON_FILES_DIR.
  • edit other constants at the top of that file as needed for your Ning export and which file attachments you want to allow.
  • Look at the comments in the initialize and execute methods near the top of the file and customize how you like.
  • Run the import. bundle exec ruby script/import_scripts/ning.rb

Good luck!

4 Likes

thanks for this. hopefully this will be successful …

@neil, how do i edit ning.rb? where to go to edit it? in my consul?
or i’ll edit github directly?
sorry, really noob here :frowning: