# FileSettings.Directory not respected by bulk export tool

**URL:** <https://forum.mattermost.com/t/filesettings-directory-not-respected-by-bulk-export-tool/10146>\
**Category:** Troubleshooting\
**Created:** [July 21, 2020, 2:31pm UTC](https://forum.mattermost.com/t/filesettings-directory-not-respected-by-bulk-export-tool/10146 "2020-07-21T14:31:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![willg101](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/willg101/32/4012_2.png) [@willg101](https://forum.mattermost.com/u/willg101)\
**Post date:** [July 21, 2020, 2:31pm UTC](https://forum.mattermost.com/t/filesettings-directory-not-respected-by-bulk-export-tool/10146/1 "2020-07-21T14:31:02Z")

</div>

Hello!

I am running Mattermost Team Edition 5.25 and am running into an issue with the bulk export tool:

```auto
mattermost@hostname:/var/lib/mattermost$ ./bin/mattermost export bulk out.json
{"level":"info","ts":1595340223.2989829,"caller":"utils/i18n.go:83","msg":"Loaded system translations","for locale":"en","from locale":"/var/lib/mattermost/i18n/en.json"}
{"level":"info","ts":1595340223.2992501,"caller":"app/server_app_adapters.go:58","msg":"Server is initializing..."}
{"level":"info","ts":1595340223.3029568,"caller":"sqlstore/supplier.go:227","msg":"Pinging SQL","database":"master"}
{"level":"info","ts":1595340223.5842798,"caller":"app/license.go:40","msg":"License key from https://mattermost.com required to unlock enterprise features."}
{"level":"info","ts":1595340223.5965817,"caller":"mlog/log.go:167","msg":"Starting up plugins"}
{"level":"info","ts":1595340223.5966902,"caller":"app/plugin.go:202","msg":"Syncing plugins from the file store"}
{"level":"info","ts":1595340224.1485968,"caller":"mlog/sugar.go:19","msg":"Ensuring Surveybot exists","plugin_id":"com.mattermost.nps"}
{"level":"info","ts":1595340224.1664796,"caller":"app/server.go:273","msg":"Current version is 5.25.0 (5.25.0/Wed Jul 15 16:22:44 UTC 2020/0e46bac9fdd8c1140ad0e036104735fb4cbebef3/b544b15ccc487c8b438c786f6f54847071786920)","current_version":"5.25.0","build_number":"5.25.0","build_date":"Wed Jul 15 16:22:44 UTC 2020","build_hash":"0e46bac9fdd8c1140ad0e036104735fb4cbebef3","build_hash_enterprise":"b544b15ccc487c8b438c786f6f54847071786920"}
{"level":"info","ts":1595340224.166563,"caller":"app/server.go:282","msg":"Enterprise Build","enterprise_build":true}
{"level":"info","ts":1595340224.166597,"caller":"app/server.go:288","msg":"Printing current working","directory":"/var/lib/mattermost"}
{"level":"info","ts":1595340224.166621,"caller":"app/server.go:289","msg":"Loaded config","source":"file:///var/lib/mattermost/config/config.json"}
{"level":"info","ts":1595340224.1809533,"caller":"sqlstore/post_store.go:1571","msg":"Post.Message has size restrictions","max_characters":16383,"max_bytes":65535}
{"level":"info","ts":1595340224.2319896,"caller":"bleveengine/bleve.go:267","msg":"UpdateConf Bleve"}
{"level":"info","ts":1595340224.23319,"caller":"app/license.go:40","msg":"License key from https://mattermost.com required to unlock enterprise features."}
{"level":"info","ts":1595340224.2458985,"caller":"app/export.go:57","msg":"Bulk export: exporting version"}
{"level":"info","ts":1595340224.2464123,"caller":"app/export.go:62","msg":"Bulk export: exporting teams"}
{"level":"info","ts":1595340224.249107,"caller":"app/export.go:67","msg":"Bulk export: exporting channels"}
{"level":"info","ts":1595340224.2530622,"caller":"app/export.go:72","msg":"Bulk export: exporting users"}
{"level":"info","ts":1595340224.3575327,"caller":"app/export.go:77","msg":"Bulk export: exporting posts"}
{"level":"info","ts":1595340294.3842757,"caller":"app/export.go:82","msg":"Bulk export: exporting emoji"}
BulkExport: Unable to copy custom emoji images, err=Error reading data/emoji/yneq4mm4ctn5f8e773646fa8za/imagefile
{"level":"info","ts":1595340294.4187405,"caller":"app/server.go:416","msg":"Stopping Server..."}
{"level":"info","ts":1595340294.4188159,"caller":"app/web_hub.go:130","msg":"stopping websocket hub connections"}
{"level":"info","ts":1595340294.4196887,"caller":"app/plugin.go:279","msg":"Shutting down plugins"}
{"level":"info","ts":1595340294.4263282,"caller":"app/server.go:469","msg":"Server stopped"}
Error: BulkExport: Unable to copy custom emoji images, err=Error reading data/emoji/yneq4mm4ctn5f8e773646fa8za/imagefile
Usage:
  mattermost export bulk [file] [flags]

Examples:
export bulk bulk_data.json

Flags:
      --all-teams Export all teams from the server. (default true)
  -h, --help help for bulk

Global Flags:
  -c, --config string Configuration file to use. (default "config.json")
      --disableconfigwatch When set config.json will not be loaded from disk when the file is changed.

```

As far as I can tell, this is caused by having my files directory outside of the mattermost installation directory:

```auto
mattermost@hostname:/var/lib/mattermost$ ./bin/mattermost config get FileSettings.Directory
FileSettings.Directory: "/srv/files-mattermost/data/"

```

If I create a symlink at `/var/lib/mattermost/data` pointing to `/srv/files-mattermost/data`, it fixes the issue. Is this expected behavior, or should I create an issue on GitHub?

---

<div class="post-metadata">

**Author:** ![ahmaddanial](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/ahmaddanial/32/2938_2.png) [@ahmaddanial](https://forum.mattermost.com/u/ahmaddanial)\
**Post date:** [July 22, 2020, 2:40am UTC](https://forum.mattermost.com/t/filesettings-directory-not-respected-by-bulk-export-tool/10146/2 "2020-07-22T02:40:28Z")

</div>

Hello, @willg101

Thanks for sharing. I am confirming this with the team if the behavior is expected for directory configuration outside of the default Mattermost installation directory.

```auto
Error: BulkExport: Unable to copy custom emoji images, err=Error reading data/emoji/yneq4mm4ctn5f8e773646fa8za/imagefile

```

Stay tuned for now. Thanks.

---

<div class="post-metadata">

**Author:** ![amy.blais](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/amy.blais/32/7481_2.png) [@amy.blais](https://forum.mattermost.com/u/amy.blais)\
**Post date:** [July 22, 2020, 12:37pm UTC](https://forum.mattermost.com/t/filesettings-directory-not-respected-by-bulk-export-tool/10146/3 "2020-07-22T12:37:22Z")

</div>

Ticket: [https://mattermost.atlassian.net/browse/MM-27178](https://mattermost.atlassian.net/browse/MM-27178).
