# Is there a safe and reliable way to move data directory out of web root?

**URL:** <https://help.nextcloud.com/t/is-there-a-safe-and-reliable-way-to-move-data-directory-out-of-web-root/3642>\
**Category:** ℹ️ Support\
**Created:** [September 27, 2016, 7:30pm UTC](https://help.nextcloud.com/t/is-there-a-safe-and-reliable-way-to-move-data-directory-out-of-web-root/3642 "2016-09-27T19:30:52Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![anon58843897](https://help.nextcloud.com/letter_avatar/anon58843897/32/6_22734026db12803ebb3e059622ac3534.png) [@anon58843897](https://help.nextcloud.com/u/anon58843897)\
**Post date:** [September 28, 2016, 12:46pm UTC](https://help.nextcloud.com/t/is-there-a-safe-and-reliable-way-to-move-data-directory-out-of-web-root/3642/7 "2016-09-28T12:46:09Z")

</div>

@robertb

I’m not sure about encryption. I’ve only tested it with the encryption module turned off. Does the new location of the data directory still have the same permissions/ownership that your old directory had? I apologize if I lead you incorrectly. I was not aware there were database changes required.

@nickvergessen

I am a little confused here. I’ve changed the data directory multiple times without editing the database, and everything continues to work. For testing, the data directory location changes went like this,

1: /private\_html/data  
2: /private\_html/datastorage  
3: /private\_html/iamgroot  
4: /private\_html/racoonsarecool

Here are my exact steps.

1: Log out of Nextcloud’s web interface.  
2: Move the folder to the new location.  
3: Edit config/config.php and adjust the data directory path  
4: Run ./occ files:scan --all  
5: Log back into the web interface.

My oc\_storage table looks like this,

![](https://help.nextcloud.com/uploads/default/original/2X/5/590ec4082b7b384c3afdfc14106268b7639ebeb2.png)

For reference, this is Nextcloud 10. The config.php version says, ‘version’ =\> ‘9.1.0.16’. Would you mind clarifying the oc\_storage changes? I don’t want to be giving people bad advice.

---

_[View the full topic](https://help.nextcloud.com/t/is-there-a-safe-and-reliable-way-to-move-data-directory-out-of-web-root/3642)._
