# Tracking files stored in S3 without adding it into local storage

**URL:** https://discuss.dvc.org/t/tracking-files-stored-in-s3-without-adding-it-into-local-storage/1715
**Category:** Questions
**Created:** [July 3, 2023, 1:56pm UTC](https://discuss.dvc.org/t/tracking-files-stored-in-s3-without-adding-it-into-local-storage/1715 "2023-07-03T13:56:16Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Shubham477](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@Shubham477](https://discuss.dvc.org/u/Shubham477)
#### Post date: [July 3, 2023, 1:56pm UTC](https://discuss.dvc.org/t/tracking-files-stored-in-s3-without-adding-it-into-local-storage/1715/1 "2023-07-03T13:56:16Z")

</div>

With the introduction of DVC 3.0, file stored in AWS S3 remote storage can’t be tracked anymore. Is there any workaround for this problem?

I have tried adding files for tracking but getting this error. If anybody has solution for this problem,  
Please let me know, Thanks in advance.

(py38\_env) PS C:\dvc\_research\snowflake\_pvc\> dvc add s3://dvc-demo-bucket-1/dataset/experimented.csv  
ERROR: Cached output(s) outside of DVC project: s3://dvc-demo-bucket-1/dataset/experimented.csv. See \<[https://dvc.org/doc/user-guide/pipelines/exter](https://dvc.org/doc/user-guide/pipelines/exter)  
nal-dependencies-and-outputs\> for more info.

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/dataversioncontrol/original/1X/3c18fa025dd9ae83fee41a1a977194157aaac262.png)

---

<div class="post-metadata">

### Author: ![dberenbaum](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@dberenbaum](https://discuss.dvc.org/u/dberenbaum)
#### Post date: [July 3, 2023, 2:21pm UTC](https://discuss.dvc.org/t/tracking-files-stored-in-s3-without-adding-it-into-local-storage/1715/2 "2023-07-03T14:21:32Z")

</div>

Hi @Shubham477, have you taken a look at [External Data](https://dvc.org/doc/user-guide/data-management/importing-external-data)?

---

<div class="post-metadata">

### Author: ![Shubham477](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@Shubham477](https://discuss.dvc.org/u/Shubham477)
#### Post date: [July 5, 2023, 7:10am UTC](https://discuss.dvc.org/t/tracking-files-stored-in-s3-without-adding-it-into-local-storage/1715/3 "2023-07-05T07:10:11Z")

</div>

Thanks @dberenbaum, But I have one question over here, Change in dataset can be tracked but can we go to old dataset without versioning enabled in AWS S3. Like if we update the tracked dataset with new dataset, my condition is we should be able to go back to old dataset if any update comes on it according to git checkouts

---

<div class="post-metadata">

### Author: ![dberenbaum](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@dberenbaum](https://discuss.dvc.org/u/dberenbaum)
#### Post date: [July 5, 2023, 11:46am UTC](https://discuss.dvc.org/t/tracking-files-stored-in-s3-without-adding-it-into-local-storage/1715/4 "2023-07-05T11:46:51Z")

</div>

From the link I shared above:

> During [`dvc push`](https://dvc.org/doc/command-reference/push), DVC will upload the version of the data tracked by `data.xml.dvc` to the [DVC remote](https://dvc.org/doc/user-guide/data-management/remote-storage) so that it is backed up in case you need to recover it.

That means you can go back to the old dataset later by doing a `git checkout` of the commit that tracked the old dataset, then a `dvc pull` to download it and check it out locally.

However, this will not change what is on s3. It would be up to you to manually upload the old dataset back to the original s3 location if that’s what you want. The idea is that DVC can recover any old versions without touching the original dataset, which is safer in case you didn’t mean to overwrite or, other people were depending on it, etc.

---

<div class="post-metadata">

### Author: ![dberenbaum](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@dberenbaum](https://discuss.dvc.org/u/dberenbaum)
#### Post date: [July 5, 2023, 12:08pm UTC](https://discuss.dvc.org/t/tracking-files-stored-in-s3-without-adding-it-into-local-storage/1715/5 "2023-07-05T12:08:22Z")

</div>

I have suggested some changes to the docs to explain this better in [link between imports and external deps/outputs by dberenbaum · Pull Request #4672 · iterative/dvc.org · GitHub](https://github.com/iterative/dvc.org/pull/4672). Please take a look and provide your thoughts on if it’s a helpful clarification. Thanks!
