---
title: Use storage from another run
url: https://docs.apify.com/storage/use-from-another-run.md
parents:
  - [Apify documentation](https://docs.apify.com/llms.txt)
  - [Storage](https://docs.apify.com/storage.md)
previous: [Share](https://docs.apify.com/storage/share.md)
---

> ## Documentation index
> Fetch the complete documentation index at: https://docs.apify.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Use storage from another run

If you have the storage's *name* or *ID*, you can access it from any [Actor](https://docs.apify.com/actors.md) or [task](https://docs.apify.com/actors/running/tasks.md) run. Use the same methods and endpoints you'd use for the current run's storages: open the storage with the SDK, open it with an API client, or call the Apify API.

[Datasets](https://docs.apify.com/storage/dataset.md) and [key-value stores](https://docs.apify.com/storage/key-value-store.md) support concurrent use. Multiple Actors or tasks can write to the same dataset or key-value store, and multiple runs can read from them at the same time.

[Request queues](https://docs.apify.com/storage/request-queue.md) only allow multiple runs to add new data. A request queue can be processed by one Actor or task run at a time. However, you can use [request locking](https://docs.apify.com/storage/request-queue.md#distributivity) to coordinate multiple runs.

When multiple runs use the same storage at the same time, the order in which their operations are processed is not guaranteed. For example, if a delete of a key-value store record is processed before a read of the same record, the read fails.

Accessing restricted storage resources between runs

If a storage resource access is set to **Restricted**, the run from which it's accessed must have explicit access to it. Learn [how restricted access works](https://docs.apify.com/account/collaboration/general-resource-access.md) and [how to grant it](https://docs.apify.com/storage/share.md).

## Open a storage with the SDK

Open the storage with the same method you would use for the current run's storage, and pass the name or ID of the one you want.

**JavaScript**


```js
import { Actor } from 'apify';



await Actor.init();



const otherDataset = await Actor.openDataset('old-dataset');

// ...



await Actor.exit();
```


**Python**


```python
from apify import Actor



async def main():

    async with Actor:

        other_dataset = await Actor.open_dataset(name='old-dataset')

        # ...
```


Only the method name changes with the storage type:

| Storage type    | [JavaScript SDK](https://docs.apify.com/sdk/js)                                                    | [Python SDK](https://docs.apify.com/sdk/python)                                                              |
| --------------- | -------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| Dataset         | [Actor.openDataset()](https://docs.apify.com/sdk/js/reference/class/Actor#openDataset)             | [Actor.open_dataset()](https://docs.apify.com/sdk/python/reference/class/Actor#open_dataset)                 |
| Key-value store | [Actor.openKeyValueStore()](https://docs.apify.com/sdk/js/reference/class/Actor#openKeyValueStore) | [Actor.open_key_value_store()](https://docs.apify.com/sdk/python/reference/class/Actor#open_key_value_store) |
| Request queue   | [Actor.openRequestQueue()](https://docs.apify.com/sdk/js/reference/class/Actor#openRequestQueue)   | [Actor.open_request_queue()](https://docs.apify.com/sdk/python/reference/class/Actor#open_request_queue)     |

## Open a storage with an API client

Construct the storage's client with the name or ID of the storage you want. To use a storage owned by another user, prefix the name with their username, as in `jane-doe/old-dataset`. Then read and write exactly as you would with the current run's storage.

**JavaScript**


```js
const otherDatasetClient = apifyClient.dataset('jane-doe/old-dataset');
```


**Python**


```python
other_dataset_client = apify_client.dataset('jane-doe/old-dataset')
```


Only the accessor changes with the storage type:

| Storage type    | JavaScript client                                                                                       | Python client                                                                                                  |
| --------------- | ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| Dataset         | [apifyClient.dataset()](https://docs.apify.com/api/client/js/reference/class/DatasetClient)             | [apify_client.dataset()](https://docs.apify.com/api/client/python/reference/class/DatasetClient)               |
| Key-value store | [apifyClient.keyValueStore()](https://docs.apify.com/api/client/js/reference/class/KeyValueStoreClient) | [apify_client.key_value_store()](https://docs.apify.com/api/client/python/reference/class/KeyValueStoreClient) |
| Request queue   | [apifyClient.requestQueue()](https://docs.apify.com/api/client/js/reference/class/RequestQueueClient)   | [apify_client.request_queue()](https://docs.apify.com/api/client/python/reference/class/RequestQueueClient)    |

## Use the Apify API

Send requests to the same endpoints you would use for the current run's storages, passing the name or ID of the storage you want. See the endpoint reference for [datasets](https://docs.apify.com/storage/dataset.md#apify-api), [key-value stores](https://docs.apify.com/storage/key-value-store.md#apify-api), and [request queues](https://docs.apify.com/storage/request-queue.md#apify-api).
