# Configuring a `DM` Task: Source Databases (Upstream) and Target Database (Downstream)

+ Edit a `yaml` file, for example: **`test-task.yaml`**
+ Define upstream using **`mysql-instances`**
+ Define downstream `TiDB` using **`target-database`**
+ **`mysql-replica-01`** is the `source-id` of `DM data source` we created in the previous step

```
## ********* Basic configuration *********
name: test

## ******** Data source configuration **********
~!@mysql-instances:@!~
  - source-id: ~!@"mysql-replica-01"@!~

## ******** Downstream TiDB database configuration **********
~!@target-database:@!~
  host: "172.16.10.83"
  port: 4000
  user: "root"
  password: "ZqMLjZ2j5khNelDEfDoUhkD5aV5fIJOe0fiog9w="
```
-------------------------------------------------------------
Once the `DM` upstream database (source database) is ready, you need to configure the task upstream and downstream (target) database. Once the task configuration file is edited, load it by tiup `dmctl`.

Assuming that the task name is `test` and migrates in both full and incremental ways, the IP of the downstream database (target database) is `172.16.10.83`, and the configuration file is `test-task.yaml`, the configuration file is:

```
## ********* Basic configuration *********
name: test

## ******** Data source configuration **********
mysql-instances:
  - source-id: "mysql-replica-01"

## ******** Downstream TiDB database configuration **********
target-database:
  host: "172.16.10.83"
  port: 4000
  user: "root"
  password: "ZqMLjZ2j5khNelDEfDoUhkD5aV5fIJOe0fiog9w="
```
