# Migrating to DeviceCloud

This guide shows how to export your tests from Moropo and run them in [DeviceCloud](https://devicecloud.dev/)

**Stage One: Exporting your Moropo tests to YAML files**

Moropo's tests are hosted in the Moropo cloud system, but DeviceCloud requires that you manage these locally using your own filesystem.

1. Ensure you have a Moropo API key by accessing this [page](https://app.moropo.com/settings?index=api%20keys) in your Moropo account.
2. Run this command in your terminal: `curl -X 'GET' 'https://api.dev.moropo.com/tests' -H 'accept: application/zip' -H 'x-app-api-key: <YOUR API KEY>' -H 'x-branch-name: main' --output mytests.zip`  (replace **\<YOUR API KEY>** with the key from Moropo)
3. Unzip the 'mytests.zip' folder using your filesystem
4. In the root of the folder, create a new file called 'config.yaml' with the following contents:<br>

   ```
   flows:
     - ./**/*.yaml
     - ./*.yaml
   ```

Important - ensure the spaces match exactly.

5. (optional, but recommended) Add the files to a GitHub repository (or similar) so they are backed up.

**Stage Two: Running the tests in DeviceCloud**

1. Register for a DeviceCloud account [here](https://console.devicecloud.dev/login?).
2. Now follow the [DeviceCloud QuickStart guide](https://docs.devicecloud.dev/getting-started/quickstart).
3. You can run your whole Moropo suite in DeviceCloud using this command:\
   `dcd cloud --api-key <YOUR DEVICECLOUD KEY> myapp.apk/.app mytest`
