Salesforce deployment best practices,
key steps & useful tools

Salesforce deployment best practices, key steps & useful tools

March 21, 2024

Salesforce deployment process

Salesforce deployment, which implies moving code and metadata changes through different sandboxes, includes the following steps.

Salesforce deployment process

Developers create customizations (source code modifications, new features, custom templates, etc.) or make configurations (such as changes to objects and fields and minor interface modifications) and test these changes in separate sandboxes with unit tests. These isolated environments serve as replicas of your Salesforce org and metadata (including fields, layouts, and automation logic) and data (records like contacts and leads) it contains, allowing developers to make changes without compromising the production org.

Changes are then deployed in an integration environment to be merged into a unified codebase. Integration tests will then verify whether these sets of changes work together.

Further testing usually happens in yet another sandbox. This phase includes performance testing to verify the solution’s stability, speed, and responsiveness, followed by user acceptance testing (UAT) where Salesforce users assess the delivered solution to make sure it functions as intended. The same sandbox can also serve as a staging environment for the final review and training of future users.

Once testing and training are done, new features and other changes are deployed in the production environment and made available to end users.

Salesforce deployment best practices

Create a release management strategy

Salesforce deployment involves multiple iterations across different environments. A release management framework can harmonize this complex process, helping you plan, schedule, and control the deployment of software releases. An effective release management strategy needs to include the following aspects:

  • Clear roles and responsibilities (requirements planning, testing, deployment, etc.) for the specialists involved, such as product managers, quality engineers, Salesforce developers and admins, and release managers.
  • Release categorization into bug fixes, minor changes that don’t require user training, and major changes that significantly impact the functionality, user experience, and dependencies between org components (custom objects, triggers, etc.). The latter category will require accurate testing, training, and change management.
  • A regular release schedule and communication of changes, so that Salesforce users can plan their work accordingly. Also, avoid deployment during peak times of user activity to minimize work disruption.

Select the right sandbox

Salesforce provides several types of sandboxes, each with different data and file storage capacity, refresh intervals, and support for templates. Furthermore, not all sandboxes can copy both metadata and data. A sandbox strategy should clarify the types of sandboxes involved in each release stage based on tasks and data requirements.

  • Developer sandboxes copy your production org’s metadata but not data. They can be updated once a day and have a limited storage capacity of 200MB compared to other types, which makes it a great choice for individual developers handling isolated coding and unit testing tasks. The Pro version expands storage capacity up to 1GB, enabling a wider range of tasks like quality control and integration testing.
  • Partial Copy sandboxes copy both metadata and a portion of data selected via Sandbox templates. This sample set of live data enables you to test changes via integration testing, quality assurance, and UAT, and train users in an environment similar to the real-life one.
  • Full sandboxes copy the entire production org’s metadata and data, so you should use them to test new changes with performance and load testing and UAT, and as a staging environment. Be aware that despite having the best storage capacity, their low refresh rate risks bogging down the development and deployment flow if used as a coding environment.

Sandbox type

Refresh interval

Storage limit

What’s copied

Sandbox templates

Developer Sandbox

Sandbox type

Refresh interval

Storage limit

What’s copied

Sandbox templates

1 day

Data storage: 200 MB File storage: 200 MB

Metadata only

Not available

Developer Pro Sandbox

Sandbox type

Refresh interval

Storage limit

What’s copied

Sandbox templates

1 day

Data storage: 1 GB File storage: 1 GB

Metadata only

Not available

Partial Copy Sandbox

Sandbox type

Refresh interval

Storage limit

What’s copied

Sandbox templates

5 days

Data storage: 5 GB File storage: Same as your production org

Metadata and sample data

Required

Full Sandbox

Sandbox type

Refresh interval

Storage limit

What’s copied

Sandbox templates

29 days

Same as your production org

Metadata and all data

Available

Scheme title: Types of Salesforce sandboxes
Data source: help.salesforce.com — Sandboxes: Staging Environments for Customizing and Testing

Optimize your sandbox toolkit

When defining your sandbox strategy, you should also consider the number of sandboxes used, their availability based on each Salesforce Edition, and alternative options to set up new sandboxes.

  • Several developers can share the same or different sandboxes. A common sandbox makes integration unnecessary, but we still recommend using multiple sandboxes to let each developer modify metadata without affecting other developers’ work. Just make sure to verify the compatibility of components built in different sandboxes via integration testing.
  • Different Salesforce Editions provide different numbers and ranges of sandboxes, so you have to choose accordingly. You still can purchase additional sandboxes, but keep in mind that their cost is based on the type, with the Full sandbox being the most expensive.
  • Use Salesforce CLI to clone existing developer sandboxes instead of creating new ones from the production org, which takes longer. This allows you to preload the sandbox with data without using scripts.

