jpSimkins / Drupal2WordPress-Plugin

WordPress plugin for importing Drupal

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Migration including Drupal custom fields

thelegendaryant opened this issue · comments

Hi,

Thanks for your helpfull plugin :).

1/ I'm moving a site from a drupal website that have specifics' fields (inputs fields, files, and additional images such as: field_slideshow, field_book, etc...).

Is it a way to also import these fields while importing data from Drupal's database to the WordPress one?

2/ Also, during the import process, I'm facing that issue :

"Error querying database. : SELECT u.fid, m.uri, m.filename, m.origname FROM file_usage u LEFT JOIN file_managed m ON (m.fid = u.fid) WHERE u.type = 'node' AND u.id = 2 "

for all the contents.

Regards.

You're welcome :)

Sorry it took so long to reply, hectic week at work.

1) Yes, I added in hooks due to special cases. I use them heavily for a heavily customized version of Drupal I just finished porting to WordPress. You can see a rough list here: https://github.com/jpSimkins/Drupal2WordPress-Plugin/wiki/Hooks

I would recommend you hook into drupal2wp_content_after_post_insert or drupal2wp_after_import_content. The former is run after each post is inserted into WordPress and the later is after all the content is imported. Since the ID's are the same across the system, you won't need the post even if the content is coupled to the post. Keep in mind, both hooks have arguments and one is the importer object ($importObj). I'd recommend you print_r so you can see what's available. I will be adding this information on the wiki in the coming week/months as well as improving the plugin. Also look around Drupal2WordPressDrupalImporter_7 if you want to see how it was used.

I would like to add common modules to this importer so if you want to help with that, send me a copy of your DB. Please clear out all user passwords and fake or clear out user emails and any other confidential details if you do decide to do this. Also, please set it to a default theme so I can use it on my Drupal Dev.

2) This may actually be due to a custom module on the Drupal site I worked on when I developed this. I never used Drupal so I didn't really know what modules were until I got deeper into working on this. I think that was due to a custom fields module. I'll see which one it was when I get a chance.

For now, to bypass this method, open Drupal2WordPressDrupalImporter_7.php and comment out line: 305. That line should be: $this->_importMedia(); in the method importContent. That was how media was attached on my content for the Drupal site. I assumed that was standard. I'll fix this in a later release as I am restructuring the code to be more efficient and work more off hooks.