Import, Export, Copy, and Delete List Items

Posted on Posted in SharePoint 2007, STSADM Commands

As part of my upgrade I’ve discovered a need to be able to add items to various lists. I considered a couple of approaches including creating a command that would allow me to specify the field names and values that I wanted to add to the list. Eventually though I concluded that the best and most flexible approach was to use the deployment API to export list items and then import them. The nice part about this approach was that the code was very similar to what I did for exporting and importing of lists. Another benefit is that if you are importing list items into a list that does not have all the fields needed those fields will be automatically created without any extra coding.

I originally set out to just create the export and import commands and then decided to create a delete command so that I could clean up all my test entries. Once I had the export and import done creating a copy command was really simple as it just wraps up those commands. The code to work with the content deployment API is pretty straightforward. Stefan Goßner does a really good job at explaining how to use the API in his blog Deep Dive into SharePoint Content Deployment and Migration API so I won’t reiterate it here. The commands I created are detailed below.

1. gl-exportlistitem

This command works almost identically to the gl-exportlist command that I created earlier. The main difference is that it takes in an optional "id" parameter which can be a single list item ID or a comma separated list of list item IDs. The syntax of the command can be seen below:

C:\>stsadm -help gl-exportlistitem

stsadm -o gl-exportlistitem

Exports a list item or items.

Parameters:
        -url <list view url>
        -filename <export file name>
        [-id <list item ID (separate multiple items with a comma)>]
        [-overwrite]
        [-includeusersecurity]
        [-haltonwarning]
        [-haltonfatalerror]
        [-nologfile]
        [-versions <1-4>
                1 - Last major version for files and list items
                2 - The current version, either the last major or the last minor
                3 - Last major and last minor version for files and list items
                4 - All versions for files and list items (default)]
        [-cabsize <integer from 1-1024 megabytes> (default: 25)]
        [-nofilecompression]
        [-quiet]

Here’s an example of how to export 3 items from the site directory list:

stsadm –o gl-exportlistitem -url "http://intranet/sitedirectory/siteslist/AllItems.aspx" -id "1,2,3" -filename "c:\SiteDirItems" -includeusersecurity -versions 4 -nofilecompression

Running the above will create a folder called "SiteDirItems" in the root c: drive. You’ll also find a log file there containing the same information that was dumped to the console. This same output can then be used by the gl-importlistitem command to copy the list items to another list in any site collection (note that the target could be on any web app in any farm). To export all items in a list simply omit the "id" parameter.

2. gl-importlistitem

This command has almost exactly the same parameters as the built in "import" command. One additional parameter of note is the "-retargetlinks" parameter. If this parameter is specified then you must also specify the "-sourceurl" parameter which corresponds to a view of the source list. The "retargetlinks" parameter tells the code to find any links that point to items in the source list and make them point to the target list.

This becomes helpful in a move operation. Note that only items identified by the list items BackwardLinks collection will get modified (unfortunately I’m not 100% clear about when and how this collection is set so I don’t claim that using this will fix every link to your items, though I do have another command that will loop through every field of every item of every list of every site and adjust the field value by replacing one value with another). The syntax of the command can be seen below:

C:\>stsadm -help gl-importlistitem

stsadm -o gl-importlistitem

Imports a list item or items.

Parameters:
        -url <list view url to import into>
        -filename <import file name>
        [-includeusersecurity]
        [-haltonwarning]
        [-haltonfatalerror]
        [-nologfile]
        [-updateversions <1-3>
                1 - Add new versions to the current file (default)
                2 - Overwrite the file and all its versions (delete then insert)
                3 - Ignore the file if it exists on the destination]
        [-nofilecompression]
        [-quiet]
        [-retargetlinks (resets links pointing to the source to now point to the target)]
        [-sourceurl <url to a view of the original list> (use if retargetlinks)]
        [-retainobjectidentity]

Here’s an example of how to import the items into the SiteDirectory list that we exported above and re-target any links pointing to the original documents so that they now point to the new documents (note that just like the built in import operation if you specify nofilecompression for the export you must also specify it for the import):

stsadm –o gl-importlistitem -url "http://teamsites/sitedirectory/siteslist/allitems.aspx" -filename "c:\SiteDirItems" -includeusersecurity -updateversions 2 -nofilecompression -retargetlinks -sourceurl "http://intranet/sitedirectory/siteslist/AllItems.aspx"

As with the exportlistitem operation a log file will be generated which will include all the details that were dumped to the console.

Update 11/15/2007: Apparently there’s some sort of funky bug with the deployment API which is preventing the importing of list items from functioning 100% (see the comments below from David who discovered the issue). The problem is that if you import a list item that has dependencies in different folders either the dependencies or the dependent items will be placed in the wrong folder. There’s a way with code that you can set the TargetParentUrl for orphaned items which is supposed to correct this – unfortunately it appears that whatever URL is first set gets used for all remaining items. The interesting thing is that you shouldn’t need to set this property at all because all the list items are going to the same targe web and the WebUrl property of the SPImportSettings object is being set but if I don’t set anything then the items still end up in the wrong location. The unfortunate side affect of this is that in order to prevent things from appearing in what would seem random locations and thus making it difficult to find imported items I’ve had to force everything to go to the root folder. Fortunately it’s fairly easy to move things around after the import but it’s still what should be an unnecessary pain in the butt. If anyone has any information which can help me solve this problem please pass it along (I spent two days picking through disassembled code trying to identify where the failure was but was not able to find anything conclusive – I also spent quite a bit of time trying to provide a work around to fix it but ran into to many issues where I’d fix one thing and break another (it’s just too hard to predict every possible combination of possibilities that could occur)).

3. gl-copylistitem

If you’ve got the ability to import and export list items then why not make it a one step operation to copy a list item or move a list item. Once I had the code for the import and export the copy was nothing more than a wrapper which would call into the appropriate methods. By adding an extra parameter to support deleting the source list item I now also had a move command. The syntax of the command is just the combination of the import and export minus that which I don’t need the user to set. The syntax of the command can be seen below:

C:\>stsadm -help gl-copylistitem

Copies a list item or items to another list.

Parameters:
        -sourceurl <list view url to copy>
        -targeturl <url of a web site to copy to>
        [-id <list item ID (separate multiple items with a comma)>]
        [-includeusersecurity]
        [-haltonwarning]
        [-haltonfatalerror]
        [-nologfile]
        [-versions <1-4>
                1 - Last major version for files and list items
                2 - The current version, either the last major or the last minor
                3 - Last major and last minor version for files and list items
                4 - All versions for files and list items (default)]
        [-updateversions <1-3>
                1 - Add new versions to the current file (default)
                2 - Overwrite the file and all its versions (delete then insert)

                3 - Ignore the file if it exists on the destination]
        [-quiet]
        [-retargetlinks (resets links pointing to the source to now point to the target)]
        [-deletesource]

Here’s an example of how to perform the same operation that the above import and export commands were doing but with just one step while at the same time deleting the source list items:

stsadm –o gl-copylistitem -sourceurl "http://intranet/sitedirectory/siteslist/AllItems.aspx" -targeturl "http://teamsites/sitedirectory/siteslist/allitems.aspx" -id "1,2,3" -includeusersecurity -updateversions 2 -versions 4 -nofilecompression -retargetlinks -deletesource

If the source list items were deleted then the result of the export operation is saved to a temp folder, the path to which is displayed to the user upon completion. To delete all items in a list simply ommit the "id" parameter.

4. gl-deletelistitem

I created this command because I needed a quick way to clean up all my test items that I was creating while testing the gl-importlistitem command. So even though I didn’t need it for my upgrade project specifically it came in handy for me so I figure someone else may benefit from it as well. The command allows you to either delete all items or specific items by passing in an "id" parameter. The syntax of the command can be seen below:

C:\>stsadm -help gl-deletelistitem

Deletes an item or items from a list.

Parameters:
        -url <list view URL>
        [-id <list item ID (separate multiple items with a comma)>]
        [-deletefolders]

Here’s an example of how to delete items from a list:

stsadm –o gl-deletelistitem -url "http://intranet/sitedirectory/siteslist/AllItems.aspx" -id "1,2,3"

To delete all items from a list simply omit the "id" parameter.

Update 12/18/2007: I’ve added a deletefolders option to the gl-deletelistitem command. This parameter only takes affect when you don’t specify an ID because you could previously delete a folder by specifying the folder’s ID.

104 thoughts on “Import, Export, Copy, and Delete List Items

  1. Great tool, but I had one issue: I exported some layout pages that had Preview Images associated with them, and the preview images were included in the export. When I imported them again to the same server (as a test), the preview images (e.g., articleleft.png) were created in the \masterpage folder, rather than in the \masterpage\en-us\Preview Images folder, which is where they came from. I checked the import log file, and it says it put the png files in the Preview Images folder, but it didn’t; it put them in /masterpage. I checked the preview image in the CreatePage.aspx page, and they still work, but they point to the new location. So nothing broke, but I’m still concerned. Can you explain why it did this, and can it be fixed?

  2. If you look at the Manifest.xml file that gets generated when you do the export you’ll see an ListItem node for the preview image. In there is the ParentFolderId attribute – looking at Microsoft’s code it appears that this attribute is used to identify the folder but only when retainobjectidentity is true – it should be using the DirName attribute otherwise. I’ll try to reproduce the problem and see if I can’t at least repair it post import (the issue is definitely specific to Microsoft’s code as I’m just using their Deployment API for all of this).

  3. David – the good news is that I was able to quickly reproduce the problem. The bad news is that despite two days of effort I was unable to find a work around or solution to it. There’s definitely a bug in Microsoft’s deployment API. I’m going to update the content above with my findings and send an email to Stefan Goßner to see if he has any thoughts. Thanks for pointing this out to me!

  4. David – I took another look at this and was able to provide a workaround which seems to do pretty well. It only works for files as there’s no built-in way to move a list item that does not contain a file but I think this will make a big difference (it at least addresses the specific problem you identified). I’ve updated the code with my changes so feel free to download and give it a try.

  5. Gary, could you pls help to find out what could be causing the following error that happens during the process of importing list items using “gl-importlistitem”?

    “…
    Progress: Importing Folder /Empreendimentos/PublishingImages/Forms/Document.
    FatalError: (null) “Empreendimentos/Lists/Empreendimentos/Forms/Document” not found.
    at Microsoft.SharePoint.Library.SPRequest.CreateFolderOnImport(String bstrUrl, String bstrFolderU
    rl, Guid guidFolderId, Int32 lDoclibRowId)
    at Microsoft.SharePoint.Deployment.FolderSerializer.CreateFolder(SerializationInfoHelper infoHelp
    er, SPWeb parentWeb, ImportObjectManager objectManager)
    at Microsoft.SharePoint.Deployment.FolderSerializer.SetObjectData(Object obj, SerializationInfo i
    nfo, StreamingContext context, ISurrogateSelector selector)
    at Microsoft.SharePoint.Deployment.XmlFormatter.ParseObject(Type objectType, Boolean isChildObjec
    t)
    at Microsoft.SharePoint.Deployment.XmlFormatter.DeserializeObject(Type objectType, Boolean isChil
    dObject, DeploymentObject envelope)
    at Microsoft.SharePoint.Deployment.XmlFormatter.Deserialize(Stream serializationStream)
    at Microsoft.SharePoint.Deployment.ObjectSerializer.Deserialize(Stream serializationStream)
    at Microsoft.SharePoint.Deployment.ImportObjectManager.ProcessObject(XmlReader xmlReader)
    at Microsoft.SharePoint.Deployment.SPImport.DeserializeObjects()
    at Microsoft.SharePoint.Deployment.SPImport.Run()
    Progress: Import Completed.
    Finish Time: 5/7/2008 8:17:55 PM.
    Completed with 0 warnings.
    Completed with 1 errors.

    It seems it’s trying to create a folder called “Empreendimentos/Lists/Empreendimentos/Forms/Document” but I don’t have such a folder in the original site from which I’ve exported the list items!

  6. Hi,

    I am receiving the following error on using “gl-deleteitemlist”.

    Could not load file or assembly ‘Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c’ or one of its dependencies. The system cannot find the file specified.

    However, I am able to use “gl-additemlist”. What could be the possible reason?

  7. It’s erroring out because you are probably running this against WSS which I’ve not tested on. The code is checking to see if the item you are deleting is the welcome page – I need to add some exception handling to account for when that dll does not exist (WSS) – I’ll try to look at it this weekend if I have time.

  8. Claudia – unfortunately this is an issue with the content deployment API – I know that MSFT is working on a hotfix for the API but I don’t have a timeline yet.

  9. Wonderful tool. My aim is to move one item from a discussion to another one. Unfortunately, the gl-copylistitem seems not to be capable to do this. No luck for me. Any idea ?

  10. Thank you for your answser. I actually used the -id parameter (-id “1,2”). My test was done on WSS. 2 sample discussions board have been created.
    The first one contains one dicussion (id=1) and a reply (id=2). The second one is empty. The operation generates no error when importing/exporting but displays a warning : WARNING: Unable to find parent folder for ‘Lists/forum2/2_.000’.
    Finally, the forum2 contains only the reply (without subject) but not the first discussion item.

  11. Doing some test with this I found it will not export survey items that are not completed. Is there anyway to get these as well?

  12. I refreshed my verision of your extensions on 7/2, so I should have the latest version. I think that uncompleted survey entries may be hidden in the same way that new uploaded, unchecked in documents are. They only seem to be accessable only to the author.

  13. Gerald – it feels like a sequencing issue – like it’s trying to add the reply before the original post. If you look at the exported manifext.xml file does it have item ID 1 listed first? As this is using the straight up content deployment stuff I’m honestly not sure what I can do to work around it. You might want to try the gl-exportlistitem2 and gl-addlistitem commands to see if they work any better for you.

  14. Great tool Gary…

    Running the exportlist/importlistitem and coming across the issue of items not importing into the same list where we had exported (then deleted before importing again)…only doing this purely for testing purposes…

    The importlistitem command was (live server/filenames excluded…)

    stsadm -o gl-importlistitem -url “http://test1/testDocLib/Forms/AllItems.aspx” -filename “C:\testdoclib” -includeusersecurity -updateversions 2 -nofilecompression -retainobjectidentity

    In the log file the following errors were occuring:

    [7/29/2008 2:19:59 PM]: Start Time: 7/29/2008 2:19:59 PM.
    [7/29/2008 2:19:59 PM]: Progress: Initializing Import.
    [7/29/2008 2:20:00 PM]: Debug: Security check failed in OnUserGroupExport
    [7/29/2008 2:20:00 PM]: Warning: The specified user could not be found.
    *** Inner exception:
    User cannot be found.
    at Microsoft.SharePoint.SPUserCollection.FindUserSID(String strSearchText)
    at Microsoft.SharePoint.SPUserCollection.GetBySID(String strSid)
    at Microsoft.SharePoint.SPUserCollection.GetBySID(Byte[] byteSid)
    at Microsoft.SharePoint.Deployment.SecurityObjectSerializer.ResolveUser(ImportStreamingContext context, SPWeb web, Byte[] sid, Int32& idUser)
    [7/29/2008 2:20:00 PM]: Debug: Security check failed in OnUserGroupExport
    [7/29/2008 2:20:00 PM]: Debug: Security check failed in OnUserGroupExport
    [7/29/2008 2:20:00 PM]: Debug: Security check failed in OnUserGroupExport
    [7/29/2008 2:20:00 PM]: Warning: The specified user could not be found.
    .
    .
    .
    [7/29/2008 3:17:34 PM]: Progress: Starting content import.
    [7/29/2008 3:17:34 PM]: Progress: De-Serializing Objects to Database.
    [7/29/2008 3:17:34 PM]: Progress: Importing File DeleteTestDocLib4/ConsultantList.udcx.
    [7/29/2008 3:17:34 PM]: Progress: Importing File DeleteTestDocLib4/DoesFormExist.udcx.
    [7/29/2008 3:17:34 PM]: Progress: Importing File DeleteTestDocLib4/GetEmailAddress.udcx.
    [7/29/2008 3:17:34 PM]: Progress: Importing ListItem /DeleteTestDocLib4?id=1.
    [7/29/2008 3:17:34 PM]: Debug: Security check failed in OnListItemImport
    [7/29/2008 3:17:34 PM]: Warning: Access denied.
    [7/29/2008 3:17:34 PM]: Progress: Importing ListItem /DeleteTestDocLib4?id=2.
    [7/29/2008 3:17:34 PM]: Debug: Security check failed in OnListItemImport
    [7/29/2008 3:17:34 PM]: Warning: Access denied.
    [7/29/2008 3:17:34 PM]: Progress: Importing ListItem /DeleteTestDocLib4?id=3.
    [7/29/2008 3:17:34 PM]: Debug: Security check failed in OnListItemImport
    [7/29/2008 3:17:34 PM]: Warning: Access denied.
    [7/29/2008 3:17:34 PM]: Debug: Security check failed in OnUserGroupExport
    [7/29/2008 3:17:34 PM]: Progress: Import Completed.
    [7/29/2008 3:17:34 PM]: Finish Time: 7/29/2008 3:17:34 PM.
    [7/29/2008 3:17:34 PM]: Completed with 38 warnings.
    [7/29/2008 3:17:34 PM]: Completed with 0 errors.

    Gary, what causes these errors?

  15. Jason – most likely you have some users that were deleted from the site collection. The retains the IDs of users even if you delete them but when you try to reasign the users via the import it fails because it can’t find them. Take a look at the items that you are trying to import and see what users it is looking for and then manually add those users to the site collection (or hack the exported files to point the items to a different user).

  16. Thanks for the reply Gary…

    I suppose the option I would select is adding the users back to the site collection (so long as they as still exist).

    Does it actually matter if it is left as is?

    Actually got this working (importing) with taking the retainobjectidentity parameter out but still the warning messages appearing.

    The items are accessible (versioning and everything) so that is key.

    The only issue I have had importing these item into a different farm (same site structure) where items were imported into the Root and not the Library designated for these list items. I understand this is a re-parenting issue and will update you once I have updated some code (using your importlistitem code as a base) to test this.

    Thanks again Gary

  17. Hi Gary,

    I’m new in Sharepoint techno.
    Could you tell me how to install your STSADM extension ?
    I put the file Lapointe.SharePoint.STSADM.Commands.WSS.wsp on the “web extensions” folder of the server but obviously there’s other commands to do … I’m looking for help in SP books but I’m sure your help can unblock me rapidly ! 🙂

  18. First, make sure you have the correct WSP file – if your environment is MOSS download the other one otherwise you’re good with that file. Next you need to run stsadm’s addsolution and deploysolution commands to deploy my commands (if you download my source code there’s a sample deployment batch file that you modify and use.

  19. Hello SharePoint Admins!
    These tools are great and make my life a lot easier. Thanks Gary.

    My question: How do I get the IDs of the Listitems for an ExportListItem???

  20. The easiest way is to just modify the list view (or create a new one) and add in the ID column. Otherwise if you click to view the items properties you can find the ID in the URL.

  21. Gary,

    I’m trying to use the export tool and it generating this error:
    Violation of PRIMARY KEY constraint ‘PK__#ExportObjects____7DE93661’. Cannot ins
    ert duplicate key in object ‘dbo.#ExportObjects’.
    The statement has been terminated.

    Any thoughts would be greatly appreciated!

  22. I am trying to use deleteListitem on a document library to delete all the existing Infopath forms.
    I am getting the error
    Object reference not set to an instance of an object.

    The Document LIbrary name has a space as well. In browser the path is something like Approval%20Docs.
    Will deleteListitem work for document libraries with spaces in their name?

  23. Gary, I wonder if you can help out with the issue. I downloaded and installed MOSS tool on a MOSS environment. The tool installed perfectly fine, but if I use gl-copylistitem on a set of id’s, the tool fails during early import (no errors on export). After examining the logs, here is what I found:

    Command ran: stsadm -o gl-copylistitem -sourceurl “http://server/subsite1/subsite2/Lists/CustomList/AllItems.aspx” -targeturl “http://server/subsite1/subsite2/Lists/CustomListArchive/AllItems.aspx” -id “2,3,4,5,6…” -includeusersecurity

    e.g. what I am trying to accomplish is to copy a set of list items from one list on subsite2 to another list on the same subsite2.

    Then the export log shows that the command is exporting a few items outside of subsite2, for example (from the log, names changed):
    Exporting Folder /subsite1/subsite3/ReportingServicesReports/Forms/Document

    On import, it attempts to import the “outside” folder into the subsite2, which fails. For example (from the log, names changed):
    Progress: Importing Folder /subsite1/subsite2/ReportingServicesReports/Forms/Document

    e.g. it takes a folder from a different subsite not specified in the gl-copylistitem command. The next entry in the log is the fatal error:

    FatalError: (null) “subsite1/subsite2/Lists/CustomListArchive/Forms/Document” not found.
    at Microsoft.SharePoint.Library.SPRequest.CreateFolderOnImport(String bstrUrl, String bstrFolderUrl, Guid guidFolderId, Int32 lDoclibRowId)
    at Microsoft.SharePoint.Deployment.FolderSerializer.CreateFolder(SerializationInfoHelper infoHelper, SPWeb parentWeb, ImportObjectManager objectManager)
    at Microsoft.SharePoint.Deployment.FolderSerializer.SetObjectData(Object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
    at Microsoft.SharePoint.Deployment.XmlFormatter.ParseObject(Type objectType, Boolean isChildObject)
    at Microsoft.SharePoint.Deployment.XmlFormatter.DeserializeObject(Type objectType, Boolean isChildObject, DeploymentObject envelope)
    at Microsoft.SharePoint.Deployment.XmlFormatter.Deserialize(Stream serializationStream)
    at Microsoft.SharePoint.Deployment.ObjectSerializer.Deserialize(Stream serializationStream)
    at Microsoft.SharePoint.Deployment.ImportObjectManager.ProcessObject(XmlReader xmlReader)
    at Microsoft.SharePoint.Deployment.SPImport.DeserializeObjects()
    at Microsoft.SharePoint.Deployment.SPImport.Run()

    Sorry for a long post, but any insight is appreciated.

  24. Oksana – This is the behavior of the content deployment API which is what I’m using (it attempts to copy and dependents that the items are dependent on). Try using the gl-exportlistitem and gl-importlistitem commands (which the copy command wraps) and set includedescendents to none. If that still doesn’t work for you then try the gl-exportlistitem2 and gl-addlistitem commands (which don’t use the content deployment API).

  25. Gary, thank you for a quick response. The gl-exportlistitem and gl-importlistitem exhibit the same behavior as mentioned earlier. The gl-exportitem2 and gl-addlistitem don’t capture all of the versions, which is absolutely necessary in my case. Just an FYI – it appears that the gl-copylistitem works if I keep the number of copied items somewhere below 50 (sometimes it runs ok for 40 or so items, but definintely fails at 50), just wish there was a way to determine that “magic number” within API.

  26. Gary,

    Is it possible to use your migrate script (gl-copylistitem) to move items from a custom list into a form library? I am needing to do this but haven’t found anything that can do it, your extensions look promising. I have installed your extension and ran the command, but get an error:

    “Fatal Error: The given key was not present in the dictionary.”… more content, I will post it if you want it.

    Thanks!

  27. Bret – unfortunately it won’t work to use to go from a standard custom list to a form (document) library. You might be able to do something with the gl-exportlistitem2/gl-addlistitem commands but I’ve never tried this scenario – most likely you’ll have to write something custom.

  28. Oksana – was there any kind of stack trace or anything in the logs that’s specific to the 50 item limit? I’ve typically only used this command in all of my testing to copy a very small number of items so I haven’t seen this before.

  29. Thanks Gary,

    I was wondering if that was the case. I am surprised their isn’t a way to handle this. The scenario I am looking at is importing an Excel file into Sharepoint (which then becomes a custom list), but then wanting to work with it using Infopath as the data entry/retrieval interface. I have been reading around about this, but have had no luck so far. Thank you for your extensions though, I am thinking they will prove quite useful as we start to use SharePoint more and more.

    Cheers!

  30. Gary,
    Great tool but I am looking for a bit more precise definition of the -includedescendants flag, so I can understand what it does. I have a task list with related workflow history list. If I use the gl-copylistitems parameter and point it at the task list with -includedescendants specified, will it look into the workflow history, or do I have the “lineage” backwards (e.g., need to copy the history list and -includedescendants of that list)?

  31. no matter what I try to export, O get “Command line error.”

    here is a sample cmd line that fails:
    stsadm –o gl-exportlistitem -url “http://localhost/sites/betaForms/Documents/Forms/AllItems.aspx” -id “1,2,3” -filename “c:\SiteDirItems” -includeusersecurity -versions 4 -nofilecompression

    jdieter@twonails.com

  32. Gary,

    I wanted to use your method copylistitem, as part of a disposition workflow, to move a certain publication page from a news-site to an archive-site in a publication environment with variations activated.

    This can’t be done without SPExportSettings.ExcludeDependencies property set to true, because without it, it will also try to move the corresponding page layout and Variation Relationship Item. We only want to move the Page itself.

    Is it possible that you could add this property in your SPParamCollection parameters, so that we can use the -excludedependencies property in the commandline?
    Thanks in advance.

    BTW. I also noticed that you can’t use the -nofilecompression in gl-copylistitem which you do refer to in your example.

  33. Ruben – thanks for the feedback – I went ahead and added those parameters (slight oversight on my part – they should have been there) – I’ll try to get the code deployed sometime tonight.

  34. Hi Gary,
    Thank you very much, its working fine with List/Libraries.
    When i try gl-copylistitem for Discussion boards its is giving error as “Either List contains no items or the list item cannot be found.”

    Could you please let me how can we use this command for Discussion boards.
    ITs very urgent, please help me .

    Thanks in advance
    Meera

  35. Discussion items are kind of odd in the way that they use folder items to store threads. Try using the gl-exportlist/gl-importlist instead of the copy and play around with the retainobjectidentity and the includedependencies parameters

  36. Hi.
    Great job!
    I have issue: when i export/import
    a wiki document library, the [[links]] in the pages don’t keep their “[[ ]]”.
    Did I miss a parameter ?

  37. I’ve not tested with wiki libraries but all i’m doing is using the out-of-the-box content migration api. What version of the product are you using? Make sure you at least have the infrastructure update installed.

  38. Hi Gary,

    I’m getting this error when I use this command:

    [05/02/2009 17:15:51]: Heure de début : 05/02/2009 17:15:51.
    [05/02/2009 17:15:51]: Progress: Initialisation de l’opération Importer.
    [05/02/2009 17:15:52]: Progress: Début d’importation du contenu.
    [05/02/2009 17:15:52]: FatalError: L’élément a déjà été ajouté. Clé du dictionnaire : ‘fpg-ce-numér rmp-081110.xls’ Clé ajoutée : ‘fpg-ce-numér rmp-081110.xls’
    à System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
    à System.Collections.Hashtable.Add(Object key, Object value)
    à System.Collections.Specialized.StringDictionary.Add(String key, String value)
    à Lapointe.SharePoint.STSADM.Commands.Lists.ImportListItem.OnImportStarted(Object sender, SPDeploymentEventArgs e)
    à Microsoft.SharePoint.Deployment.SPDeployment.OnStarted(SPDeploymentEventArgs e)
    à Microsoft.SharePoint.Deployment.SPImport.Run()
    [05/02/2009 17:15:53]: Progress: Opération Importer terminée.
    [05/02/2009 17:15:53]: Heure de fin : 05/02/2009 17:15:53.
    [05/02/2009 17:15:53]: Opération terminée : 0 avertissements.
    [05/02/2009 17:15:53]: Opération terminée : 1 erreurs.

    in English : Item has already been added !!

    Works when I delete the file of course.

    Any ideas?

  39. I am using gl-copylistitem to copy calendar items to another site’s calendar, but when I copy them, I seem to get double entries in the new calendar. Is this anything anyone else has experienced or perhaps an issue with my original data?

  40. Gary hi,

    I created a publishing site with variations. I wanted to duplicate a site, but as you probably know the option of “save site as template” doesn’t work with publishing sites.
    I created a publishing site, and with your GREAT solution of importlistitem I exported pages from the Pages Library and imported them to a new site. But the variation created only some of the items. Do you know what the problem may be?

    Thanks,
    Armine.

  41. The hidden relationships list is out of sync – see my “Fun With Variations” post about the list – I have a command that will repair the list but I’ve done any testing with subsites (I’ve got a link to another tool that someone else developed that should work for you – it’s either on the variations post or the fixvariationrelationships command post).

  42. Yes, I’ve tried the Variations Editor and te fixrelationship….but it didn’t help. The problem is that when i import pages to the source label(variations) it’s supposed to duplicate them in my other label, it only duplicates 3 of 5 or 1 of 5. It’s weird because I didn’t touch the relationship list(and the fix doesn’t help). I created the website and then I tried to import the pages…

  43. Hi Gary,
    I am having problem installing the WSS msi. I am getting an Error 1001. I have MOSS environement which I need to administrate. I am trying to use “gl-delelelist” cmd and no luck. Please assist
    Alex S

  44. Not sure exactly what I’m doing wrong, but I’m using your export command like this:

    stsadm -o gl-exportlistitem -url “https://sourceurl/AllItems.aspx” -filename “c:\myfile.bak” -versions 4 -includeusersecurity -id “115,120”

    and it appears to work without a problem. Then I run the import like this:

    stsadm -o gl-importlistitem -url “https://targeturl” -filename “c:\myfile.bak” -includeusersecurity -updateversions 3

    and it tries to copy the items back to the same library (over the same items) that the backup was made from (I know this because I ran the command with the updateversions param set to 2 and it wound up readding all the document versions onto the existing document, so now I have twice as many versions as I originally had). Is it possible that this command is ignoring the target url? I’ve downloaded your source code and am going to pick through it, but if you have a chance to respond I’d appreciate it.

  45. It tried both… the MSI did not work and neither the deploy is said it could not find the file. Even if the wps file is in the same directory. the message is “wsp does not exist in the solution store”. I am not sure what do next..I am novice stsadm but am a developer. thanks

  46. Paul – the only way that would happen is if you have a hosts file entry or DNS entry that is pointing your target URL to your source URL. I’m definitely not ignoring the target URL (I use this command all the time and I’ve never experienced the issue you are describing).

  47. Gary – I can’t tell you how often I’ve used your stsadm extensions. THANK YOU!!!

    Today I wanted to clean up some test items and when I ran the command:

    stsadm -o gl-deletelistitem -url http://sharepoint/images/forms/allitems.aspx

    Here is the result:

    Object reference not set to an instance of an object.

    Any ideas?

    Supporting Artifact:
    – I just upgraded to SP2 today.
    – I’ve never used this command prior to today. So I can’t say this worked yesterday.
    – I downloaded the latest wsp file today to verify I’ve not missed anything updates.
    – MOSS 32bit installation / Windows Server 2008

    If you have any suggestions please let me know.

    Thanks in advance!

    Scott

  48. Scott – not sure why you were getting the error – I went ahead and added some additional null checks (shouldn’t be necessary but as I don’t know what’s causing the error…). I’ll push out an updated build tonight – if you could try again I’d appreciate any feedback you can provide.

  49. Hey Mate,
    Great tool. But Im trying to copy a list item to another list but both have lookup fields and I keep getting the error.
    Warning: Unable to find a lookup list /. The list is not part of the exported package and does not exist in the destination site collection.

    I have all the lookup fields in place but it still doesnt want to work, I was wondering if there is a work around for this?

    Many Thanks,

  50. Oh btw, here is the command line im using

    stsadm -o gl-copylistitem -sourceurl “http://server/sites/test/Lists/RFC%2
    0Live/AllItems.aspx” -targeturl “http://server/sites/test/Lists/RFC1/AllItems.
    aspx” -id “1,2” -includeusersecurity -updateversions 2 -nofilecompression -retargetlinks

  51. Hi Gary!

    i try the latest build and still have the same error with Scott.

    i execute this command :
    stsadm -o gl-deletelistitem -url “http://portal/sites/sitename/Document Library Name/Forms/AllItems.aspx” -deletefolders

    and it returned the same error :
    Object reference not set to an instance of an object.

    i use your latest build in this environtment :
    – MOSS 2007 SP2
    – 64 bit architecture
    – Windows server 2008

    any solution?

    Thanks alot for your great help!

  52. Hi Gary,

    I’ve received an error using gl-importlistitem command: “FatalError: Invalid file name. The file name you specified could not be used. It may be the name of an existing file or directory, or you may not have permission to access the file”.

    After a lot of debugging, it turned out that this error was caused by a case sensitive URL. Unlike using an URL with different casing while browsing is not relevant, the SPImport.Run() method apparently requires that the URL to the list view is exactly the same as the actual SiteURL, that is: case sensitive.

    After passing the correct address to the list view URL parameter, the gl-importlistitem command worked like a charm.

    If your findings are the same as mine, maybe you can add a comment to the -url parameter regarding this strange behavior. I hope this information is useful for some of your blog readers.

    With kind regards from the Netherlands.

  53. None of my stuff supports importing data from an excel file. You can try writing something that reads the file (or convert to csv and use powershell) and then call my gl-addlistitem command.

  54. Hi Gary, thankyou for your deserving committment with stsadm and Sharepoint Content Deployement!

    Can you give me some advice about following “strange” problem? I want to copy list “Rilasci” from /sgq/pnxmi to /sgq/pnxmi20

    I’ve tried using:
    stsadm -o gl-copylistitem -sourceurl “https://garuda:32008/sgq/pnxmi/Lists/Rilasci/AllItems.aspx” -targeturl “https://garuda:32008/sgq/pnxmi20/Lists/Rilasci/AllItems.aspx” -nofilecompression -retargetlinks -includeusersecurity

    0) the log says
    [28/09/2009 13.07.04]: Progress: È in corso l’importazione della voce di elenco /sgq/pnxmi20/Lists/Rilasci?id=1.
    1) items ARE imported
    2) items does not retains object identity (no options for that)
    3) lookup fields continue to point to the original site (/sgq/pnxmi)

    so i’ve tried this:
    stsadm -o gl-exportlistitem -url “https://garuda:32008/sgq/pnxmi/Lists/Rilasci/AllItems.aspx” -filename “C:\Temp\Export\pnx\Rilasci” -includeusersecurity -nofilecompression -overwrite

    stsadm -o gl-importlistitem -url “https://garuda:32008/sgq/pnxmi20/Lists/Rilasci/AllItems.aspx” -filename “C:\Temp\Export\pnx\Rilasci” -includeusersecurity -nofilecompression -retainobjectidentity -retargetlinks -sourceurl “https://garuda:32008/sgq/pnxmi/Lists/Rilasci/AllItems.aspx”

    BUT items ARE NOT imported at all and the target list remains empty

    Log says that
    [28/09/2009 13.07.04]: Progress: È in corso l’importazione della voce di elenco /sgq/pnxmi/Lists/Rilasci?id=1.

    (this is the name of the source item)

    Do you have any comment? Do you see something wrong?

    thank you in advance for any help
    Roberto

  55. Hi Gary, thankyou for your deserving committment with stsadm and Sharepoint Content Deployement!

    May be you can give me some advice about this “strange” problem: I simply want to copy list “Rilasci” from /sgq/pnxmi to /sgq/pnxmi20

    I’ve tried using this: stsadm -o gl-copylistitem -sourceurl “https://garuda:32008/sgq/pnxmi/Lists/Rilasci/AllItems.aspx” -targeturl “https://garuda:32008/sgq/pnxmi20/Lists/Rilasci/AllItems.aspx” -nofilecompression -retargetlinks -includeusersecurity

    0) the log says that
    [28/09/2009 13.07.04]: Progress: È in corso l’importazione della voce di elenco /sgq/pnxmi20/Lists/Rilasci?id=1.
    1) items ARE imported
    2) items does not retains object identity (no options for that)
    3) lookup fields continue to point to the original site (/sgq/pnxmi)

    so i’ve tried this: stsadm -o gl-exportlistitem -url “https://garuda:32008/sgq/pnxmi/Lists/Rilasci/AllItems.aspx” -filename “C:\Temp\Export\pnx\Rilasci” -includeusersecurity -nofilecompression -overwrite
    stsadm -o gl-importlistitem -url “https://garuda:32008/sgq/pnxmi20/Lists/Rilasci/AllItems.aspx” -filename “C:\Temp\Export\pnx\Rilasci” -includeusersecurity -nofilecompression -retainobjectidentity -retargetlinks -sourceurl “https://garuda:32008/sgq/pnxmi/Lists/Rilasci/AllItems.aspx”

    0) items ARE NOT imported at all and the target list remains empty
    1) Log says that :
    [28/09/2009 13.07.04]: Progress: È in corso l’importazione della voce di elenco /sgq/pnxmi/Lists/Rilasci?id=1.

    (this is the name of the SOURCE item, while the log of gl-copylistitem refers to the target)

    Do you see something wrong? Do you have any comment/suggestion?

    thank you in advance for any help
    Roberto

  56. Hi Gary, thankyou for your deserving committment with stsadm and Sharepoint Content Deployement!

    May be you can give me some advice about this problem importing list items : I simply want to copy my list named “Rilasci” from /sgq/pnxmi to /sgq/pnxmi20

    I’ve tried using this: stsadm -o gl-copylistitem -sourceurl “https://garuda:32008/sgq/pnxmi/Lists/Rilasci/AllItems.aspx” -targeturl “https://garuda:32008/sgq/pnxmi20/Lists/Rilasci/AllItems.aspx” -nofilecompression -retargetlinks -includeusersecurity

    0) the log says that
    [28/09/2009 13.07.04]: Progress: È in corso l’importazione della voce di elenco /sgq/pnxmi20/Lists/Rilasci?id=1.
    1) pls note pnxmi20 is the name of the target url. correct
    2) items ARE imported
    3) items does not retains object identity (no options for that)

    So i’ve tried this: stsadm -o gl-exportlistitem -url “https://garuda:32008/sgq/pnxmi/Lists/Rilasci/AllItems.aspx” -filename “C:\Temp\Export\pnx\Rilasci” -includeusersecurity -nofilecompression -overwrite
    stsadm -o gl-importlistitem -url “https://garuda:32008/sgq/pnxmi20/Lists/Rilasci/AllItems.aspx” -filename “C:\Temp\Export\pnx\Rilasci” -includeusersecurity -nofilecompression -retainobjectidentity -retargetlinks -sourceurl “https://garuda:32008/sgq/pnxmi/Lists/Rilasci/AllItems.aspx”

    0) items ARE NOT imported at all and the target list remains empty
    1) Log says that :
    [28/09/2009 13.07.04]: Progress: È in corso l’importazione della voce di elenco /sgq/pnxmi/Lists/Rilasci?id=1.
    2) pls note pnxmi is the name of the SOURCE url. INCORRECT

    Do you see something wrong? Do you have any comment/suggestion?

    thank you in advance for any help
    Roberto

  57. I seem to be having problems copying across anything within a hyperlink field, they just don’t come acorss at all, do you know if this should work or not.

    Awesome scripts by the way, I use them heaps!!

  58. Ignore my previous query about hyperlinks not coming across, deleting the list and re-adding it fixed the problem, weird, but it’s working now.

  59. Hello
    I have what I hope is a question that is simple for you to answer.
    I’m working on a MOSS 2007 system.

    I tried out your gl-copylistitem , attempting to move a versioned file from one doc library to another doc library in the same site.

    The output of your command says that there were no warnings or errors. The file is no longer at the source location.

    However, the file does not appear in the doc library specified as the target. When I look at the entire site’s contents, the file isn’t shown anywhere on the site.

    I notice in this blog’s update dated 11/15/2007 you talk about a situation caused by a Microsoft api bug that might cause unexpected results. In my case, there were no known dependencies – this was a simple word document, no images, just created by me to test out the move functionality.

    So my question is this – how can I determine if the file still exists, and if so, how would I access it to move it where it should be?

  60. Larry – I’ve recently had a few posts from people stating that the imports are not working (one or more items don’t show up) – I’ve not been able to reproduce it but I suspect it’s related to one of the CUs, I just don’t know which one. Ultimately I’m just wrapping the content deployment API which is doing all the work – all I do is set some properties and run it. The exported file should be in your temp folder so it should be possible to try the import again. I’d suggest digging through your ULS logs to see if there’s any other information that might explain why it reported success but didn’t work.

    1. Gary – I’ve got the extreme end of this problem – I can only get listitemimport to work by manually editing the manifest.xml and RootObjectMap.xml with the “target” list values.

      I am trying to copy items from one list to another inside the same subweb. The target list is created from a saved template of the source list.

      Farm SharePoint Version: 12.0.0.6529

  61. Great tool , but i am seeing issue with gl-copylistitem , gl-importlistitem, gl-exportlistitem , the tool exports all files except files of type .txt . the behaviour is consistent with
    gl-copylistitem
    gl-exportlistitem
    gl-importlistitem
    Any idea or suggestion .

  62. I’m also having problems with the delete option – getting Object reference not set to an instance of an object.

    Running MOSS SP2 and Dec 09 CU, on x64 Windows 2003 R2 SP2.

    Rob

  63. As a follow up to my other comment – I’ve found that I did not have permissions to delete the list items, which would explain the error I was seeing.

  64. As another follow-up – I’ve sorted the permissions, but I’m still getting the error.

    I have tried a couple of different site collections, creating new libraries, etc, but the problem is the same regardless.

  65. Hello!

    Great tool, but most usable (for me) command – gl-copylistitem, does not work properly. Actually, command works, but it is weird problem already mentioned in two of posts here – some items are missing. I believe that no one here determined that items ARE successfully imported, but they go missing after second or so of being in destination list. I managed to determine this weirdness when I copied all items in one large list, and watched destination as import was progressing. All items were imported and after ten seconds or so, only part of them (1/4 or so) was left in list. Each item that was left could be copied individually, and the ones missing cannot be copied when ID is passed (that is, they ARE copied, but deleted immediately).

    Hope that this helps to determine cause.

  66. This doesn’t appear to work on Issues lists, only on Document Libraries. Is that true? I have a need to merge several Issues lists into one and I thought gl-copylistitem would be the perfect tool. Thanks.
    – Ed.

  67. Hi All,
    Thanks for the wonderful tool.

    I had a problem in deleting the list items from a sharepoint 2010 list. When I used the STSADM command as instructed above, I got a message “Missing operation name or operation name is invalid”. I have been trying to resolve this but no solution found yet.

    Could someone please help me in resolving this ASAP.

    1. The 2007 commands are not supported on 2010. You need to download and install the 2010 cmdlets and use them instead (if you have the 2007 commands from an upgrade you should remove them and then install the 2010 stuff).

  68. Gary do you have a solution or work around for the Error: There are no more files. (Exception from HRESULT: 0x80070012). I’m getting it for the gl-copylistitem when using it to copy a folder and all the subitems. Any help or advice on how to correct this or a work around, from anyone, would be greatly appreciated. Thanks!

  69. “Help me, Obi-Wan Kenobi. You’re my only hope.”

    I must be missing something simple! I have tried the command with several different switches, hoping for something to work. Log files (both import and export) indicate success, yet no list items appear in my targel URL.

    C:\Documents and Settings\servicemsps>stsadm -o gl-exportlistitem url “http://v
    odev/sites/StructuresProcAndProdImpvmt/Lists/PPI Backlog1/All Items.aspx” -id “1” -filename c:\Encarnation -versions 4

    Start Time: 6/16/2011 3:06:11 PM.
    Progress: Initializing Export.
    Progress: Starting Export.
    Progress: Calculating Objects to Export.
    Progress: Serializing Objects to Disk.
    Progress: Starting to process objects of type Site.
    Progress: Finished processing objects of type Site.
    Progress: Starting to process objects of type Folder.
    Progress: Exporting Folder /sites/StructuresProcAndProdImpvmt/Lists/PPI Backlog1
    /Item.
    Progress: Finished processing objects of type Folder.
    Progress: Starting to process objects of type ContentType.
    Progress: Finished processing objects of type ContentType.
    Progress: Starting to process objects of type DocLibFile.
    Progress: Finished processing objects of type DocLibFile.
    Progress: Starting to process objects of type ListItem.
    Progress: Exporting ListItem sites/StructuresProcAndProdImpvmt/Lists/PPI Backlog
    1?id=1.
    Progress: Finished processing objects of type ListItem.
    Progress: Exporting User VALMONT\trk3.
    Progress: Exporting User VALMONT\dsc2.
    Progress: Exporting User VALMONT\jp4.
    Progress: Exporting User VALMONT\lap.
    Progress: Creating File(s).
    Progress: Compressing File(s).
    Progress: Export Completed.
    Finish Time: 6/16/2011 3:06:14 PM.
    Completed with 0 warnings.
    Completed with 0 errors.

    File(s) generated:
    c:\Encarnation.cmp

    Log file generated:
    c:\Encarnation.export.log
    Operation completed successfully.

    C:\Documents and Settings\servicemsps>stsadm -o gl-importlistitem url “http://v
    odev/sites/StructuresProcAndProdImpvmt/Lists/test2/All Items.aspx” -filename c:\Encarnation.cmp -updateversions 2 -retainobjectidentity

    Start Time: 6/16/2011 3:10:07 PM.
    Progress: Initializing Import.
    Progress: Starting content import.
    Progress: De-Serializing Objects to Database.
    Progress: Importing Folder /sites/StructuresProcAndProdImpvmt/Lists/PPI Backlog1
    /Item.
    Progress: Importing ListItem /sites/StructuresProcAndProdImpvmt/Lists/PPI Backlo
    g1?id=1.
    Progress: Importing User VALMONT\trk3.
    Progress: Importing User VALMONT\dsc2.
    Progress: Importing User VALMONT\jp4.
    Progress: Importing User VALMONT\lap.
    Progress: Import Completed.
    Finish Time: 6/16/2011 3:10:15 PM.
    Completed with 0 warnings.
    Completed with 0 errors.

    Log file generated:
    c:\Encarnation.cmp.import.log

    Operation completed successfully.

    If you have any pearls of wisdom for me… you would just top my day! 🙂

    1. I’ve had a few people comment that for some reason the import reports as successful but no ideas appear in the list; unfortunately I’ve yet to be able to reproduce the issue so I’m just not sure what’s going on. You might give Chris O’Brien’s content deployment wizard a try – we’re both using the same core API to do the export/import but perhaps he’s setting some switch differently or something?

  70. Hi Gary,
    I need to copy 300+ items in a task list from one site to another in the same farm. The target list was created from a template of the original list (before the 300+ items were added). The list has a lookup field called “theme” that uses the title value from another list called ListThemes. Both lists and lookup columns appear in both source and target task lists.

    I’ve tried using the gl-export/gl-import route and also the gl-copylistitem, but in both instances I’m running into the same error in the import process;

    ——————————————————————————-
    Progress: Importing ListItem /sctest/Lists/Tasks?id=78.
    Warning: Field Theme cannot be found. Field value will not be imported
    Warning: Field Theme cannot be found. Field value will not be imported
    Progress: Importing ListItem /sctest/Lists/Tasks?id=79.
    Warning: Field Theme cannot be found. Field value will not be imported
    Warning: Field Theme cannot be found. Field value will not be imported
    Warning: Field Theme cannot be found. Field value will not be imported
    Progress: Importing ListItem /sctest/Lists/Tasks?id=80.
    Warning: Field Theme cannot be found. Field value will not be imported
    Warning: Field Theme cannot be found. Field value will not be imported
    Progress: Importing ListItem /sctest/Lists/Tasks?id=81.
    Warning: Field Theme cannot be found. Field value will not be imported
    Warning: Field Theme cannot be found. Field value will not be imported
    Warning: Field Theme cannot be found. Field value will not be imported
    Progress: Importing ListItem /sctest/Lists/Tasks?id=82.
    Warning: Field Theme cannot be found. Field value will not be imported
    Warning: Field Theme cannot be found. Field value will not be imported
    Progress: Importing ListItem /sctest/Lists/Tasks?id=83.
    Warning: Field Theme cannot be found. Field value will not be imported
    Warning: Field Theme cannot be found. Field value will not be imported
    Progress: Importing ListItem /sctest/Lists/Tasks?id=84.
    Warning: Field Theme cannot be found. Field value will not be imported
    Progress: Importing ListItem /sctest/Lists/Tasks?id=85.
    Warning: Field Theme cannot be found. Field value will not be imported
    Progress: Importing ListItem /sctest/Lists/Tasks?id=86.
    Warning: Field Theme cannot be found. Field value will not be imported
    Progress: Importing ListItem /sctest/Lists/Tasks?id=87.
    Warning: Field Theme cannot be found. Field value will not be imported
    Progress: Importing ListItem /sctest/Lists/Tasks?id=88.
    Warning: Field Theme cannot be found. Field value will not be imported
    Progress: Importing ListItem /sctest/Lists/Tasks?id=89.
    Warning: Field Theme cannot be found. Field value will not be imported
    Progress: Importing ListItem /sctest/Lists/Tasks?id=90.
    Warning: Field Theme cannot be found. Field value will not be imported
    Progress: Importing ListItem /sctest/Lists/Tasks?id=91.
    Warning: Field Theme cannot be found. Field value will not be imported
    Warning: Field Theme cannot be found. Field value will not be imported
    Progress: Importing ListItem /sctest/Lists/Tasks?id=92.
    Warning: Field Theme cannot be found. Field value will not be imported
    Warning: Field Theme cannot be found. Field value will not be imported
    Progress: Importing ListItem /sctest/Lists/Tasks?id=93.
    Warning: Field Theme cannot be found. Field value will not be imported
    Progress: Importing ListItem /sctest/Lists/Tasks?id=94.
    Warning: Field Theme cannot be found. Field value will not be imported
    Warning: Field Theme cannot be found. Field value will not be imported
    Progress: Importing ListItem /sctest/Lists/Tasks?id=95.
    —————————————————————————–

    ..these errors continue for every item in the list and nothing imports.

    The thing is, the field ‘Theme’ does exist – in both lists. Any ideas where I might be going wrong here? (really appreciated your tool set BTW, they are a god send!).

    Cheers,

    Steve

  71. hi ,

    i export the discussion board data its stressful using command gl-exportlistitem

    but i have to import the data the following error will occur

    please any one to help me

    how to resolve

    [3/6/2012 11:05:59 AM]: Start Time: 3/6/2012 11:05:59 AM.
    [3/6/2012 11:05:59 AM]: Progress: Initializing Import.
    [3/6/2012 11:06:00 AM]: Progress: Importing User RABHINAV\administrator.
    [3/6/2012 11:06:03 AM]: Progress: Importing User RABHINAV\maanik.
    [3/6/2012 11:06:03 AM]: Progress: Importing User NT AUTHORITY\authenticated users.
    [3/6/2012 11:06:03 AM]: Progress: Importing User NT AUTHORITY\local service.
    [3/6/2012 11:06:03 AM]: Progress: Importing Group UNIT2 SITE COLLECTION2 Owners.
    [3/6/2012 11:06:04 AM]: Progress: Importing Group member 1.
    [3/6/2012 11:06:04 AM]: Progress: Importing Group member 2.
    [3/6/2012 11:06:04 AM]: Progress: Importing Group UNIT2 SITE COLLECTION2 Visitors.
    [3/6/2012 11:06:04 AM]: Progress: Importing Group UNIT2 SITE COLLECTION2 Members.
    [3/6/2012 11:06:04 AM]: Progress: Importing Group Style Resource Readers.
    [3/6/2012 11:06:04 AM]: Progress: Importing Group member 12.
    [3/6/2012 11:06:04 AM]: Progress: Importing Group Designers.
    [3/6/2012 11:06:04 AM]: Progress: Importing Group Hierarchy Managers.
    [3/6/2012 11:06:04 AM]: Progress: Importing Group Approvers.
    [3/6/2012 11:06:04 AM]: Progress: Importing Group Restricted Readers.
    [3/6/2012 11:06:04 AM]: Progress: Importing Group Quick Deploy Users.
    [3/6/2012 11:06:04 AM]: Progress: Importing Group Viewers.
    [3/6/2012 11:06:04 AM]: Progress: Starting content import.
    [3/6/2012 11:06:04 AM]: Progress: De-Serializing Objects to Database.
    [3/6/2012 11:06:05 AM]: Progress: Importing Folder /sites/unit2sitecol2/dis1/Lists/DISCUSSION REPORT/Discussion.
    [3/6/2012 11:06:06 AM]: FatalError: Value does not fall within the expected range.
    at Microsoft.SharePoint.SPWeb.GetWebRelativeUrlFromUrl(String strUrl, Boolean includeQueryString, Boolean canonicalizeUrl)
    at Microsoft.SharePoint.SPWeb.GetWebRelativeUrlFromUrl(String strUrl)
    at Microsoft.SharePoint.SPWeb.GetFolder(String strUrl)
    at Microsoft.SharePoint.Deployment.ContentTypeSerializer.GetListByUrl(String parentUrl)
    at Microsoft.SharePoint.Deployment.ContentTypeSerializer.GetTargetList(Guid listId, Guid parentWebId, String scope, String contentTypeName)
    at Microsoft.SharePoint.Deployment.ContentTypeSerializer.SetObjectData(Object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
    at Microsoft.SharePoint.Deployment.XmlFormatter.ParseObject(Type objectType, Boolean isChildObject)
    at Microsoft.SharePoint.Deployment.XmlFormatter.DeserializeObject(Type objectType, Boolean isChildObject, DeploymentObject envelope)
    at Microsoft.SharePoint.Deployment.XmlFormatter.Deserialize(Stream serializationStream)
    at Microsoft.SharePoint.Deployment.ObjectSerializer.Deserialize(Stream serializationStream)
    at Microsoft.SharePoint.Deployment.ImportObjectManager.ProcessObject(XmlReader xmlReader)
    at Microsoft.SharePoint.Deployment.SPImport.DeserializeObjects()
    at Microsoft.SharePoint.Deployment.SPImport.Run()
    [3/6/2012 11:06:06 AM]: Progress: Import Completed.
    [3/6/2012 11:06:06 AM]: Finish Time: 3/6/2012 11:06:06 AM.
    [3/6/2012 11:06:06 AM]: Completed with 0 warnings.
    [3/6/2012 11:06:06 AM]: Completed with 1 errors.
    [3/6/2012 11:13:52 AM]: Start Time: 3/6/2012 11:13:52 AM.
    [3/6/2012 11:13:52 AM]: Progress: Initializing Import.
    [3/6/2012 11:13:57 AM]: Progress: Importing User RABHINAV\administrator.
    [3/6/2012 11:14:07 AM]: Progress: Importing User RABHINAV\maanik.
    [3/6/2012 11:14:08 AM]: Progress: Importing User NT AUTHORITY\authenticated users.
    [3/6/2012 11:14:08 AM]: Progress: Importing User NT AUTHORITY\local service.
    [3/6/2012 11:14:09 AM]: Progress: Importing Group UNIT2 SITE COLLECTION2 Owners.
    [3/6/2012 11:14:09 AM]: Progress: Importing Group member 1.
    [3/6/2012 11:14:09 AM]: Progress: Importing Group member 2.
    [3/6/2012 11:14:10 AM]: Progress: Importing Group UNIT2 SITE COLLECTION2 Visitors.
    [3/6/2012 11:14:10 AM]: Progress: Importing Group UNIT2 SITE COLLECTION2 Members.
    [3/6/2012 11:14:10 AM]: Progress: Importing Group Style Resource Readers.
    [3/6/2012 11:14:10 AM]: Progress: Importing Group member 12.
    [3/6/2012 11:14:11 AM]: Progress: Importing Group Designers.
    [3/6/2012 11:14:11 AM]: Progress: Importing Group Hierarchy Managers.
    [3/6/2012 11:14:12 AM]: Progress: Importing Group Approvers.
    [3/6/2012 11:14:12 AM]: Progress: Importing Group Restricted Readers.
    [3/6/2012 11:14:13 AM]: Progress: Importing Group Quick Deploy Users.
    [3/6/2012 11:14:13 AM]: Progress: Importing Group Viewers.
    [3/6/2012 11:14:13 AM]: Progress: Starting content import.
    [3/6/2012 11:14:13 AM]: Progress: De-Serializing Objects to Database.
    [3/6/2012 11:14:14 AM]: Progress: Importing Folder /sites/unit2sitecol2/dis1/Lists/DISCUSSION REPORT/Discussion.
    [3/6/2012 11:14:16 AM]: FatalError: Value does not fall within the expected range.
    at Microsoft.SharePoint.SPWeb.GetWebRelativeUrlFromUrl(String strUrl, Boolean includeQueryString, Boolean canonicalizeUrl)
    at Microsoft.SharePoint.SPWeb.GetWebRelativeUrlFromUrl(String strUrl)
    at Microsoft.SharePoint.SPWeb.GetFolder(String strUrl)
    at Microsoft.SharePoint.Deployment.ContentTypeSerializer.GetListByUrl(String parentUrl)
    at Microsoft.SharePoint.Deployment.ContentTypeSerializer.GetTargetList(Guid listId, Guid parentWebId, String scope, String contentTypeName)
    at Microsoft.SharePoint.Deployment.ContentTypeSerializer.SetObjectData(Object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
    at Microsoft.SharePoint.Deployment.XmlFormatter.ParseObject(Type objectType, Boolean isChildObject)
    at Microsoft.SharePoint.Deployment.XmlFormatter.DeserializeObject(Type objectType, Boolean isChildObject, DeploymentObject envelope)
    at Microsoft.SharePoint.Deployment.XmlFormatter.Deserialize(Stream serializationStream)
    at Microsoft.SharePoint.Deployment.ObjectSerializer.Deserialize(Stream serializationStream)
    at Microsoft.SharePoint.Deployment.ImportObjectManager.ProcessObject(XmlReader xmlReader)
    at Microsoft.SharePoint.Deployment.SPImport.DeserializeObjects()
    at Microsoft.SharePoint.Deployment.SPImport.Run()
    [3/6/2012 11:14:16 AM]: Progress: Import Completed.
    [3/6/2012 11:14:16 AM]: Finish Time: 3/6/2012 11:14:16 AM.
    [3/6/2012 11:14:16 AM]: Completed with 0 warnings.
    [3/6/2012 11:14:16 AM]: Completed with 1 errors.
    [3/6/2012 11:20:53 AM]: Start Time: 3/6/2012 11:20:53 AM.
    [3/6/2012 11:20:53 AM]: Progress: Initializing Import.
    [3/6/2012 11:20:57 AM]: Progress: Importing User RABHINAV\administrator.
    [3/6/2012 11:21:04 AM]: Progress: Importing User RABHINAV\maanik.
    [3/6/2012 11:21:04 AM]: Progress: Importing User NT AUTHORITY\authenticated users.
    [3/6/2012 11:21:04 AM]: Progress: Importing User NT AUTHORITY\local service.
    [3/6/2012 11:21:05 AM]: Progress: Importing Group UNIT2 SITE COLLECTION2 Owners.
    [3/6/2012 11:21:05 AM]: Progress: Importing Group member 1.
    [3/6/2012 11:21:05 AM]: Progress: Importing Group member 2.
    [3/6/2012 11:21:05 AM]: Progress: Importing Group UNIT2 SITE COLLECTION2 Visitors.
    [3/6/2012 11:21:05 AM]: Progress: Importing Group UNIT2 SITE COLLECTION2 Members.
    [3/6/2012 11:21:05 AM]: Progress: Importing Group Style Resource Readers.
    [3/6/2012 11:21:05 AM]: Progress: Importing Group member 12.
    [3/6/2012 11:21:05 AM]: Progress: Importing Group Designers.
    [3/6/2012 11:21:05 AM]: Progress: Importing Group Hierarchy Managers.
    [3/6/2012 11:21:05 AM]: Progress: Importing Group Approvers.
    [3/6/2012 11:21:05 AM]: Progress: Importing Group Restricted Readers.
    [3/6/2012 11:21:05 AM]: Progress: Importing Group Quick Deploy Users.
    [3/6/2012 11:21:05 AM]: Progress: Importing Group Viewers.
    [3/6/2012 11:21:05 AM]: Progress: Starting content import.
    [3/6/2012 11:21:05 AM]: Progress: De-Serializing Objects to Database.
    [3/6/2012 11:21:06 AM]: Progress: Importing Folder /sites/unit2sitecol2/dis1/Lists/DISCUSSION REPORT/Discussion.
    [3/6/2012 11:21:07 AM]: FatalError: Value does not fall within the expected range.
    at Microsoft.SharePoint.SPWeb.GetWebRelativeUrlFromUrl(String strUrl, Boolean includeQueryString, Boolean canonicalizeUrl)
    at Microsoft.SharePoint.SPWeb.GetWebRelativeUrlFromUrl(String strUrl)
    at Microsoft.SharePoint.SPWeb.GetFolder(String strUrl)
    at Microsoft.SharePoint.Deployment.ContentTypeSerializer.GetListByUrl(String parentUrl)
    at Microsoft.SharePoint.Deployment.ContentTypeSerializer.GetTargetList(Guid listId, Guid parentWebId, String scope, String contentTypeName)
    at Microsoft.SharePoint.Deployment.ContentTypeSerializer.SetObjectData(Object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
    at Microsoft.SharePoint.Deployment.XmlFormatter.ParseObject(Type objectType, Boolean isChildObject)
    at Microsoft.SharePoint.Deployment.XmlFormatter.DeserializeObject(Type objectType, Boolean isChildObject, DeploymentObject envelope)
    at Microsoft.SharePoint.Deployment.XmlFormatter.Deserialize(Stream serializationStream)
    at Microsoft.SharePoint.Deployment.ObjectSerializer.Deserialize(Stream serializationStream)
    at Microsoft.SharePoint.Deployment.ImportObjectManager.ProcessObject(XmlReader xmlReader)
    at Microsoft.SharePoint.Deployment.SPImport.DeserializeObjects()
    at Microsoft.SharePoint.Deployment.SPImport.Run()
    [3/6/2012 11:21:07 AM]: Progress: Import Completed.
    [3/6/2012 11:21:07 AM]: Finish Time: 3/6/2012 11:21:07 AM.
    [3/6/2012 11:21:07 AM]: Completed with 0 warnings.
    [3/6/2012 11:21:07 AM]: Completed with 1 errors.

  72. hi,

    how to export and import discussion board items one server to another server

    could u please any one to help me

    very urgent

  73. Can someone please help i need to export a few sites to a new server and when i do this I get the following errors. I am not sure how i can fine out what the /. list is any thoughts anyone?

    Thank you for looking
    Bob

    [3/16/2012 3:05:10 PM]: Progress: Importing List Documents.
    [3/16/2012 3:05:11 PM]: Progress: Importing List Knowledge Base.
    [3/16/2012 3:05:11 PM]: Warning: Unable to find a lookup list /. The list is not part of the exported package and does not exist in the destination site collection.
    [3/16/2012 3:05:11 PM]: Progress: Importing List Announcements.
    [3/16/2012 3:05:11 PM]: Progress: Importing List Calendar.
    [3/16/2012 3:05:11 PM]: Progress: Importing List Contact Us.
    [3/16/2012 3:05:11 PM]: Progress: Importing List Deliverables.
    [3/16/2012 3:05:11 PM]: FatalError: Feature ‘d8d8df90-7b1f-49c1-b170-6f46a94f8c3c’ for list template ‘1104’ is not installed in this farm. The operation could not be completed.

    1. The lookup list is an issue but you also need to get the missing feature deployed. Best way to find the lookup list is to simple look at the source list and see what it references.

  74. Hi Gary,

    Many thanks for your help, I have now managed to locate the feature that was missing and so have installed it. What sees to be still an issue is the lookup list, Can you explain to me the source list? and what I compaire it to?

    I seem to of installed one site without issues, but on another one that has sub sites it coms back saying the following.

    Realy appreciate your time.
    Bob

    [3/19/2012 11:23:41 AM]: Error: The file cannot be imported because its parent web /SiteDirectory/Bob/SiteOne does not exist.
    [3/19/2012 11:23:41 AM]: FatalError: The file cannot be imported because its parent web /SiteDirectory/Bob/SiteOne does not exist.
    at Microsoft.SharePoint.Deployment.FolderSerializer.GetParentWeb(SerializationInfoHelper infoHelper, ImportObjectManager objectManager)
    at Microsoft.SharePoint.Deployment.FolderSerializer.SetObjectData(Object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
    at Microsoft.SharePoint.Deployment.XmlFormatter.ParseObject(Type objectType, Boolean isChildObject)
    at Microsoft.SharePoint.Deployment.XmlFormatter.DeserializeObject(Type objectType, Boolean isChildObject, DeploymentObject envelope)
    at Microsoft.SharePoint.Deployment.XmlFormatter.Deserialize(Stream serializationStream)
    at Microsoft.SharePoint.Deployment.ObjectSerializer.Deserialize(Stream serializationStream)
    at Microsoft.SharePoint.Deployment.ImportObjectManager.ProcessObject(XmlReader xmlReader)
    at Microsoft.SharePoint.Deployment.SPImport.DeserializeObjects()
    at Microsoft.SharePoint.Deployment.SPImport.Run()
    [3/19/2012 11:23:41 AM]: Progress: Import Completed.
    [3/19/2012 11:23:41 AM]: Finish Time: 3/19/2012 11:23:41 AM.
    [3/19/2012 11:23:41 AM]: Completed with 8 warnings.
    [3/19/2012 11:23:41 AM]: Completed with 4 errors.

  75. Hi Gary,
    I seem to of fixed all the errors now with your help.
    I can now import the sites across to the new server Great News, but I get a warning as follows.

    “Warning: Unable to find a lookup list /. The list is not part of the exported package and does not exist in the destination site collection”

    I have checked the features but all seem the same on each server.
    Is there a way I can see what this “lookup list /. ” is referring to?

    In my features on the new server I have a feature that will not activate it errors on trying to activate with the msg yet it is fine on the old server.

    “The specified name is already in use. A list, survey, discussion board, or document library cannot have the same name as another list, survey, discussion board, or document library in this Web site. Use your browser’s Back button, and type a new name.” Unsure on how I can change this, Can you please advise?

    Many thanks
    Bob

    1. Hey Bob, I am having the same issue with Warning: Unable to find a lookup list /. If I find a suitable answer I’ll let you know.

      As far as your feature issue, I am going to go out on a limb and say you are trying to activate the publishing feature at the web level. I have found that opening the problematic web with SPD (SharePoint Designer), look in all files, you will notice that the “Pages” folder may be created already with the generic Windows plain folder. Click just to the right of the link to that folder so you don’t open it but select it, then click rename from the ribbon and give it a fancy name like “PagesA” and save these changes. Then go turn on your feature, copy the contents from “PagesA” to the new Pages folder that was created. I hope this helps I run into this all the time with sites that were created in 2007 and now live in 2010.

      1. Hey Bob,

        I talked with a MS engineer about this problem and some others we were having with moving a site that had publishing enabled, and I was told that the Warning issue we are seeing is referring to Lookup lists that have lost their association with other lists, and to correct this issue you ensure that all your lookup lists are pointing to the correct lists through SharePoint Manager, if you don’t do this you may see some inconsistencies within your lists, and how they are expected to operate.

  76. HI Gary,

    I installed Lapointe.SharePoint.PowerShell.wsp in my development machine and tried to run
    stsadm -help gl-exportlistitem through using cmd prompt, the exportlistitem is not showing up.

    But the command stsadm -help gl-exportlist is working fine. Could you please let me know whether I am
    mising anything.

    Thanks and Regards,
    Raj

Leave a Reply

Your email address will not be published. Required fields are marked *

CAPTCHA

*