Sandbox type

Professional edition

Enterprise edition

Unlimited edition

Performance edition

Developer Sandbox

Sandbox type

Professional edition

Enterprise edition

Unlimited edition

Performance edition

10

25

100

100

Developer Pro Sandbox

Sandbox type

Professional edition

Enterprise edition

Unlimited edition

Performance edition

5

5

Partial Copy Sandbox

Sandbox type

Professional edition

Enterprise edition

Unlimited edition

Performance edition

Not Available

1

1

1

Full Sandbox

Sandbox type

Professional edition

Enterprise edition

Unlimited edition

Performance edition

Not Available

1

1

Scheme title: Number of Sandboxes available per edition
Data source: help.salesforce.com — Sandboxes: Staging Environments for Customizing and Testing

Select a suitable Salesforce deployment method

Salesforce offers multiple native options to deploy changes between different orgs across your release pipeline. To adopt the most suitable tool, make a choice based on your deployment scenario.

  • Change sets are packages of metadata changes (including workflows, rules, and permission sets) that can be selected and deployed directly using the Setup menu provided by Salesforce’s graphical user interface. However, this tool doesn't support version control, which can result in errors and change tracking difficulties. Consider Change Sets as a good option for non-tech-savvy users to deploy minor modifications without developer assistance.
  • The Ant Migration Tool (formerly Force.com Migration Tool) allows users to access Salesforce’s Metadata API to move metadata between orgs. All interactions with Ant, such as the request to deploy Salesforce metadata, occur by inputting lines of text into a command line interface. Although the process is more complicated than with the graphical user interfaces, you gain greater control over the deployment. Choose this tool for extensive customizations that require repetitive deployments and will be performed by a team of developers.
  • Keep in mind that according to a recent announcement, Salesforce will stop supporting Ant with new updates starting Spring ’24. If you opt for a command line tool, you can replace Ant with Salesforce CLI, which further expands Ant’s capabilities with commands to push and pull metadata to and from the orgs and convert metadata to SFDX format.

Perform end-to-end testing

Testing is necessary to ensure successful Salesforce deployment, optimal software performance and smooth operation, and seamless user experience.

  • You can write and execute unit tests using the Apex testing framework to ensure the high quality of Apex code and reach all the requirements to deploy it.
  • Verify that code coverage is at least 75% and that Apex classes (templates to create objects) and triggers (actions automatically invoked by changes to Salesforce records) work as expected.
  • Conduct regression testing to ensure that configuration updates or new deployments haven’t negatively affected the existing functionality. Additionally, consider adopting a third-party automation tool to trigger such tests without manual intervention.
  • Regularly refresh your sandboxes to keep them in sync with the production org and avoid data/metadata drifts between environments, which can result in bugs after deployment. Also, tests executed in synced environments provide a more realistic indication of how customizations will work in the production org.

Implement code version control

Code version control involves tracking and documenting changes at every Salesforce development and deployment stage, keeping a detailed change history and highlighting code conflicts or other issues to help fix bugs.

  • Salesforce’s Setup Audit Trail shows the most recent setup changes (page layout customizations, permission sets created, etc.) made to your org, including the date of the change and who made it.
  • Developers should identify areas of conflict between the local project’s components or in the org (such as a file modified by one developer and deleted by another) and resolve them before proceeding with deployment. You can adopt Salesforce CLI to notify you of conflicting changes, so that you can resolve them and then overwrite the local project or the org with the resolved file.
  • Since many Salesforce development teams consider Salesforce’s version tracking capabilities rather limited, they often go for a third-party version control system. The most popular version control tool for Salesforce is currently Git, which enables developers to monitor all branches (lines of work) and commits (saved points in history) and resolve conflicts.

Adopt risk mitigation best practices

Active deliverability settings and validation rules, excessively permissive deployment policies, and the lack of rollback capabilities are key factors that can negatively affect the deployment process and thus should be addressed with due care.

  • When new metadata is deployed to production, you may need to perform additional manual tasks, such as updating custom metadata, running Apex scripts to modify data, and testing changes on the production environment. To ensure smooth post-deployment processes without impacting live data or inconveniencing customers with unnecessary notifications, consider disabling email deliverability settings, certain validation rules, or any other configurations that could affect your post-deployment steps.
  • Administrators should limit the number of users who have deployment permissions to minimize org exposure and the risk of inadvertent changes. Permissions requiring special attention include the 'Customize Application' Profile permission (allowing the modification of an org) and the Metadata API Functions permission (allowing access to metadata via the API).
  • Salesforce orgs don’t store prior states and related metadata, which means that any changes you deploy can't be rolled back. To revert to a past configuration and prevent data and metadata loss, adopt a backup and restore strategy. This includes ensuring all changes deployed to an org exist in your version control system, so you can roll back to your last commit and deploy the previous version of the code. You can also create additional copies of your production org if deployment risks impact data (such as removing custom fields or changing field types).

