How to deploy metadata components between unrelated Salesforce Orgs
If you are familiar with change sets in Salesforce, you know that it can be used to transfer metadata between related orgs. For example, transfer the objects, fields, apex classes, etc. from sandbox to production, production to sandbox, and sandbox to sandbox.
But what if you need to transfer metadata between unrelated orgs or completely different orgs? There are a couple of options, one of which is the ANT Migration Tool provided by Salesforce. (If you are not yet familiar with ANT Migration Tool, you may want to make a note to refer to my another blog post
Step-by-Step Guide on Getting Started with Salesforce ANT Migration Tool)
The other option for moving metadata from one org to another org is using Packages.
A package in Salesforce refers to a container. You can use this container to add the metadata/components from a source org that you wish to transfer/distribute to another org i.e. Target Org. Packages come in two flavors.
- Unmanaged Package
- Managed Package
Unmanaged Packages in Salesforce can be used to move a set of metadata from one org (source) to another org (target) even if they are completely unrelated. Unmanaged packages are usually used for distributing open-source projects, an application template, or foundational work. Once installed in the target org, you can then build upon it.
For an Unmanaged Package in Salesforce, the package creator does not have control over the components of the package. Once the package is installed, the installers can modify the components. You can’t provide an upgrade either. In a developer edition or Trailhead playground, you can create only unmanaged packages.
Managed package, on the other hand, is used to sell applications and to distribute on AppExchange. In these types, the creator does have control over the application and can release upgrades. The creator can control the usage with user-based paid licenses. There are special developer editions to create Managed Packages.
Now that you have a basic understanding of what an Unmanaged Package is, let’s get hands-on experience in creating an Unmanaged Package in Salesforce within just 15-20 minutes. This step by step guide covers how to:
- Create an Unmanaged Package
- Add Components
- Upload the Package
- Install the Package in Target Org
- Verify Installed Package
- Deprecate the Package
NOTE: Certain sections of the guide will appear as locked in the free preview. You can download the unlocked version of the guide in PDF format by subscribing to our “All Access” Pass through the link below.
References & Useful URLs
- Understanding Packages – Help Article (10 mins) – https://help.salesforce.com/articleView?id=sharing_apps.htm&type=5
- Glossary – Help Article (10 mins) – https://help.salesforce.com/articleView?id=packaging_concepts.htm&type=5
- Create a Package – Help Article (10 mins) –https://help.salesforce.com/articleView?id=creating_packages.htm&type=5
- Add Components to Your Package – Help Article (10 mins) – https://help.salesforce.com/articleView?id=adding_package_components.htm&type=5
- Components Automatically Added to Packages – Help Article (10 mins) – https://help.salesforce.com/articleView?id=packaging_components_auto_added.htm&type=5
- View Package Details – Help Article (10 mins) – https://help.salesforce.com/articleView?id=viewing_package_details.htm&type=5