# Fix ContentDocumentLinks

The *Fix DocLinks* tool repairs records in the Salesforce ContentDocumentLink table. The Salesforce ContentDocumentLink table has query restrictions that make it impossible to efficiently perform an 100% accurate incremental backup. There are two primary reasons that block an 100% accurate backup.

1. The ContentDocumentLink table cannot be queried only on its SystemModStamp field.
2. ContentDocumentLink permission values can be changed and there is no way to find the changes efficiently because of reason #1.

In practice most customers will either never run this tool or run it on a weekly basis.

## Running Fix DocLinks in a GUI

To access the Fix DocLinks GUI:

* Select “Other Tools” from the top-level menu.
* Select “Data Synchronization”, then “Fix DocLinks”.

The UI for the Fix DocLinks tool is minimal.

* The top of the dialog controls how many concurrent queries to run against Salesforce and what data ranges to scan.
* The middle part of the dialog has a large button for starting the search and text for reporting progress

![](/files/SBufnWzljMmqjUqBv2FH)

The tool will report progress as it scans records and when finished will look like:

![](/files/SQsTVjvuvsOx9ROhN5lG)

where:

* Candidates = total # of ContentDocumentLink records scanned
* Inserted = number of ContentDocumentLink records inserted into the CopyStorm database.
* Update = number of ContentDocumentLink records updated in the CopyStorm database.

## Running Fix DocLinks as a Batch Job

The Fix DocLinks tool can be run as a batch job using the following syntax:

* Windows
  * CopyStormMedic.bat -tool fixDocLinks -run configFile.copyStormMedic
* Linux or Mac
  * sh CopyStormMedic.sh -tool fixDocLinks -run configFile.copyStormMedic


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://learn.capstorm.com/reference/copystorm-medic/fix-contentdocumentlinks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
