Cant export folders

Jul 21, 2016 at 11:34 AM

For Folders

Hi all

Here is my XML for folders
<?xml version="1.0" encoding="utf-8"?>
<DataSetImportSettings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Source>
    <SourceDataSetType>OLEDbSelect</SourceDataSetType>
    <OleDbSourceDataSetSettings>
      <ConnectionString>Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\xxx\StaffFolders.xlsx;Extended Properties="Excel 12.0 Xml;HDR=YES;IMEX=0";</ConnectionString>
    </OleDbSourceDataSetSettings>
    <OleDbTableSourceDataSetSettings />
    <OleDbSelectSourceDataSetSettings>
      <SelectStatement>select * from [directories$]</SelectStatement>
    </OleDbSelectSourceDataSetSettings>
  </Source>
  <Destination>
    <AuthenticationSettings>
      <AuthenticationType>Office365</AuthenticationType>
      <domain />
      <username>xxxxx@xxxxxxxx.onmicrosoft.com</username>
      <encryptedpassed>xxxxxxxx</encryptedpassed>
    </AuthenticationSettings>
    <DestinationItemSettings>
      <DestinationItemType>Folder</DestinationItemType>
      <ItemExistsBehaviour>Overwrite</ItemExistsBehaviour>
      <ImportMappings>
        <ImportMapping xsi:type="ImportMapping_String">
          <DestinationField>Title</DestinationField>
          <SourceColumn>Title</SourceColumn>
        </ImportMapping>
        <ImportMapping xsi:type="ImportMapping_Native">
          <DestinationField>EmployeeNumber</DestinationField>
          <SourceColumn>Employee Number</SourceColumn>
        </ImportMapping>
        <ImportMapping xsi:type="ImportMapping_ManagedMetaDataAutoAdd">
          <DestinationField>Employee Name</DestinationField>
          <SourceColumn>Employee Name</SourceColumn>
        </ImportMapping>
        <ImportMapping xsi:type="ImportMapping_DateTimeFromString">
          <DestinationField>DateOfLeaving</DestinationField>
          <SourceColumn>Date of Leaving</SourceColumn>
          <ConversionMask>dd/MM/yyyy hh:mm:ss</ConversionMask>
          <Culture>fr-FR</Culture>
        </ImportMapping>
        <ImportMapping xsi:type="ImportMapping_Lookup">
          <DestinationField>Job</DestinationField>
          <SourceColumn>Job Title</SourceColumn>
          <LookupListTitle>Jobs</LookupListTitle>
          <LookupFieldInternalName>Title</LookupFieldInternalName>
          <LookupFieldCAMLType>Text</LookupFieldCAMLType>
        </ImportMapping>
      </ImportMappings>
    </DestinationItemSettings>
    <DestinationListSettings>
      <DestinationWebUrlRelative>/</DestinationWebUrlRelative>
      <DestinationFolderUrlRelative>/Importations/F01</DestinationFolderUrlRelative>
      <DestinationServerUrl>https://xxxx.sharepoint.com</DestinationServerUrl>
      <DestinationListName>Importations</DestinationListName>
    </DestinationListSettings>
    <SourceColumns>
      <SourceFileNameAndPath>FullName</SourceFileNameAndPath>
      <ContentType>ContentType</ContentType>
      <DestinationSubFolder>DestinationSubDirectories</DestinationSubFolder>
      <DestinationFileName>DestinationFolderName</DestinationFileName>
    </SourceColumns>
  </Destination>
</DataSetImportSettings>
and here is the output for the first folder (same thing for the rest)

About to connect to source :
Source connected :
Source filled : 5 rows loaded
About to connect to destination :
Destination connected :
Exception importing : D:\xxx\Shared Folders\Staff\A\Adams, David - 1002 : Cette opération ne peut être effectuée que sur un fichier ; « https://xxx.sharepoint.com/Importations/F01/Staff/1002 » est un dossier.

Something is being doing on the folder as an SPItem so what's wrong ?

Help plz
Jul 21, 2016 at 2:38 PM
MarwenK,

Thanks for the message - this might explain your other problem as well - certainly you need a folder structure first.

Your following setting looks wrong to me;

<DestinationFolderUrlRelative>/Importations/F01</DestinationFolderUrlRelative>

I will assume that "Importations" is a document library in the root web and F01 is a folder inside it that you have already created

So the above should be

<DestinationFolderUrlRelative>/Importations</DestinationFolderUrlRelative>

If you want to create folders directly inside F01 then when you do a folder import the DestinationSubDirectories would be F01 and the DestinationFolderName
would be the name of the folder that you want to create.

If you want to create a deeper structure such as F01\Staff the DestinationSubDirectories would be F01\Staff and the DestinationFolderName
would be the name of the folder that you want to create.

I hope that this helps
Jul 21, 2016 at 3:27 PM
Edited Jul 21, 2016 at 3:30 PM
You put me on the right way, thank you

I was missing the xlsx -> DestinationSubDirectories "staff" folder

so I just added a Staff folder inside Importations DocumentLibrary
Jul 27, 2016 at 2:00 PM
I used the power shell script to generate my own csv I added the UTF 8 encoding for output


Thank you @MadAboutImport
Jul 27, 2016 at 2:02 PM

MarwenK

If you have had a success with DIFS then if you have time do post your success story or add a review. Also interested to hear about enhancements.

Jul 27, 2016 at 3:21 PM
Yes the tool is powerful in the case we know how it works :)
the configuration with xml and xlsx files was not easy in the beginning but later I understand the fact it can be really helpful for managing metadatas and content types.

thank you @MadAboutImports
Jul 27, 2016 at 3:31 PM

Thanks; Will try and improve the documentation when time permits!

Jul 28, 2016 at 9:07 AM