Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
Foundry Virtual Tabletop
Foundry Virtual Tabletop
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 577
    • Issues 577
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 0
    • Merge Requests 0
  • Requirements
    • Requirements
    • List
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Foundry Network
  • Foundry Virtual TabletopFoundry Virtual Tabletop
  • Issues
  • #1672

Closed
Open
Opened Nov 16, 2019 by Andrew@aaclaytonOwner

Provide a way to configure an alternative user data directory for the application other than the default appdata location

The user data path used by Foundry VTT must be outside the Application directory. There are four ways that the user data location can be set.

  1. Command Line Flag
  2. Environment Variable
  3. Config Data Override
  4. Default Application Data Location

These options are evaluated in the above order, so if multiple options are set, the first valid option will be used.

Command Line Flag

The application now supports a command line flag --dataPath=<path> which designates a custom user data directory.

Node.js

node main.js --world=worldName --dataPath=/local/data/foundryvtt

Electron (Windows)

FoundryVTT.exe --world=worldName --dataPath=D:/FoundryVTT

Electron (Linux)

foundryvtt --world=worldName --dataPath=/local/data/foundryvtt

Environment Variable

Instead of passing a custom path every time when starting the application you can set the FOUNDRY_VTT_DATA_PATH environment variable which will be used instead (if a command line flag is not passed).

Example (Linux)

export FOUNDRY_VTT_DATA_PATH=/local/data/foundryvtt
foundryvtt --world=worldName

Example (Windows)

setx FOUNDRY_VTT_DATA_PATH "%USERPROFILE%\aws\cert.pem"
FoundryVTT.exe --world=worldName

Config Data Override

A last option which is supported is to redirect the data location in the options.json file inside the default application data location. For example, setting the following would redirect the application to use an alternative user data path.

"dataPath": "D:/FoundryVTT"

Hotfix for 0.4.0 Testing

Use the attached file main.js to replace the file with the same name in resources/app/main.js. This new entry point for the application will allow each of the above options to be used to configure the user data path.

main.js

Test Cases

  1. Provided CLI argument
  2. Provided ENV variable
  3. Provided config options override
  4. Provided nothing
  5. CLI + other option - prefers CLI
  6. ENV + config - prefers ENV
  7. Target a directory where the parent path does not exist raises error
  8. Target the application installation directory fails
Edited Nov 16, 2019 by Andrew
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Beta 0.4.1
Milestone
Beta 0.4.1 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: foundrynet/foundryvtt#1672