# Ning import script

**URL:** https://meta.discourse.org/t/ning-import-script/24358
**Category:** Feature
**Tags:** feedback
**Created:** [January 23, 2015, 5:29pm UTC](https://meta.discourse.org/t/ning-import-script/24358 "2015-01-23T17:29:28Z")
**Posts on this page:** 1
**Showing post:** 31

<div class="post-metadata">

### Author: ![alehandrof](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alehandrof/32/119526_2.png) [@alehandrof](https://meta.discourse.org/u/alehandrof)
#### Post date: [February 18, 2016, 3:38pm UTC](https://meta.discourse.org/t/ning-import-script/24358/31 "2016-02-18T15:38:29Z")

</div>

I have some questions about configuring `ning.rb`.

My Ning export looks like this:

 ![](https://global.discourse-cdn.com/meta/original/3X/9/2/924e6541c5dfc2a9c876fa3cfeccb6bd2cf4b02e.png)

- What exactly are `ATTACHMENT_PREFIXES`? The default value is: `["discussions", "pages", "blogs", "members", "photos"]`. These look like they should map to the exported folders. Should I add `events` and `members` to this list, as they are missing?

- I assume that I should put all filetypes that I want imported in `EXTRA_AUTHORIZED_EXTENSIONS`. Are these values case insensitive? (I look into the existing files and some extensions are in all caps for some reason.)

I have taken a stab at configuring the JSON import as follows:

**Initialize**

```plaintext
@users_json = load_ning_json("ning-members-local.json")
@discussions_json = load_ning_json("ning-discussions-local.json")

# An example of a custom category from Ning:
@blogs_json = load_ning_json("ning-blogs-local.json")

# My additions
@events_json = load_ning_json("ning-events-local.json")
@groups_json = load_ning_json("ning-groups-local.json")
@moreusers_json = load_ning_json("ning-members.json")
@pages_json = load_ning_json("ning-pages-local.json")
@photos_json = load_ning_json("ning-photos-local.json")

```

**Import**

```plaintext
import_users
import_categories
import_discussions

import_blogs # Remove this and/or add more as necessary

# My additions
import_events
import_groups
import_moreusers
import_pages
import_photos

```

- How do I create functions to import all of these? Is it sufficient to do something like this:

```plaintext
def import_XYZ
  puts "", "Importing XYZ"
  import_topics(@XYZ_json, "XYZ")
end

```

(Where XYZ one of `events`, `groups`, `pages`, etc.)

Finally, for reasons that are unclear to me, I have two member files: `ning-members-local.json` and `ning-members.json`.

- Is it better to combine these at the JSON level or duplicate the users stuff twice?

Any help would be much appreciated 🙂

---

_[View the full topic](https://meta.discourse.org/t/ning-import-script/24358)._
