# \[Paid\] Need a Vanilla 2 Import tool

**URL:** <https://meta.discourse.org/t/paid-need-a-vanilla-2-import-tool/14852>\
**Category:** Marketplace\
**Created:** [Avril 18, 2014, 4:42 UTC](https://meta.discourse.org/t/paid-need-a-vanilla-2-import-tool/14852 "2014-04-18T04:42:08Z")\
**Posts on this page:** 8\
**Page:** 4

<div class="post-metadata">

**Author:** ![omfg](https://avatars.discourse-cdn.com/v4/letter/o/5e9695/32.png) [@omfg](https://meta.discourse.org/u/omfg)\
**Post date:** [Janvier 27, 2015, 5:02 UTC](https://meta.discourse.org/t/paid-need-a-vanilla-2-import-tool/14852/62 "2015-01-27T17:02:20Z")

</div>

I just exported data from Vanilla 2.1.18p2 (latest) using the Vanilla 2 format (should I use Vanilla 1?) and tried to import here as the `discourse` account:

```plaintext
discourse@ubuntu-app:/var/www/discourse$ RAILS_ENV=production ruby script/import_scripts/vanilla.rb /shared/backups/export_vanilla_2015-01-27_113009.txt.gz
/var/www/discourse/script/import_scripts/base.rb:14:in `<top (required)>': undefined method `require_dependency' for main:Object (NoMethodError)
        from /usr/local/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /usr/local/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from script/import_scripts/vanilla.rb:1:in `<main>'

```

I tried all other command suggestions from this page, normally `thor` can’t be found, etc. this is the only command that works, but I get this error.  
Before I tried to import, I created one Administrator and two Moderator accounts in Discourse, thinking that’s required. On the Vanilla site I have several Administrators and several Moderators, all with different email accounts to existing on Discourse.

---

<div class="post-metadata">

**Author:** ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)\
**Post date:** [Janvier 31, 2015, 1:21 UTC](https://meta.discourse.org/t/paid-need-a-vanilla-2-import-tool/14852/64 "2015-01-31T13:21:34Z")

</div>

Recent bug, all the importers except Ning got broken, see here for details/updates and a workaround:

[https://meta.discourse.org/t/importer-for-simple-machines-2-forums/17656/58?u=riking](https://meta.discourse.org/t/importer-for-simple-machines-2-forums/17656/58)

---

<div class="post-metadata">

**Author:** ![kaliha](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kaliha/32/115707_2.png) [@kaliha](https://meta.discourse.org/u/kaliha)\
**Post date:** [Février 28, 2015, 11:43 UTC](https://meta.discourse.org/t/paid-need-a-vanilla-2-import-tool/14852/66 "2015-02-28T11:43:04Z")

</div>

Hi there. I have a some problem with importer. I use vanilla2porter, then run

```
RAILS_ENV=production ruby script/import_scripts/vanilla.rb export_vanilla_2015-02-28_133120.txt.gz

```

And have an error:

```
loading existing groups...
loading existing users...
loading existing categories...
loading existing posts...
loading existing topics...
parsing file...
reading file...
script/import_scripts/vanilla.rb:72:in `gsub': invalid byte sequence in UTF-8 (ArgumentError)
	from script/import_scripts/vanilla.rb:72:in `read_file'
	from script/import_scripts/vanilla.rb:37:in `parse_file'
	from script/import_scripts/vanilla.rb:17:in `execute'
	from /var/www/discourse/script/import_scripts/base.rb:77:in `perform'
	from script/import_scripts/vanilla.rb:255:in `<main>'

```

How i can solve it?

---

<div class="post-metadata">

**Author:** ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)\
**Post date:** [Mars 2, 2015, 10:48 UTC](https://meta.discourse.org/t/paid-need-a-vanilla-2-import-tool/14852/67 "2015-03-02T10:48:33Z")

</div>

You should pass the **text** (`.txt`) file to the importer, not the **gzipped** (`.gz`) file 😉

---

<div class="post-metadata">

**Author:** ![kaliha](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kaliha/32/115707_2.png) [@kaliha](https://meta.discourse.org/u/kaliha)\
**Post date:** [Mars 2, 2015, 1:00 UTC](https://meta.discourse.org/t/paid-need-a-vanilla-2-import-tool/14852/68 "2015-03-02T13:00:13Z")

</div>

Great! Now i have other error:

```
importing users...
script/import_scripts/vanilla.rb:82:in `import_users': undefined method `[]' for nil:NilClass (NoMethodError)
        from script/import_scripts/vanilla.rb:19:in `execute'
        from /var/www/discourse/script/import_scripts/base.rb:77:in `perform'
        from script/import_scripts/vanilla.rb:255:in `<main>'

```

Previosly i read that this problem is based on roles. But can’t find how to solve it.

---

<div class="post-metadata">

**Author:** ![grrowl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/grrowl/32/115451_2.png) [@grrowl](https://meta.discourse.org/u/grrowl)\
**Post date:** [Mars 2, 2015, 10:47 UTC](https://meta.discourse.org/t/paid-need-a-vanilla-2-import-tool/14852/69 "2015-03-02T22:47:04Z")

</div>

Check around line 82. If your Super Moderator and Admin roles aren’t named as such (or it can’t find them), just hardcode the ID of each respective role.

---

<div class="post-metadata">

**Author:** ![kaliha](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kaliha/32/115707_2.png) [@kaliha](https://meta.discourse.org/u/kaliha)\
**Post date:** [Mars 3, 2015, 3:33 UTC](https://meta.discourse.org/t/paid-need-a-vanilla-2-import-tool/14852/70 "2015-03-03T15:33:10Z")

</div>

Cool. Thanks. Non-english username not work ☹ is it ok? It’s look like 1133, or some else numeric.

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [Mai 2, 2015, 10:11 UTC](https://meta.discourse.org/t/paid-need-a-vanilla-2-import-tool/14852/71 "2015-05-02T10:11:28Z")

</div>



[Page précédente](https://meta.discourse.org/t/paid-need-a-vanilla-2-import-tool/14852.md?page=3)