Establish a CI/CD pipeline

By applying CI/CD best practices during Salesforce deployment, you can test, integrate, and deploy small change packages more frequently.

  • Set up a CI/CD pipeline to deliver new changes once they are developed and tested instead of releasing them in one batch. This helps developers minimize bugs and dependency issues, namely changes in a system component affecting other parts.
  • Using Salesforce Developer Experience, the set of tools to facilitate development on the Salesforce Platform, you can streamline the CI/CD process via scratch organizations. These are short-lived and disposable environments that are automatically deleted after some time. Scratch orgs enable quick deployment of Salesforce code and metadata to test and integrate small sets of changes.
  • Developers need to ensure that code changes they regularly integrate into a source code repository don’t contain bugs. You can use integrated third-party CI/CD tools like CircleCI, Jenkins, and Travis CI to automatically test new changes, check code coverage, and deploy such changes to a target environment.
Continuous integrationContinuous deploymentContinuous deliveryChange set-based developmentDX Dev HubPackaged-based developmentDevelopmentDev SBXDev SBXDev SBXScratch orgScratch orgScratch orgIntegration/QADev pro SBXtestsDev pro SBXmergecommitUATPartial SBXtestsPartial SBXStagingFull SBXtestsPRODDataLoaderApp
lifecycle managementVersion control system (Repo)RepositoryGit DXUI for compare

Scheme title: A Salesforce CI/CD workflow
Data source: wilsonmar.github.io—Salesforce DX (Developer eXperience) deep dive

Benefits of following deployment best practices

Superior deployment process visibility
for developers and administrators achieved through version control

Minimized business process disruption
and enhanced user experience due to transparent release
management

Cost optimization
by defining a suitable set of sandboxes and reducing testing,
integration, and deployment workloads via automated processes

Reduced technical risks
due to separate development environments, multiple testing steps,
strict deployment permission policies, and a robust backup strategy

Faster release cycles
through optimal sandbox selection, along with CI/CD practices
and related test and deployment automation tools

Benefits

Our Salesforce services

As a certified Salesforce Partner, Itransition guides companies through their Salesforce adoption journeys and helps address any technical issues and business challenges.

Consulting

    • Current Salesforce system audit
    • Salesforce edition and feature selection
    • Salesforce solution conceptualization
    • Project planning and budgeting
    • Configuration and customization consultancy
    • Integration and migration advisory
    • User training and support
      • Salesforce customization and configuration
      • Salesforce deployment to your production environment
      • Integration with your business software
      • QA and user acceptance testing
      • Legacy CRM data migration to Salesforce

      Hire Itransition as your Salesforce adoption partner

      Get in touch

      Coordination, visibility & automation for painless deployment

      Thanks to its extensive customization possibilities, Salesforce enables organizations to tailor the platform’s functionality to their specific business needs. That said, multiple coding, testing, and deployment processes distributed across different environments can turn Salesforce customization into a rather challenging journey from both technical and organizational perspectives. To address these complexities and deploy changes successfully, Itransition’s experts can help you adopt tools and practices to coordinate workflows across sandboxes, test and track changes, and automate your CI/CD pipeline.

      Salesforce professional services and product expertise

      Service

      Salesforce professional services and product expertise

      Hire a certified Salesforce services provider with 10-year expertise in Salesforce CRM and other solutions to carry out seamless adoption and transformation.

      Salesforce Einstein: AI features,
case studies & adoption guidelines

      Insights

      Salesforce Einstein: AI features, case studies & adoption guidelines

      Explore Salesforce Einstein’s top features, implementation examples, and benefits, along with tools and guidelines to streamline its adoption.

      Salesforce data migration: a step-by-step guide, top tools, and best practices

      Service

      Salesforce data migration: a step-by-step guide, top tools, and best practices

      Explore Salesforce data migration step-by-step guide, tools comparison, best practices, common challenges and their solutions, and benefits.

      Salesforce CRM implementation for a real estate company

      Case study

      Salesforce CRM implementation for a real estate company

      Learn about Salesforce CRM implementation that helped a large real estate company increase their sales by 15% and shorten their sales cycle by 10%.

      AI in CRM:
top use cases, best platforms, and guidelines

      Insights

      AI in CRM: top use cases, best platforms, and guidelines

      Explore the major use cases, real-life examples, and implementation best practices of AI in CRM, along with the top AI-powered platforms on the market.

      Salesforce CRM for a US insurance buyout agency

      Case study

      Salesforce CRM for a US insurance buyout agency

      Learn how Itransition’s customized Salesforce CRM has brought a US insurance buyout agency 54% more leads.