How to set CreatedDate and LastModifiedDate while inserting Data using Data Loader in Salesforce?

1. Go to User Interface in Salesforce Setup.

2. Enable the check box Enable "Set Audit Fields upon Record Creation" and "Update Records with Inactive Owners" User Permissions.

3. Create a Permission Set with "Set Audit Fields upon Record Creation" permission enabled.

4. Assign the Permission Set to the Data loading User.

5. In the import csv file, use CreatedDate and LastModifiedDate.

Sample CSV for Chat Transcript Object:

Data Loader Field Mapping: