# Migrating Datasets to the Tensor Database

## How to migrate existing Deep Lake datasets to the Tensor Database

Datasets are created in the Tensor Database by specifying the `dest = "hub://<org_id>/<dataset_name>"` and `runtime = {"tensor_db": True})` during dataset creation. If datasets are currently stored locally, in your cloud, or in non-database Activeloop storage, they can be migrated to the Tensor Database using:

<pre class="language-python"><code class="lang-python"><strong>import deeplake
</strong>
<strong>ds_tensor_db = deeplake.deepcopy(src = &#x3C;current_path>, 
</strong>                                 dest = "hub://&#x3C;org_id>/&#x3C;dataset_name>", 
                                 runtime = {"tensor_db": True}, 
                                 src_creds = {&#x3C;creds_dict>}, # Only necessary if src is in your cloud
                                 )
</code></pre>


---

# 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-v3.activeloop.ai/examples/rag/managed-database/migrating-datasets-to-the-tensor-database.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.
