How to Recover and Restore the Deleted Data using the Salesforce Data Loader

In Salesforce data management, many of the time we are required to recover and restore records that have been deleted. 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 a probably 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 the 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.

But we can restore the deleted data with the help of the Export and Insert data operation, where we recover the deleted data with the Export operation and then insert that recovered data with the help of 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.

See also  How to Install Salesforce Data Loader for Windows

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.

Restore deleted Data with Salesforce Data Loader

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.

Restore Data with Salesforce Data Loader

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.

Recover data of records with Salesforce Data Loader

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.

Recover deleted records with Salesforce Data Loader

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 button View Extraction.

Recover deleted Salesforce records with Data Loader

6. Now, we will be able to see the extracted records in the Data Loader CSV viewer, and here, click on the button open in the external file.

See also  How to Import Opportunities into Salesforce via Data Loader

7. Now save this CSV file in your system from where it can be accessed to the Data Loader.

Restore deleted Data with Data Loader in Salesforce

Till now we have recovered the deleted data of the Lead object.

Now, in the below steps, 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.

Restore deleted data of records with Salesforce Data Loader

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.

Data Restoration with Salesforce Data Loader

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.

Restore deleted data from recycle bin with Salesforce Data loader

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.

Deleted data recovered with Salesforce data loader

5. In this step, select the file location for the CSV files that will keep the data of the successes and errors that occurred in the data operation.

See also  How to Export Salesforce Users Data With Data Loader

At last, click on the Finish button.

Restore deleted records with Salesforce Data Loader

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

Deleted data restoration with Salesforce data loader

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.

Use Data Loader to restore the deleted data

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.

Restore the Data of leads with Salesforce Data Loader

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: