# `TiDB` Disaster Recovery Solution with `TiCDC`: Recover

+ In case of disaster, manually recover the secondary cluster by running:
  + **`cdc redo apply`** command, for example:

![`smart`](TiCDCDisasterRecovery1_aa_001_20220622.png)

```
tiup cdc ~!@redo apply@!~ --tmp-dir="/tmp/cdc/redo/apply" \
    --storage="s3://logbucket/test-changefeed" \
    --sink-uri="mysql://normal:123456@10.0.10.55:3306/"
```

-------------------------------------------------------------
When a disaster happens in the primary cluster, you need to recover manually in the secondary cluster by running the `cdc redo` command. The recovery process is as follows.
- 1. Ensure that all the `TiCDC` processes have exited. This is to prevent the primary cluster from resuming service during data recovery and prevent `TiCDC` from restarting data synchronization.
- 2. Use `cdc` binary for data recovery. Run the following command:

For example:
```
tiup cdc redo apply --tmp-dir="/tmp/cdc/redo/apply" \
    --storage="s3://logbucket/test-changefeed" \
    --sink-uri="mysql://normal:123456@10.0.10.55:3306/"
```

`tmp-dir:` Specifies the temporary directory for downloading `TiCDC` incremental data backup files.
`storage:` Specifies the address for storing the `TiCDC` incremental data backup files, either an `Amazon S3` storage or an `NFS` directory.
`sink-uri:` Specifies the secondary cluster address to restore the data to. Scheme can only be `mysql`.
