1

I am unable to deploy the retrieved customizations from Sandbox. Please help.

Source: Developer Pro Sandbox Destination: Developer Sandbox (dev sandbox is only for trial purpose, I need to deploy total application in partial copy sandbox)

Build.xml block:

 <target name="deploy">
<sf:deploy
  username="${sf.username}"
  password="${sf.password}"
  serverurl="${sf.serverurl}"
  deployRoot="DST"
  rollbackOnError="True"/>
</target>

Error:

DEPLOYMENT FAILED Request ID: 0Afc000000UyJuNCAV

All Component Failures: 1. package.xml -- Error: No package.xml found

DEPLOYMENT FAILED

  • Your folder DST needs to have a package.xml in it. Ordinarily, if you used sf:retrieve, it should already be there. – sfdcfox Aug 6 '17 at 17:14
  • @sfdcfox why should I need package.xml in root folder? Can you explain please. And Yes I used package.xml but I moved it to different folder as I am not referring any package.xml in sf:deploy target. – Alan Aug 6 '17 at 17:21
3

Make sure you have package.xml in your root directory from where you are deploying the metadata. Looks like you have a folder named DST. Make sure you have create a package.xml file .

Package.xml can be generated using an IDE or by adding all components to an unmanaged package and then retrieving it from the package using ant retrieve.

  • how to create package.xml to deploy what I have in DST folder? I created package.xml manually to retrieve customizations. But now the deployment failed because of dependencies. – Alan Aug 6 '17 at 17:36
1

When you use sf:retrieve, the folder you retrieve to will have a package.xml in it that already contains all of the elements you retrieved. This makes it easy to re-deploy the package to a new org using sf:deploy. Note that dependencies are not automatically resolved. I personally recommend creating a new package in Setup > Create > Packages, and then retrieving it with a package.xml that looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>demo</members>
        <name>Package</name>
    </types>
    <version>40.0</version>
</Package>

Once you retrieve it, you'll end up with the correctly built package.xml in the retrieved folder's root. Even better, building a package this way automatically includes all dependencies, so the package should deploy to a new environment seamlessly.

  • Thank you. This is very effective approach, I tried it but I got nothing. And I dont have test classes right now, and to upload package I will require test classes. Is there any way to avoid it. – Alan Aug 6 '17 at 20:33
  • @Alan You do not need unit tests to deploy to a sandbox or developer edition org. – sfdcfox Aug 6 '17 at 20:36
  • Yeah I tried to upload that package but its asking test classes. And I am trying to deploy an application: both are completely different orgs, right now I have application in DevPro sandbox of unlimited edition org and I want to deploy it into enterprise edition sandbox(it can be dev sandbox or partial copy sandbox) – Alan Aug 6 '17 at 20:44
  • Can you tell me exact better approach for it. I am trying to do it with ANT. I am also trying to build package.xml as you told earlier. – Alan Aug 6 '17 at 20:47
  • @Alan If it's asking for unit tests, then you're deploying to a production org. You can use Ant, Force.com IDE, Workbench, MavensMate, or whatever. You just need to be deploying to the correct org, and not be missing any dependencies. – sfdcfox Aug 6 '17 at 20:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.