In Salesforce data management, we frequently need to recover and restore deleted records. As we know, the deleted data gets stored in the recycle bin, so in the process of restoring the deleted data, we fetch it from the recycle bin.
There is probably an easy option to restore the data manually from the Salesforce Recycle Bin, but when we have bulk data to restore from the recycle bin, then the Salesforce Data Loader is a suitable tool that can manage bulk data.
Let’s learn how to recover and restore the deleted data using the data loader in Salesforce Lightning.
Recover and Restore the Deleted Data using the Salesforce Data Loader
In Salesforce, Data Loader allows us to insert, update, delete, and export data. However, it doesn’t have a feature to restore records that have been deleted.
Once data is deleted in Salesforce, it typically moves to the recycle bin, where it remains for a certain period before being permanently deleted.
We can restore deleted data using the Export and Insert data operations. First, we export the deleted data using the Export operation, and then we insert it using the Insert data operation.
Recover and Restore the Deleted Data using the Salesforce Data Loader
Recovering the deleted data will be completed in two, where we will export the deleted data from the recycle bin with the data loader, and then we will insert the exported data to the specific object again with the data loader.
In the steps below, we will recover and restore the deleted data.
Recover the Deleted Data using the Salesforce Data Loader
To recover the deleted data using the Salesforce Data Loader, open the data loader, log in with your credentials, and follow the steps below.
1. In the Data Loader, click on the button Export All.

2. In this step, select the data object from which you have to recover the data. In this example, I have to recover the deleted Lead data, so I have selected the object Lead.
After this, save the name and location for the CSV file in which we will get the extracted data of the records.
At last, click on the Next button.

3. In this step, click on the button Select All fields, or you can select specific fields that you want to export.
After this, we have to define the conditions for the deleted records, and to do that, go to the Field and enter isDeleted, then keep the Value as True. This condition will export the data of deleted lead records.
In the query text area, remove the comma from the ‘True’; otherwise, it will throw an error. After this, click on the Finish button.

4. As we click on the Finish button, we will get a warning message regarding the export operation. Here, click on the Yes button to proceed.

5. After the completion of the export operation, we will get the message of the successes and the errors that occurred during the extraction.
In this window, click on the View Extraction button.

6. Now, we will be able to see the extracted records in the Data Loader CSV viewer, and here, click on the button to open the external file.
7. Now save this CSV file in your system from where it can be accessed to the Data Loader.

Till now, we have recovered the deleted data of the Lead object.
Now, in the steps below, we will restore the recovered value in the Salesforce data with the Salesforce data loader.
Restore the Deleted Data using the Salesforce Data Loader
To restore the deleted data using the Salesforce Data Loader, open the Data Loader and log in with your credentials.
Now, for restoring the data, we will use the CSV file in which we have recovered the data of deleted records in the above steps.
1. Open the data loader and click on the Insert button.

2. In this step, select the data object and the CSV file in which you have recovered the data. In this example, we have selected the Lead object to restore data.
After this, browse the CSV file in which you have recovered data, then click on the Next button.

3. As we click on the Next button, the CSV file will be initialized, and in this window, we can view the number of rows of the CSV file.
Here, click on the OK button.

4. In this step, we will create a mapping between the data object fields and the column header of the CSV column, and to do that, click on the button Create or Edit a Map.
Then in the next window, click on the button Auto-Match Fields to Columns. As we click on this button, the field name of the objects will be auto-matched with the header columns of the CSV file.
After this, click on the OK button, then click on the Next button.

5. In this step, select the file location for the CSV files that will keep the data of the successes and errors in the data operation.
At last, click on the Finish button.

6. As we click on the Finish button, a warning message will appear, and here, click on the Yes button to proceed.

7. After the completion of the insertion of data from the deleted records, we can see the message of completion of data transfer.
Here, we can also view the inserted data with the data loader CSV viewer from View Success. At last, click on the OK button to close the data loader.

Now, we have successfully recovered and restored the deleted data with the help of the Salesforce Data Loader.
To view the restored data, open the object tab. In this case, I have inserted the data in the Leads object.
In the Lead object window, select the list view as Created Today, then you will able to see the records that we have restored now.

In this way, we can recover and restore the deleted data with a data loader in Salesforce by following the above steps.
Conclusion
Salesforce Data Loader is a versatile tool that not only facilitates data management but also provides a reliable solution for recovering and restoring deleted records. By following the above steps you will be now able to recover and restore the deleted data in your Salesforce instance using the Salesforce Data Loader.
You may like to read:
- How to Insert Null or Blank Values with the Salesforce Data Loader
- How to Export Data from Salesforce
- How to Insert File with Dataloader in Salesforce
I am Bijay Kumar, the founder of SalesforceFAQs.com. Having over 10 years of experience working in salesforce technologies for clients across the world (Canada, Australia, United States, United Kingdom, New Zealand, etc.). I am a certified salesforce administrator and expert with experience in developing salesforce applications and projects. My goal is to make it easy for people to learn and use salesforce technologies by providing simple and easy-to-understand solutions. Check out the complete profile on About us.