Drupal Import

3 views
Skip to first unread message

Chris Everest

unread,
Dec 17, 2009, 3:56:25 PM12/17/09
to habari...@googlegroups.com
Has anyone been able to use the drupal import plugin on Habari as of
late? I am getting an error in my plugin panel that says.

I am using the latest version of Habari 0.6.3 and an svn version dated
Oct 18 2009 for the drupalimport plugin. Also, i have it in the
user/plugins folder.

"The plugin file
/home/cex/www-habari/user/plugins/drupalimport/drupalimport.plugin.php
had syntax errors and could not load."

--
Chris Everest

Andy C

unread,
Dec 18, 2009, 7:11:16 AM12/18/09
to habari-users
Hi Chris

I made a couple of minor tweaks to the Drupal importer (missing PHP
close tag and a array type fix I merged from the WP importer).

https://trac.habariproject.org/habari-extras/changeset/2571

which means I can now activate the plugin and enter DB credentials
using Habari 0.6.3.

However, I only have a Drupal 6.x install and the code explicitly
checks for 5.x DB structure so if you're using 6.x, you may need to
make some additional changes.

HTH (a little).
--
Andy

Andy C

unread,
Dec 18, 2009, 11:00:22 AM12/18/09
to habari-users
Chris

I managed to import a Drupal 6.x site into Habari 0.6.3 using SQLite.

I simply had to remove the check for a table called menu (c. line 68).
The rest of the Drupal DB structure seems the same.

if ( $has_node_type ) {
$stage = 2;
}

Also, on SQLite, I had to populate post->id with the Drupal post id
(otherwise the id was always 0 and a primary key violation happened
when adding posts). I thought this was an auto-increment field but
still.

$p = new Post( $post_array );
$p->id = $post_array['nid'];

Both of these are hacks IMHO so I didn't bother submitting to trac but
it may help you progress.

Oh and the '$_POST->getArrayCopy()' change has to be applied for each
occurrence of 'array_intersect_key'
--
Andy

Andy C

unread,
Dec 18, 2009, 11:59:54 AM12/18/09
to habari-users
On the basis that what I created was better than what was there
before, I did commit my changes.

I created a version for 0.6.3 and updated trunk for 0.7.

Chris Everest

unread,
Dec 19, 2009, 10:38:11 AM12/19/09
to habari...@googlegroups.com
On Fri, Dec 18, 2009 at 11:59 AM, Andy C <andy...@gmail.com> wrote:
> On the basis that what I created was better than what was there
> before, I did commit my changes.
>
> I created a version for 0.6.3 and updated trunk for 0.7.
>

Thanks Andy, i was able to run the import plugin successfully.
Though, I think it's erroring out on some 'Audio' content types. I
'unforturnately' have a pretty complicated drupal setup which may not
be so import friendly.

But I got a lot of stuff imported.


--
Chris Everest

Andy C

unread,
Dec 20, 2009, 5:39:42 AM12/20/09
to habari-users
That's good news. I suspect the importer will also need mods for 0.7
to reflect taxonomy, tags et al more closely.

On Dec 19, 3:38 pm, Chris Everest <chrisever...@gmail.com> wrote:

Reply all
Reply to author
Forward
0 new messages