Closed (fixed)
Project:
Migrate
Version:
7.x-2.6-rc1
Component:
Performance
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
11 Aug 2013 at 06:09 UTC
Updated:
29 Apr 2014 at 14:50 UTC
Jump to comment: Most recent
Comments
Comment #1
simon.westyn commentedFrom my experience you should use MigrateSourceMultiItems for small xml files, and MigrateSourceXML for large files.
Small xml:
$this->source = new MigrateSourceMultiItems($items_class, $fields);Big xml:
$this->source = new MigrateSourceXML('ftp://<username>:<password>@<ipaddress>/file.xml', $item_xpath, $item_ID_xpath);Comment #2
mikeryanTo expand on Simon's reply - MigrateSourceMultiItems() uses the SimpleXML PHP extension, which reads and parses the entire XML file into memory. The advantage of using this is you have the full power of xpaths at your disposal, to instantly address any data within the XML, but the disadvantage is memory and speed for large files. MigrateSourceXML uses the XMLReader extension, which allows it to iteratively parse and process the XML file, but the disadvantage is more limited xpath support. See https://drupal.org/node/1152156 for more information.
See also https://drupal.org/node/2136603 for general help diagnosing and improving performance issues.