When I take a look at the output file of the stsadm -o export
command, I can see a "simple" xml file that takes the full content of a site.
Is it safe to reuse such an xml file to import data through stsadm -o import
command ?
I mean, can I generate an xml file that respect the SP format to inject data to SP ?
something like this :
<SPObject Id="2efe1c96-cf29-4ade-9f5f-f73451f07576" ObjectType="SPListItem" ParentId="fa5afbc9-0e48-4开发者_高级运维bde-bceb-a65bcf3fe862" ParentWebId="f0bc765d-1b02-4c03-b59d-5d0ab85a0db5" ParentWebUrl="/aide" Url="/aide/Pages Wiki/Colonne Statut.aspx">
<ListItem
FileUrl="Pages Wiki/Colonne Statut.aspx"
DocType="File"
ParentFolderId="0f70edd9-1b3d-48a9-b7cc-de21413e2158"
Id="2efe1c96-cf29-4ade-9f5f-f73451f07576"
ParentWebId="f0bc765d-1b02-4c03-b59d-5d0ab85a0db5"
ParentListId="fa5afbc9-0e48-4bde-bceb-a65bcf3fe862"
IntId="9"
DocId="7ab00ce5-cff2-458b-b353-c5f27710b1f7"
Version="1.0"
ContentTypeId="0x01010800EC194E065D111C41960C31AE6200DFB2"
Author="1"
ModifiedBy="1"
TimeLastModified="2010-07-23T15:03:27"
TimeCreated="2010-07-23T15:03:27" ModerationStatus="Approved">
<Fields>
<Field Name="_ModerationComments" FieldId="34ad21eb-75bd-4544-8c73-0e08330291fe" />
<Field Name="Modified_x0020_By" FieldId="822c78e3-1ea9-4943-b449-57863ad33ca9" />
<Field Name="Created_x0020_By" FieldId="4dd7e525-8d6b-4cb4-9d3e-44ee25f973eb" />
<Field Name="_SourceUrl" FieldId="c63a459d-54ba-4ab7-933a-dcf1c6fadec2" />
<Field Name="MyField" Value="MyVal" />
</Fields>
</ListItem>
</SPObject>
My actual goal is to populate a few list from an xml export of a custom master application, in an ETL way.
Have you looked at using the Business Connectivity Services instead? This is available in the SharePoint Foundation 2010. In SharePoint 2007, you would need the BDC and the corresponding licence.
Otherwise I would recommend using the lists webservice.
I can see only pain and frustration coming from using the import, even if it did work.
In the case where you are able to run an stsadm command, I would recommend creating a powershell script to use the object model to make the changes.
The powershell script could then load an xml file for the list of changes needed.
You need GUIDs for key properties required for the object model to construct the elements to be written, when importing via STSADM -o import
. This will be extremely long and tedious to do. You're far safer either drumming up an intermediate application using Lists Webservice, or the Client Object Model.
精彩评论