Support forums

Please check @brandnewbox_uk for support status updates.

Search     Advanced Search
Creating XML imports: use field names as XML tags?  
Posted: 15 September 2017 12:55 AM —  
Newbie
Rank
Total Posts:  8
Joined  2017-09-02

Hi,

I want to import data from one EE installation (EE2.9) into another (EE3.5.10), using XML. I have already created the entry shells in the EE3 installation, so I will need some of the entries’ fields to be overwritten. I plan to use the URL as the unique key, since the entry IDs do not match up but the URLs do. I also plan to import in batches of 10, so that I can check the status of the imports. This may seem like a lot of work…but I’d rather go very carefully. And 10 at a time is still a LOT faster than manual copy-paste. (Once I have confidence in both DG and in my ability to prep the data for import, I’ll go in larger batches.)

When creating the XML feed, do I just use the names of my fields, as the XML tags? For example:

I have fields called intro, featuredImg, imgLarge, and extendedText. Would I create an XML file that looked like this:

<root>
  <entry>
      <url>a-unique-url</url>
      <intro>![CDATA[Introductory text that will contain some HTML]]</intro>
      <featuredImg>http://brandnewbox.co.uk/images/avatars/my_image_name.png</featuredImg>
      <img>![CDATA[http://brandnewbox.co.uk/images/avatars/my_image_name.png]]</imgLarge>
      <extendedText>![CDATA[will contain some text that was formatted as XHTML in EE]]</extendedText>
  </entry>
  <entry>
      <url>the-url-of-another-entry</url>
      <intro>![CDATA[Dummy Title 2]]</intro>
      <featuredImg>http://brandnewbox.co.uk/images/avatars/my_image_name.png</featuredImg>
      <img>![CDATA[http://brandnewbox.co.uk/images/avatars/my_image_name.png]]</imgLarge>
      <extendedText>![CDATA[will contain some text that was formatted as XHTML in EE]]</extendedText>
  </entry>
(and so on, for nowever many entries I want to have in the import file)
</root>

Further questions:

Can Datagrab handle the XML CDATA escape, or will I need to convert and then convert-back, all of my in-field HTML tags?

How does Datagrab handle fields or text that were formatted as XHTML in EE? Do blank lines/carriage returns get imported over as expected?

Profile
 

‹‹ Can’t get JSON import working on EE 3      Automate DataGrab based on dates ››

Select A Theme