# How Scanning Works on Shopify

> When Dedupify scans your Shopify records, how it learns about changes between scans, and how to run a fresh scan.

Dedupify finds duplicates by scanning. A scan reads every customer and evaluates each one against your match rule. Turning a rule on starts one. After that, Dedupify checks each customer as it is created or updated and usually finds a new duplicate within seconds.

## The first scan

Turning on a match rule starts a scan of every customer in your store. Dedupify evaluates each customer against the rule and adds the pairs it finds to your review queue.

Only one scan runs at a time for your store. If you turn on several rules in a row, the scans queue and run one after another. Shopify gives each store its own request allowance, and Dedupify paces its reads to it, so a large store takes longer to scan.

A scan moves through these states:

* **Starting.** The scan is waiting to be picked up.
* **Scanning.** Dedupify is working through your records.
* **Complete.** The scan has finished, and the pairs it found are in your review queue.
* **Failed.** The scan stopped on an error, and it shows the reason.
* **Cancelled.** The scan was stopped before it finished, for example because you turned its rule off.

Progress and history are under **Scan status**. It lists each rule's latest scan, with the number of records indexed while it runs and the number of pairs found when it finishes. The connecting staff member can use **Retry scan** on a failed scan, and **Start a new scan** on a cancelled scan of a rule that is on.

Here is a scan from turning the rule on to Complete:

**Turn on a rule and watch the scan**

1. **Turn the rule on** Go to Apps, Dedupify, and on Match rules select Turn on for the rule. It stays review only. It queues a scan of your customers, which can take a moment to show up on Scan status.
2. **Open Scan status** Scan status lists each rule's scans, newest first.
3. **Watch the scan** It reads Starting for up to 2 minutes while the scan waits for a worker, then Scanning with a running count. Scanning takes a few minutes to tens of minutes, depending on how many records you have, and runs in the background. When it reads Complete, its pairs are in the review queue.

Pairs a rule merged on its own are listed under **Automatic merges** on **Match rules**, newest first. Auto-merge runs only on an active paid plan.

To see what Dedupify merged on its own and how each scan went, step through it:

**Check automatic merges and scan history**

1. **Open Match rules** Go to Apps, Dedupify and select Match rules.
2. **Read the automatic merges** Automatic merges lists every pair a rule merged without review, newest first: the record that was kept, the rule that matched, its score and when. Show older merges loads the earlier ones.
3. **Check past scans** Scan status shows each rule's latest scan, whether it completed, and how many possible duplicates it found.

## How Dedupify sees changes

After the first scan, Dedupify needs to learn about records that are created, edited, deleted, or merged.

Shopify tells Dedupify when a customer is created, edited, deleted or merged, and Dedupify reads that customer again from Shopify and evaluates it against your rules. You do not need to run a scan each time a customer changes.

## Getting a fresh full scan

Turning a rule on queues a full scan, so the way to a fresh pass is to turn the rule off and on again.

You rarely need this, because Shopify's notifications bring changes in on their own. Use it after a large import you want evaluated at once, or when you think Dedupify missed duplicates.

The scan reads every customer from Shopify again.

Turning a rule off stops its scans and dismisses its pending pairs from the review queue. The new scan finds them again, and a pair you rejected stays rejected.

Open **Match rules**, select **Turn off** on the rule, then **Turn on**. Saving new thresholds on a rule that is on does not start a scan. Saving a change to its fields does, and the rule stays on: see [Change a rule that is on](../rules/#change-a-rule-that-is-on).

## What does not start a scan

There is no nightly or scheduled full scan. A full scan starts when a rule is turned on, including turning it back on after turning it off, when you retry a failed scan, and when you save a change to the fields of a rule that is on. **Start a new scan** also runs one again after a cancelled scan of a rule that is on. Between full scans, Dedupify evaluates only the customers that changed.

## Related

* [Match rules](../rules/): the rules that drive each scan.
* [Review thresholds and auto-merge](../auto-merge/): which pairs reach your review queue and which merge on their own.

Source page: https://artifactapps.com/docs/dedupify/shopify/scanning/
