# How to clean unused share key link

**URL:** <https://forum.pydio.com/t/how-to-clean-unused-share-key-link/4906>\
**Category:** Pydio Cells\
**Tags:** sharing\
**Created:** [January 11, 2023, 2:28pm UTC](https://forum.pydio.com/t/how-to-clean-unused-share-key-link/4906 "2023-01-11T14:28:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sbs](https://yyz2.discourse-cdn.com/flex032/user_avatar/forum.pydio.com/sbs/32/1787_2.png) [@sbs](https://forum.pydio.com/u/sbs)\
**Post date:** [January 11, 2023, 2:28pm UTC](https://forum.pydio.com/t/how-to-clean-unused-share-key-link/4906/1 "2023-01-11T14:28:50Z")

</div>

Hi,

Somehow, my cell is docker wiped itself (datasources, users, roles).  
Anyways, I have recovered access to the systems,and recreated the datasources mapped to the file system but I cannot reuse any sharing link because they are already stored in the datastore database.

I tried removing the files in the datastore and restart, but the newly created stores are empty, and no file will share.

What is the way to properly clean this datastore.  
FWIW these files are located in /cells/services/pydio.grpc.docstore

This seems the same kind of problem as :

- [Personalized shares hashes previously used remain in. database](https://forum.pydio.com/t/personalized-shares-hashes-previously-used-remain-in-database/4782)
- [Remove public broken links in Pydio Cells 3.0.7](https://forum.pydio.com/t/remove-public-broken-links-in-pydio-cells-3-0-7/4489)

---

<div class="post-metadata">

**Author:** ![charles](https://yyz2.discourse-cdn.com/flex032/user_avatar/forum.pydio.com/charles/32/3_2.png) [@charles](https://forum.pydio.com/u/charles)\
**Post date:** [January 11, 2023, 4:09pm UTC](https://forum.pydio.com/t/how-to-clean-unused-share-key-link/4906/2 "2023-01-11T16:09:33Z")

</div>

Hello,  
Ok let’s try this (just tested locally)

- Go to the pydio.grpc.docstore folder
- Backup the docstore.db file by making a copy 😉
- Download [GitHub - br0xen/boltbrowser: A CLI Browser for BoltDB Files](https://github.com/br0xen/boltbrowser) (they give pre-built binaries)
- Stop Cells
- Open `docstore.db` file using boltbrowser, and fully remove the `store-share` bucket (use ‘?’ to get help). Eventually you can enter the `store-share` bucket and clean/keep the links that interest you.
- Quit and restart Cells
- You should then be able to recreate links with the old hashes.

FYI, Cells v4 now offers MongoDB support exactly for that reason: all boltdb and bleve indexes can be moved to a Mongo server, making this type of external intervention much easier!

---

<div class="post-metadata">

**Author:** ![sbs](https://yyz2.discourse-cdn.com/flex032/user_avatar/forum.pydio.com/sbs/32/1787_2.png) [@sbs](https://forum.pydio.com/u/sbs)\
**Post date:** [January 11, 2023, 6:14pm UTC](https://forum.pydio.com/t/how-to-clean-unused-share-key-link/4906/3 "2023-01-11T18:14:32Z")

</div>

Ok, I’ll try that.

Regarding the mongoDB, it is offered in the cell configure, but default to N so, I did no go with it.

Should I try to enable it? If yes, how can I do this without reconfiguring?

If I enable mongo db, knowing that the whole thing is running in docker, What will the suggested way of going for managing the mongodb?

Regards,

---

<div class="post-metadata">

**Author:** ![sbs](https://yyz2.discourse-cdn.com/flex032/user_avatar/forum.pydio.com/sbs/32/1787_2.png) [@sbs](https://forum.pydio.com/u/sbs)\
**Post date:** [January 12, 2023, 2:55am UTC](https://forum.pydio.com/t/how-to-clean-unused-share-key-link/4906/4 "2023-01-12T02:55:25Z")

</div>

Hi,

It does work indeed.  
I wish I could update the repo field of the 944 shares, so as not recreate them.  
But at least, I can reuse share ids and they point to the proper files .

Thank you.

---

<div class="post-metadata">

**Author:** ![charles](https://yyz2.discourse-cdn.com/flex032/user_avatar/forum.pydio.com/charles/32/3_2.png) [@charles](https://forum.pydio.com/u/charles)\
**Post date:** [January 12, 2023, 8:36am UTC](https://forum.pydio.com/t/how-to-clean-unused-share-key-link/4906/5 "2023-01-12T08:36:44Z")

</div>

Good to know it worked.

As for editing the links, re-using your boltdb backup, you can try to migrate all bolt/bleve to mongo, then use a tool like MongoDB Compass to dig the links and edit them. See [https://pydio.com/en/docs/cells/v4/configuring-mongo-storage](https://pydio.com/en/docs/cells/v4/configuring-mongo-storage) (bottom of the page). Basically you can add a mongo container in your docker setup.

If you have an issue you can still revert config changes.  
-c

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex032/uploads/pydio/original/2X/6/61f19fa52ec15fd4250db51aea351adba0e831fd.png) [@system](https://forum.pydio.com/u/system)\
**Post date:** [March 13, 2023, 8:37am UTC](https://forum.pydio.com/t/how-to-clean-unused-share-key-link/4906/6 "2023-03-13T08:37:27Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
