# Box
# Box App Authentication Configuration
- In an Box enterprise environment create a Box Account. It is prefered that it has Admin role for configuration simplicity.
- Register the account as a developer in the Box Developer Console. https://developer.box.com/
- Access the Box Developer Console in https://app.box.com/developers/console
- Create new app in Box Developer Console
- Select "Custom App"
- Enter a name for the app, fill the form and click next. In the "Authentication Method" select "Server Authentication (Client Credentials Grant)"
- Inside the app, go to "Configuration" tab and in "App Access Level", select "App + Enterprise Access"
- In "Application Scopes" select "Real all files and folders stored in Box" and "Write all files and folders stores in Box"
- In "OAuth 2.0 Credentials" click the button "Fetch Client Secret". If it asks for 2 factor authentication, activate it in the logged user's "Account settings/2-Step Verification"
- An Admin user must authorize and enable this created app. This is done in the "Admin Console / Apps / Custom Apps Manager" select the app and authorize and enable. Admin console: https://app.box.com/master
- Using an Admin account in "Developer Console App / General Settings", there is a section "Service Account Info" with the service account email generated for this app. For example, AutomationUser_2225597_3aae3uI18Y@boxdevedition.com. Testing connection in Site Provisioning Box plugin will also show this email if the connection is established.
- In Developer Console get the "General Settings / Enterprise ID" (Only Admin user has access, otherwise it shows 0). Get "Configuration / OAuth 2.0 Credentials" "Client ID" and "Client Secret" to save in Epona's Box plugin settings.
- Add App user to the Collaborators list with "Editor" role in the folders of the root folder in the web app. You cannot add it directly to the root, so it is required to add to each folder / file in the root.
- In Admin Console, add App User to each of the existing Groups (https://app.box.com/master/groups) with "Admin" role.
# Box Migration Plugin Configuration
Copy the Files from the \Plugins\Migrate\Box directory.
This plugin uses Newtonsoft.json library in version 13.0.3 as a minimum requirement of the Box .NET SDK used to access Box API.
Epona.Migrate.exe project uses Newtonsoft.json library in version 11.0.1 due to other dependencies.
With this discrepancy, the Epona.Migrate.exe.config needs to have a runtime config for library compatibility:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
...
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="11.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Start the migrate tool, a new tab is visible. Click on ... button to create or edit a Box configuration. The configuration is stored in the \Config\Box directory.
- Debug
True to show more data in logs
- Name
Config Name
- ClientId
Client id from Developer Console / Created App / Configuration / OAuth 2.0 Credentials / Client ID
- ClientSecretKey
Client secret from Developer Console / Created App / Configuration / OAuth 2.0 Credentials / Client Secret
- EnterpriseId
Has an Admin User get the Enterprise ID from Developer Console / Created App / General Settings / Enterprise ID
- ClientMatterSeparator
Optionally specify a character to specify the combination of a clientcode and mattercode. To be used when specifying one or matters as a source when starting the migration.
- CombineClientAndMatterCodeToMatterCode
If a character is specified the clientcode and mattercode are merge to a single mattercode using this character when searching for the matter in SharePoint. The combined value should exist as a mattercode in SharePoint.
- CreateEmptyDirectories
True to create directories from Box in SharePoint that are empty or False to don't create those folders.
- DumpCollaborations
Only for Dump. Sets to load folder and files collaborations.
- DumpMaxChildFolderDepth
Only for Dump. Sets the maximum of child folder depth to retrieve from the folder structure.
- ImportOnlyLatestVersion
True to import only the latest version (current version) of files or False to import all versions of files.
- ReplaceFolders
Mappings to replace folder name as <folderName>=<NewFolderName>
- TargetFolders
- ReplaceUserNames
Mappings to replace user name as <userName>=<NewUserName>
# Box Migration Plugin Configuration Testing
- Developer Token
Can be used for login testing, not suitable for migration or dump since it has only 1 hour before expiring and does not have access to all API endpoints. Get from Developer Console / Created App / Configuration / Developer Token / Generate Developer Token
- FoldersMaxLimit
Keep this parameter empty for import and dump everything from Box. This option is set with a number of max child folders to get in import and dump, just to test the connection and see if everything is working for a small number of folders.
- UseDeveloperToken
True to activate Developer Token login or False to use Client Credential Grant Authenthication
# Migration
The main textarea of the plugin lets you define the mattercode mappings: <folder_id>=<targetmattercode>
Client id and new target folder are optional.
Using client id and new target folder: <client_id>.<folder_id>=<targetmattercode>\<newtargetfolder>
# Dump Content
Dump will generate an excel file with the full folder structure from Box.
In the main textarea of the plugin you can define mappings that will be parsed and mapped in excel columns: <folder_id>=<targetmattercode>
Client id and new target folder are optional.
Using client id and new target folder: <client_id>.<folder_id>=<targetmattercode>\<newtargetfolder>
You can also dump certain folders and its children by folder Id. In the main textarea of the plugin you can define the folder Id's that will be loaded. Put one Id per line or separate by semicolon. Exmaple: <folder_id>;<folder_id>;<folder_id> 12345;65432;645125