# 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`


---

# 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://docs.moropo.com/guides/migrating-to-devicecloud.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.
