Import Vanilla problems


(Multicam) #1

Hi there,

I am having trouble importing vanilla data into Discourse.

I have followed that topic’s instructions: How to migrate from Vanilla to Discourse!

And I get this error:

loading existing groups...
loading existing users...
loading existing categories...
loading existing posts...
loading existing topics...
parsing file...
reading file...
parsing users...
parsing roles...
parsing user_roles...
parsing categories...
parsing discussions...
parsing comments...

importing users...
     1173 / 1291 ( 90.9%)  Skipping user id 6758 because email is blank
     1291 / 1291 (100.0%)
importing categories...
script/import_scripts/vanilla.rb:117:in `import_categories': undefined method `[]' for nil:NilClass (NoMethodError)
        from script/import_scripts/vanilla.rb:20:in `execute'
        from /var/www/discourse/script/import_scripts/base.rb:78:in `perform'
        from script/import_scripts/vanilla.rb:254:in `<main>'

No dates seem to be present in the categories table export file…

Thanks in advance.


How to import a Phorum database (via Vanilla Porter)
(Multicam) #2

If that can help here is an extract of the category bit of the vanilla export file:

Table: Category
CategoryID:int,Name:varchar(255),Description:varchar(500),ParentCategoryID:int,Sort:int
"1000001","General Category","",\N,"0"
"1","Announcements","Read this forum first to find out the latest information. NOTE: You must be logged in to view this    forum\, login is on the top right of this page.","1000001","0"

I also tried to add DateInserted at the end of each line – no luck –

Table: Category
CategoryID:int,Name:varchar(255),Description:varchar(500),ParentCategoryID:int,Sort:int,DateInserted:datetime
"1000001","General Category","",\N,"0","2010-09-08 07:06:05"
"1","Announcements","Read this forum first to find out the latest information. NOTE: You must be logged in to view this    forum\, login is on the top right of this page.","1000001","0","2010-09-08 07:06:05"

While I was writing this, I just realise that the top level ID for categories was “1000001” in the file, and the script is expecting “-1”. Search/replace fixed the problem!

Woohoo – importing right now :smile:

I’ll live that post up in case someone get bitten by the same thing.


(Abdul Munim Zahid) #3

Yes, thats a very common issue actually. Top level category.

Anyways, if you run into anymore problems; do post here, I will help!