In the fast-paced modern business environment, accidental data deletions are much more common than one might think. Salesforce is no exception to this, with plenty of situations such as accidental user action, inadvertent mass delete operation, or an incorrectly configured automated process. Nevertheless, any loss of critical business information has the potential to drastically impact the operations of an organization, which is why it is necessary to have a good grasp of how deleted records can be restored in Salesforce – so that both the customer information and the business continuity remain safe and secure.
What Are the Steps to Recover Deleted Records in Salesforce?
Whenever records are deleted in a Salesforce environment, they are not erased from the system in its entirety. Instead, all deleted data follows a standardized two-stage process that offers a plethora of opportunities for recovery in case the deletion was not intentional. Here is a selection of basic knowledge about recovering deleted records in Salesforce:
Different Types of Deletion
Salesforce has several deletion types that are of note, all of which have their own features and characteristics. We are going to look over four primary categories of data deletion in Salesforce: soft delete, hard delete, cascade delete, and mass delete.
Soft delete is the least permanent option of the fourth; all of the soft-deleted records are moved to the Recycle Bin without disrupting any of the data or relationships if the data is going to be restored in the future. It also does not have any effect on the total storage limit due to the fact that data still remains in the environment on a technicality.
Hard delete is the procedure that follows the soft delete after a certain retention period. It is still possible to get deleted records back after a hard delete, although the process is much more difficult and involves Salesforce Support, at the very least. A complete record reconstruction is necessary for information to recover from hard deletion.
Cascade delete is a process that occurs whenever a deleted record has the status of a parent record. It affects related child records based on existing relationships and connections in the database. The relationship settings define whether the child records are getting deleted or not, as well as the fact that the relationship field should be cleared once the parent record is gone.
Mass delete is the process of deleting a large collection of records, typically over 250 records at once. It requires a higher level of user permissions and includes background jobs that can be monitored. Mass deletion processes follow the same deletion sequence as any other data, including the transition from soft delete to hard delete.
How Long Do Deleted Records Remain in the Recycle Bin?
Elements in the Salesforce Recycle Bin are usually retained for 15 days after they were deleted. During this time frame, all objects in the bin are assigned the “soft delete” state, which allows the recovery of any record if necessary. Additionally, it is important to mention a few nuances about retention periods in the recycle bin:
- Individual users’ Recycle Bins retain all information for 15 days, during which a user can find deleted records and restore them with ease.
- The organization’s overarching Recycle Bin holds information for 15 more days after it has been erased completely from the individual’s recycle bin, creating a total retention time frame of 30 days in Salesforce environments.
- Your Recycle Bin can hold up to 25 times your storage capacity in records. For instance, if your organization has a storage allocation of 2,000 MB (2 GB), the Recycle Bin can store up to 50,000 records.
- If the Recycle Bin somehow reaches its storage limits, then the oldest records in the bin are automatically erased.
What is the Process to Access the Recycle Bin?
Most basic interactions with the Recycle Bin are straightforward and simple. The most difficult segment of the entire process lies in locating the Recycle Bin itself. Here is how it can be done:
- Where is Recycle Bin in Salesforce Classic? There is a separate link called “Recycle Bin” that can be found on the sidebar of Salesforce’s interface.
- Where is Recycle Bin in Salesforce Lightning? Here, the first step is to press the “gear” icon, and the subsequent drop-down menu should have the “Recycle Bin” link available.
Once the bin is located, one might also ask how to restore deleted records in Salesforce Lightning or Salesforce Classic. The truth is, individual records in each version of the bin can be restored simply by selecting them using checkboxes and clicking on the “Restore Selected Items” option, the process is similar in both cases.
There is also a separate option for mass restoration; it can take advantage of the Recycle Bin’s list views and filtering capabilities to select a large number of objects or records at once, all of which can be restored with the “Mass Restore” command once selected.
Can I Restore Deleted Objects After 15 Days?
Once the retention period has passed and the records are deleted permanently, there are still a few options to restore them. Contacting Salesforce Support is one such option; it can be done within 85 days of the permanent deletion, requires paid data recovery service, and does not guarantee successful recovery.
Backup solutions can be used as an alternative recovery method, as well. If the regular system backups are maintained, it should still be possible to recover lost data even if the retention period has passed. Some third-party backup solutions might even offer extended recovery periods that can be taken advantage of to undelete records that were not intentionally erased.
How can I track the history of deleted records?
Field history tracking is one of the few options that allow for some sort of history of field value changes to be maintained, which can also be treated as the deleted records history to a certain extent. Unfortunately, it is limited to 20 fields per object, can work with only specific types of fields or objects, and can only retain history data up to 24 months unless archived.
An alternative to this method is the usage of Event Monitoring logs, which is a more comprehensive tool that can pull specific information by itself for a specific purpose such as tracking deleted records. It can use the following events to do so:
- RecordDeleted event type can show who deleted each record and when.
- LightningUriEvent covers all deletions made using the Lightning UI.
- ApiEvent can track deletions that were made via API calls.
This kind of freedom helps with reconstructing the circumstances of data loss in order to work on better prevention strategies or methods. However, Event Monitoring is a separate license that requires additional payment, and the logs themselves are only retained for a certain period of time depending on the Salesforce edition.
How GRAX Can Help Retrieve Deleted Records?
As mentioned before, third-party backup solutions can also be treated as a means of recovering from complete record erasure. Solutions such as GRAX provide extensive data backup and recovery capabilities that were designed from the ground up to operate specifically within Salesforce environments.
The most common advantages of GRAX in Salesforce are:
- Comprehensive data protection capabilities, with the ability to maintain complete backup history, freedom of choice when it comes to the cloud or on-prem environment, and the ability to capture both data and metadata near real-time.
- Impressive data recovery advantages, supporting the restoration of all related objects and relationships, point-in-time recovery, and the recovery of records that were hard deleted before (this is going to be elaborated upon later).
- Large selection of Salesforce backup capabilities, including record history, audit trails, object-level and field-level restorations, granular restoration, and so on. GRAX can restore elements on a granular basis down to a single element while also providing an option to conduct mass hierarchy restores when necessary, including all of the relationships and connections.
- Plenty of advantages for the entire Salesforce Org as a whole, with automated backup scheduling and direct data restoration into Salesforce; it is extremely easy to set up and the total deployment time can take as little as 10 minutes.
GRAX also has a dedicated feature called GRAX Restore that makes it a lot easier to restore any records to their most recent version or from any point-in-time from GRAX backups. This specific process can help with restoring information that has been deleted and has no set retention period except for what your organization sets up with GRAX’s data lifecycle management tools.
The existence of a detailed filtering framework makes it easier to find specific records in the backed-up data of GRAX, the restoration itself is fast and responsive, and there is even a dedicated post-processing element added to every restoration sequence to ensure that the newly restored data is now added to the latest data backup for it to remain within the environment if there is a need to fully restore the latest backup.
How to restore deleted Salesforce records?
Learn GRAX platform restore capabilities
How to Use Salesforce Data Loader for Recovery
What is a Salesforce Data Loader?
Salesforce Data Loader is a decent alternative for data recovery, especially in the context of large volumes or significant data masses that have to be restored from external backups. It is an official native Salesforce tool for bulk importing and exporting information that offers a selection of advantages:
- Desktop applications for both Mac and Windows users.
- Support for delete, export, update, insert, and upsert operations.
- A selection between GUI and command line interfaces.
- The ability to handle up to five million records at once.
- Support for CSV files (direct database connections are not supported).
It should be noted that appropriate Salesforce permissions and licenses are necessary in order to perform any manipulations with records, be it restoration, exporting, deletion, etc.
How to Export Data Using Data Loader
Data Loader is not particularly difficult to work with, and exporting information with this solution takes only a few steps to perform. Once the application is installed from Salesforce Setup, the end user would have to log in using appropriate Salesforce credentials and configure connection settings.
As soon as the connection with the storage environment has been installed, all it takes is a simple process of exporting the specific information to be copied to a different location. There is a choice between Export and Export All, with the former also requiring selecting what objects are supposed to be exported.
Data Loader also allows for a certain degree of customization here due to the support for SOQL query commands. Here’s a simple example of such:
SELECT Id, Name, Account.Name, CreatedDate, LastModifiedDate
FROM Contact
WHERE LastModifiedDate = LAST_N_DAYS:7
AND Account.Type = 'Customer'
ORDER BY LastModifiedDate DESC
This particular query is exporting contact records modified in the last 7 days, is only applicable to the accounts marked as “Customer,” is sorted by most recently modified, and includes basic information about each of the contacts (ID, name, account name, creation date, last modification date).
Once the previous step is complete, all it takes is to select field mapping, choose the output location, and the file name for the exporting process to be successfully initiated.
Data exporting processes should include all of the necessary fields and relationships when applicable while also subjecting all exported information to data integrity checks. All export configurations should be properly documented, and scheduled exports are highly recommended for backups if nothing else is needed.
Can Data Loader Help Recover Permanently Deleted Records?
Data Loader’s role in the recovery of permanently deleted records is extremely similar to that of a regular backup solution – as in, it can only work if there is backup data or exported information to work off of.
Salesforce Data Loader does not allow for the direct recovery of deleted records, and it also cannot recover certain elements of information whatsoever, such as the pre-existing ID of the record or some of the more complex relationships between records.
If the backup does exist, then the recovery process is not that different from how Data Loader usually operates: the backup data in a CSV format is validated and cleaned up, fields are mapped, information is restored, and the integrity of the recovered records is verified afterward.
It should be noted that the Data Loader is somewhat basic when it comes to data recovery, which means that there are a few factors that should be considered beforehand:
- Duplicate record handling.
- Auto-number fields impact.
- Rollup summaries and formula fields consideration.
With all that in mind, it is always a wise idea to test your recovery processes with Data Loader in a sandbox environment instead of deploying it into a live environment as the first option.
What Backup Solutions Are Available for Salesforce Data?
Data backup in Salesforce is an essential component of an organization’s data protection strategy. While it is true that Salesforce does provide a number of native options to choose from, they are often not comprehensive and flexible enough to ensure the complete safety and recoverability of sensitive business information in any scenario.
How to Ensure Data Backup in Salesforce?
Salesforce’s native Data Export Service is a built-in way to manually create backup files from Salesforce data. Unlike the previously mentioned Data Loader, Data Export Service is built into the environment and runs automatically on a schedule depending on the pricing tier of the organization: weekly backups for Enterprise Edition and above, or monthly backups for Professional Edition.
The Data Export Service automatically creates a set of CSV files that covers records, attachments, documents, and metadata in a given Salesforce org. As soon as the export process is complete, Salesforce also sends a simple email notification with links that allow for the generated backup files to be safely downloaded anywhere.
It is a good service that can provide a decent baseline for basic backups, but it is severely limited by its scheduling capabilities and the lack of granularity, which makes it work best as a supplementary backup solution instead of the primary one.
Salesforce organizations that require more frequent backups might also consider developing custom backup solutions using a large selection of Salesforce APIs. This kind of approach that relies mostly on REST and SOAP APIs offers practically infinite flexibility but also comes with a lot of disadvantages – be it significant development costs, maintenance costs, more challenging troubleshooting than other methods, and so on.
What Are Third-Party Backup Options for Salesforce?
The Salesforce ecosystem also has a large selection of third-party backup options to choose from, addressing many limitations of native backup capabilities. Solutions like GRAX or Spanning provide customizable automated backup services with a large selection of capabilities – point-in-time recovery, incremental backups, sandbox seeding, and many others.
Protect your Salesforce data from deletion
Automated Salesforce backup platform from GRAX
Most third-party options provide a large number of highly advanced features, as well. For example, compliance-ready audit trails and reporting capabilities help organizations with meeting regulatory requirements. Alternatively, relationship-aware recovery can assist with maintaining complex relationships between different objects during the restoration sequence.
How to Implement a Weekly Backup Strategy?
The implementation of efficient regular backup strategies necessitates careful planning and a lot of consideration when it comes to your company’s specific needs in different areas. Here is the rough implementation plan based on an average situation in regard to a backup strategy in Salesforce:
- Thorough data criticality assessment to understand where your priorities should lie.
- Establishment of several RPOs for different data types depending on their criticality.
- Creating a backup schedule that can align with the limitations of your business operations.
- Documentation for all backup procedures, including backup verification and recovery testing processes.
- Establishment of clear roles and responsibilities for managing the backup environment.
- Monitoring and analysis of backup performance and success rates can assist with maintaining the health of a backup environment.
It is not uncommon for backup processes in Salesforce environments to adopt the rotation system for existing backups in order to manage storage costs to a reasonable degree. For example, keeping daily backups for a week or weekly backups for a month would be a good idea in terms of redundancy while also remaining within the compliance limits the organization might work under. Of course, most modern companies prefer backups that are performed daily or even more often, but the rotation system is still applicable to such cases, as well.
Having a robust backup solution is important, but knowing how to use it in an efficient manner is even more valuable. This is how we move on toward our next section, which explores the best practices for data recovery in Salesforce, including proper testing for recovery procedures, general data loss scenario preparation, and more.
What Are the Best Practices for Data Recovery in Salesforce?
Robust data recovery environment is not just about picking the right solution for the job. A comprehensive and thorough approach to data protection and recovery is necessary in order for organizations to achieve their goals in terms of data recovery effectiveness. It can be achieved by combining technology, processes, and people, but the process itself can be reasonably challenging. These best practices are supposed to help companies overcome a certain portion of the challenge.
How to Protect Your Salesforce Data?
Data protection in Salesforce always begins with preventive measures. The goal of such measures is to minimize the risk of corruption or accidental deletion, above all else. Other notable elements include field-level security and restriction for the delete permissions, both of which form the first defense line around any environment. Here, we should also mention the requirement of additional approval steps for bulk operations and the creation of validation rules to prevent destructive changes during critical business hours.
Some of the most commonly used protective measures for Salesforce environments are:
- Field history tracking for sensitive information.
- Automated data integrity validation processes with predefined rules.
- User permission audits conducted on a regular basis.
- Frequent data quality assessments.
What Role Do Salesforce Administrators Play in Recovery?
Any Salesforce Administrator is the frontline defender of sorts when it comes to organizational data, considering their overall role in managing recovery tasks and preventing data loss. A complete understanding of the organization’s architecture and relationships between objects or records are necessary for the Administrator in question to work toward a successful data recovery environment in the most effective way.
It is up to Salesforce Administrators to develop and maintain detailed documentation of all Salesforce recovery procedures, including detailed guidelines for a variety of situations. Regular testing for all recovery procedures to look for potential issues or areas for improvement is also up to them. Additionally, it is always a good idea to maintain close relationships with Salesforce support and your own backup vendors in order to speed up the issue resolution process as much as possible.
How to Educate Users About Data Management?
Ongoing education and communication with each user are practically required in order to create a working data-aware culture. The primary goal should be to develop comprehensive training programs explaining the importance of data management and the impact of certain actions on organizational data. A lot of the basic concepts about the Recycle Bin, deletion types, and data recovery processes can be covered by simple training sessions performed on a regular basis.
The training materials should cover:
- Clear and detailed procedures for data loss incidents.
- Real-world examples of data loss scenarios, along with their resolution.
- Quick reference guides for common operations with data.
- Regular updates talking about changes in data management approaches or policies.
Documentation Requirements
Aside from the basic recovery procedures, organizations also have to maintain comprehensive documentation on the topic, meeting all of the necessary compliance and operational needs. The documentation in question should provide detailed system architecture diagrams with data flows and relationships between objects. A detailed and regularly updated data dictionary is also highly recommended to map critical business processes to specific Salesforce objects or fields, assisting with prioritizing recovery efforts during various incidents.
Thorough documentation is also required for all backup configuration changes (as well as the reasoning behind every change), and the same could be said for version control for automation, like Flow changes or Apex triggers. The continuity of backup processes in different situations relies a lot on detailed and thorough documentation as the baseline.
Data Recovery Testing Procedures
While it is true that sandbox testing methods are relatively common in modern data backup environments, effective recovery testing needs a lot more than that to be truly useful and efficient. For example, quarterly recovery simulations that mimic real-world scenarios can also assist in the testing process, making it possible to simulate complex restoration processes and verify both the validity of the recoverable information and the preservation of calculations, rules, and other capabilities that perform the recovery process in question.
Additionally, we would also recommend creating several specific testing scenarios for different recovery types – selective field recovery, bulk record restoration, point-in-time restoration, and so on. Each of these tests should have its own success criteria that are relevant to the process, measuring relationship preservation, system performance, field integrity, or any other specific parameter. Documenting all unexpected behavior during these tests would also be a good idea to improve your recovery procedures while also having the ability to identify hidden risks or issues before production.
A good understanding of these best practices offers a solid foundation for handling various data loss incidents. However, there is always the potential that a standard situation is not prevented by the existing measures and the information in question is permanently deleted. The answer to this question is what we are going to go over in the following section.
What to Do if Records Are Permanently Deleted?
As mentioned before, records in Salesforce generally have two main “deletion” states – soft deletion and hard deletion. Soft deletion is easily reversible, while hard deletion is much more difficult to deal with and has a lower chance of succeeding in the first place. Unintentional hard-deleted records are often treated as critical situations in an organization, requiring immediate and strategic action. As such, we would like to go over the most common options available for resolving such situations.
Are There Any Native Recovery Tools in Salesforce?
Once records are permanently deleted from the Recycle Bin, Salesforce still has at least one option for its users to consider – the Data Recovery Service. We have talked about this service’s capabilities before to a certain degree. It can recover permanently deleted data within the 85 days after the deletion, but it takes about 6-8 business days to complete, costs a large sum of money ($10,000) per each recovery request, and does not even provide a 100% guarantee of success.
Aside from the official recovery service, Salesforce also maintains system logs and API logs for certain time frames. This information can technically be used to access historical information about deleted records. It would not be enough to recover information directly, but it can serve as a helping hand when it comes to piecing together what was lost and may even hint at how it can be reconstructed manually.
How to Handle Critical Data Loss Situations?
Time is of the essence when facing a critical data loss situation. The first step should always be to analyze and document the total scope of the loss – including affected objects, total number of records lost, potential damage to related records that might have been affected by cascade deletion, and so on. Creating a detailed timeline of all events leading to the data loss time frame should assist with visualizing the situation as a whole while also assisting with preventing similar situations in the future.
The business impact of the loss should also be assessed as soon as possible, and affected records should be categorized by priority in the process. While the technical recovery efforts are ongoing, it would also be great to work with business stakeholders to find alternative data sources that might contain certain lost records – exported reports, email communications, external systems, and so on.
What Are Compliance Considerations for Data Recovery?
Data recovery efforts have an obligation to align with all kinds of applicable regulatory requirements and organizational compliance policies. Each step of the recovery process must be documented, including recovery methods, specific employees that have authorized the recovery, which records were able to be restored, and so on.
Such documentation is crucial for audit trails, demonstrating due diligence in securing sensitive information. The implications of partial data recovery should also be considered in terms of regulatory requirements – many regulations mandate complete record keeping that partial recovery might not meet the requirements for. In situations like these, organizations have to file appropriate notifications or disclosures with regulatory bodies about the data loss event and the applied recovery efforts.
The experience of permanent data loss is what prompts most organizations to re-evaluate their backup and recovery strategies. That way, we can come full circle to the importance of the proactive measures discussed in this article. Every single recovery incident, successful or not, can at least serve as a force for improving existing data protection strategies to make sure that nothing like that can happen again.
Conclusion
Data loss in Salesforce, while stressful, doesn’t have to be a catastrophic event if you’re well prepared. Organizations that have succeeded in implementing a multi-layered approach to data protection would be well-positioned to handle most (if not all) possible data loss scenarios. The key is not just in creating a comprehensive environment that uses both native features and third-party recovery solutions but also in fostering a data-aware culture in the organization where everyone understands the importance of protection and recovery procedures.
As Salesforce environments continue growing in size and scope, the importance of proactive data protection is also going to grow, becoming more and more critical to business continuity. Regular testing, continuous user education, and comprehensive documentation can help create a strong but flexible foundation that can deal with any data loss incident.
Successful data recovery in Salesforce is not just about restoring specific records – it is also about maintaining business continuity and making sure that the most valuable asset of any organization stays sufficiently protected.
FAQ
What happens to automated processes and workflows when deleted records are recovered?
Recovered records should not automatically trigger workflow rules, processes, or flows that would be active during normal record creation in most situations. The decision on whether any critical automated processes should be manually initiated after recovery is recommended to be performed on a case-by-case basis, with a lot of attention going toward processes that update related records or send notifications.
How does record recovery affect storage limits in Salesforce?
Luckily, recovering records from the Recycle Bin does not count as two records being stored instead of one since these records are still included in the total storage calculations until they are hard deleted. However, manually reconstructed records or information that is imported from external backups still counts toward the total storage limit. As such, it is recommended to monitor total storage consumption during large recovery operations in Salesforce.
Can I preserve record IDs while performing mass recovery operations in Salesforce?
While standard data importing processes do generate new record IDs in most cases, it is possible to maintain original record IDs using a small number of measures. The first option is the cancellation of the soft delete processes, but it is not as relevant since most users concerned with this issue are already past this stage. As such, the only two options available are:
- Custom recovery scripts through Bulk API with “undelete” and “hardDelete” operational preferences can preserve original record IDs.
- Some third-party backup solutions have ID-preserving recovery capabilities with the help of specialized API combinations.