As Salesforce took aback with their native recovery reservice, users are now left with fewer options for data backup on Salesforce. However, there are many out-of-the-box data backup and recovery tools available at the App Exchange, which offer many quick and easy options for data management. If you handle an enterprise Salesforce CRM, then you may have to make many decisions regarding it. One important thing is how you may backup your Salesforce data and recover it effectively in case of any data destruction or deletion. In this article, we will try to break down the options of data backup and recovery in Salesforce using the weekly data exports, Salesforce API, and Sandbox. Here, we are examining the native options from Salesforce named Data Loader to try and outline how it helps us in the process of data backup.
Benefits of using Data Loader
Data Loader is a wonderful tool that helps import, export, update, and delete data in huge volumes within Salesforce Org. While you do data import, Data Loader can read, extract, and load the data in bulk from CSV files or Bulk API. While you export data, it again outputs the same type of CSV files, which is similar to the weekly export files. You may keep in mind that when Weekly Report Export can process all these files into one or multiple ZIP files, Data Loader will only process a single CSV file at a time.
One major thing, which makes Data Loader much attractive is that it comes free with both Classic and Lightning versions of Salesforce. Users of both these variants can either install this Data Loader onto their Mac or Windows environment with UI or use the command-line interface to specify the data files to be backed up. As far as Salesforce is concerned, Data Loader syncs well with this platform can be accessed by multiple team members ranging from normal users to admins and developers.
Another big advantage of Salesforce Data Loader is that it can manage a sheer amount of data. This tool will let you handle data up to five million records at a time. Comparing it with the other similar solutions, we can see that Salesforce’s native Data Import Wizard will allow you to handle only about 50,000 records at a time. Data Loader also offers the users ability to save the field mapping for future reference instead of choosing the field to map each time. This saves a great among of time while importing data.
For various reasons, as we discussed above, now Data Loader is one of the most popular tools for handline Salesforce data. Even though it is often used to import data to Salesforce, it can also be leveraged to export data for Salesforce data backup and recovery. The backup process in Data Loader is more or less similar to that of Weekly export, which needs downloading manually. By downloading the CSV files or by scheduling the export, you need to spend a lot of time for the process to complete. Unlike Weekly Export, on Data Loader, you can do the data restoration to Salesforce much easily and without wasting time. In any case, always be cautious if you deal with Data Loader as your only backup solution.
Creating backup CSV files
For backing up Salesforce data, you have to export it as CSV files. As it is a manual process, you may likely do it frequently as every week or so. You need to consider that it will affect the recovery time of your organization, as with a longer backup interval, you have the risk of losing the data in the interim period from the last backups.
If you are running the Data Loader from CLI, then another easy workaround will let you schedule the Data Loader for running an export at a set time. You can easily do this with the help of Windows Task Scheduler. As you can insert only one object at a time into the Data Loader, there may also be a need to create a unique CSV for each of the objects. These objects may include the accounts, contacts, opportunities, and custom objects, etc. This process can be time-consuming, but it is a critical aspect of any good data backup and recovery plan.
Isolating missing data
If you think you have some lost data, the primary step is to isolate missing data. Sizing the damage this way will involve getting two distinct sets of data from two dates, one of which will be that of a date before the data loss and another to be set after the data loss. Ideally, as we explained in the previous step, you can extract both these data sets as CSV files.
Creating .CSV files for restoration
Once the records for restoration are identified, you have to create a separate file for each of the Salesforce objects. These include accounts which are the parent object and the child objects like contacts, opportunities, etc., along with the orphan object of custom object lookups. You may start first with parent records lost and then review the child as well as orphan files for possible deletions. Once this is done, you can simply copy and paste the lost records into individual files and save them as CSV files.
Build external ID
When someone deletes your Salesforce record, the latest ID value is also lost, and then SF tends to assign a new value upon restoring the record. This unique ID poses a challenge for each related object as you have to preserve the relationship between the connected objects in the record based on IDs. So, one easy to maintain the relationships is to use the old ID values itself as a new external ID. While doing the data import for restoring the deleted records, external ID may also act as a common thread between various associated objects.
Always export the parent records first, generate the appropriate ID values, and add the child records as per the correct relationships under the parent record. Once you reach this step, it becomes easy to restore the records with CSV files in the correct order. With Data Loader, it is much easier to backup and restores data, but you need to be very careful while using this tool in order to avoid any mass deletion or update of data.