function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mat SchafferMat Schaffer 

Unable to deploy documents using Migration Tool (ant)

So I have a file in my project src/document/hooplalogo.jpg and I'm trying to deploy it using the ant migration tool. I noticed on http://www.salesforce.com/us/developer/docs/api_meta/Content/file_based.htm that you can't use the wildcard on document resources so I tried adding this to my package.xml:

 

  <types>
    <members>hooplalogo.jpg</members>
    <name>Document</name>
  </types>

 

But when I run `ant deploy` I get this:

 

Error: package.xml(hooplalogo.jpg):An object 'hooplalogo.jpg' of type Document was named in package.xml, but was not found in zipped directory

 

It looks like maybe the migration tool just doesn't support deployment of documents. Is that the case?

 

Thanks in advance for any help,

Mat

 

Best Answer chosen by Admin (Salesforce Developers) 
Mat SchafferMat Schaffer

Incase anyone else is reading this, it looks like the real issue may have been that contrary to this document http://www.salesforce.com/us/developer/docs/api_meta/Content/file_based.htm the folder should be src/documents not the singular.

 

I've already written my own deployment tool with rake at this point though, so I can't confirm if the Migration Tool works by changing the folder name.

 

Hope that helps someone.

All Answers

Anand@SAASAnand@SAAS

You could use dataloader to load your documents. You don't need to use the migration tool. 

 

specific to your issue, every document needs to be in a folder and I don't see your package.xml having a folder specified.

Mat SchafferMat Schaffer

I get the same error with a folder (I think). I tried putting the file in src/document/hoopla/hooplalogo.jpg and using this in the package.xml:

 

  <types>
    <members>hoopla</members>

    <members>hoopla/hooplalogo.jpg</members>
    <name>Document</name>
  </types>

But just got this error:


Error: package.xml(hoopla):An object 'hoopla' of type Document was named in package.xml, but was not found in zipped directory
Error: package.xml(hoopla/hooplalogo.jpg):An object 'hoopla/hooplalogo.jpg' of type Document was named in package.xml, but was not found in zipped directory

I included both lines according to http://www.salesforce.com/us/developer/docs/api_meta/Content/meta_folder.htm but still no love.

 

I do my development work on linux, so the data loader isn't an option for me unfortunately. Seems I'll just have to start working directly with the metadata api.

 

Thanks, and thanks in advance to anyone else that might have more info.

Mat SchafferMat Schaffer

Incase anyone else is reading this, it looks like the real issue may have been that contrary to this document http://www.salesforce.com/us/developer/docs/api_meta/Content/file_based.htm the folder should be src/documents not the singular.

 

I've already written my own deployment tool with rake at this point though, so I can't confirm if the Migration Tool works by changing the folder name.

 

Hope that helps someone.

This was selected as the best answer