0

Thanks for take time to read this question.

I want to import a XML file. XML content will create/update: nodes, relations nodes/users, and taxonomy terms (to several vocabularies) and his relation with nodes. I want to know, if is possible, your experiences and suggestions about this kind of requirements, or modules to resolve this, or if is best a custom code.

thanks in advance.

2 Answers 2

2

@rocketeerbkw's answer is good, but personally I find that a custom import script is the way to go. The source for the Wordpress Import module is a good starting point for how to do things, and there are lots of other articles on the web about creating nodes with code.

Based on experience doing this on several projects, I find that I get things done quicker with a custom import script, and that I can fine tune things better.

Make sure you also install Backup and Migrate so you can quickly backup/restore your database as you work on the data import.

2
  • thanks for take time to answer. Yes, I think that a custom script can be very felxible. Also I will review the recomendations of rocketeerbkw.
    – cigotete
    Aug 10, 2011 at 19:54
  • I have tried and to me this way is more flexible.
    – cigotete
    Sep 21, 2011 at 19:56
2

The migrate and migrate extras modules are your best friend for this (for Drupal 6 and 7).

The downside is all configuration is done in PHP Classes so you must have a reasonable amount of knowledge about them.

The upside is the documentation. The migrate module comes with an excellent example module that has examples for importing taxonomy, users, nodes + comments, files and roles from a SQL database and XML (it can also import from CSV, JSON and more but is not part of example module)

If you're looking for a nice UI to handle all this, migrate is not for you. You won't find anything else as flexible and full featured though.

1
  • Hi rocketeerbkw, thanks for your recomendation, I will review your suggestions (migrate and migrate extras).
    – cigotete
    Aug 10, 2011 at 19:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.