Kodi Community Forum
Solved : Solution to the closed Android Data folder on Android devices! - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Android (https://forum.kodi.tv/forumdisplay.php?fid=164)
+---- Thread: Solved : Solution to the closed Android Data folder on Android devices! (/showthread.php?tid=379387)

Pages: 1 2


Solved : Solution to the closed Android Data folder on Android devices! - Macaroni Slick - 2024-11-09

Henceforth, this shall be called:
The Diamond/Slick Solution.
So let it be written
So let it be done:

### Step-by-Step Guide: Moving Kodi to a New Location on Android 10+

#### Explanation 
Starting with Android 10, the Android/data folder where Kodi typically stores its data is restricted. This guide will help you change Kodi’s data location to a more accessible folder: /storage/emulated/0/Kodi/.

---

#### Step 1: Create the New Kodi Data Folder
1. Open a file manager app on your device.
2. Navigate to Internal Storage (or /storage/emulated/0/).
3. Create a new folder named Kodi.

---

#### Step 2: Set Up the xbmc_env.properties File
1. In Internal Storage (the main storage directory), create a new file named:

   xbmc_env.properties   
2. Open the file and add the following line:
 
   xbmc.data=/storage/emulated/0/Kodi/   
3. Save and close the file.

> Note: This file tells Kodi to use /storage/emulated/0/Kodi/ as its new data location, instead of Android/data.

---

#### Step 3: Launch Kodi to Initialize the New Folder
1. Open Kodi to allow it to create the necessary subfolders in the new location (/storage/emulated/0/Kodi/).
2. Close Kodi. This will create the default subfolders in the new data directory.

---

#### Step 4: Open Kodi and Confirm the Setup
1. Restart Kodi. It should now use the data from the new location.
  

### Summary 
- New Folder: Kodi is now set to use /storage/emulated/0/Kodi/ as its new data directory,

At this point you are done you now have a fresh install of Kodi in a unrestricted location of Android, you can now install your build and our add-ons as you would any normal install of Kodi,



-------

Step 5 below is for advanced users, if you wish to transfer some add-ons and are any files from the old location to the new location step 5 will allow you to do that, but if you don't know what you're doing you're going to run into Old path to New path issues and dependencies issues if you don't know what files to transfer, so I recommend guest proceeding as you would with a normal kodi install, Do Not Do Step 5 unless you fully understand what you are doing and absolutely need to do that, step 5 is offered for advanced users that understand kodi directory structure and associated add-on-dependencies, you have been warned.

-

#### Step 5: optional Transfer of Existing Data from old location   to New location (Optional) 

> Step 5 Important Note: Manually moving files from Old Kodi Data to New Kodi Data may not fully work, as some settings or add-ons may still reference the original Android/data path.

Data Transfer: Use Kodi’s File Manager in split view to copy files from Old Kodi Data (left) to New Kodi Data (right).


1. Open Kodi and go to Settings > File Manager.
2. In File Manager, add the old and new data locations as sources:
   - Old Kodi Data: Select Add Source and enter this path: 
   
     special://home/     

     Name this source Old Kodi Data.
   - New Kodi Data: Add another source with the path: 
   
     /storage/emulated/0/Kodi/     
     Name this source New Kodi Data.

3. Once both sources are added, Kodi’s File Manager will display them in a split view:
   - Left Side: Select Old Kodi Data to view your original Kodi data.
   - Right Side: Select New Kodi Data as the location for the transferred files.

4. Transfer the Files:
   - On the left side (Old Kodi Data), select the folders and files you want to move.
   - Use Kodi’s context menu (press and hold or right-click on the files) and select Copy.
   - Move to the right side (New Kodi Data) and paste the files.


RE: Solved : Solution to the closed Android Data folder on Android devices! - izprtxqkft - 2024-11-09

(2024-11-09, 17:24)Macaroni Slick Wrote: Data Transfer: Use Kodi’s File Manager in split view to copy files from Old Kodi Data (left) to New Kodi Data (right).

if transferring existing Kodi then you need to do this before you install xbmc_env.properties otherwise special://home points to /storage/emulated/0/Kodi/

-----

on some boxes it may be easier to reference /storage/emulated/0/Kodi/ as /sdcard/Kodi/ instead


RE: Solved : Solution to the closed Android Data folder on Android devices! - izprtxqkft - 2024-11-09

(2024-11-09, 19:26)DiamondBuild Wrote: but there are going to be a few things that are using an absolute path and not a special path, for example the skin shortcut folder if you've done some custom images

key here, "unless YOU've done some custom"

kodi is designed to use special paths in order to be fully cross platform, if something is using absolute paths then it is already broken on all but 1 platform (the 1 it was written or customized on)


RE: Solved : Solution to the closed Android Data folder on Android devices! - DiamondBuild - 2024-11-09

(2024-11-09, 18:09)izprtxqkft Wrote:
(2024-11-09, 17:24)Macaroni Slick Wrote: Data Transfer: Use Kodi’s File Manager in split view to copy files from Old Kodi Data (left) to New Kodi Data (right).

if transferring existing Kodi then you need to do this before you install xbmc_env.properties otherwise special://home points to /storage/emulated/0/Kodi/

-----

on some boxes it may be easier to reference /storage/emulated/0/Kodi/ as /sdcard/Kodi/ instead

You're saying if you want to completely copy your kodi setup to the new location for the most part will will work, but there are going to be a few things that are using an absolute path and not a special path, for example the skin shortcut folder if you've done some custom images is probably going to use absolute path unless somebody user went in there and manually edited the XML for the special path, but for the most part yes it will work


RE: Solved : Solution to the closed Android Data folder on Android devices! - Macaroni Slick - 2024-11-09

If this solution can be made better, please, chime in!


RE: Solved : Solution to the closed Android Data folder on Android devices! - izprtxqkft - 2024-11-09

(2024-11-09, 19:26)DiamondBuild Wrote: You're saying if you want to completely copy your kodi setup to the new location for the most part will will work

yes it actually does work, despite being bad practice for people not ready to manually overcome any issues

i have been able to transfer between 4 different FireOS devices, a CoreELEC device and a Debian Linux device, the same Userdata folder

the issue is usually that users cannot manage to overcome issues when doing this so it is rightly frowned on by developers who don't want to have to intervene when users break things this way


RE: Solved : Solution to the closed Android Data folder on Android devices! - Macaroni Slick - 2024-11-10

i can see that, if kodi were to install out of the box to a kodi folder instead of the data folder...
now, theres a thought!!!


RE: Solved : Solution to the closed Android Data folder on Android devices! - DiamondBuild - 2024-11-11

Steps 1 - 4 Revised setup instructions 11/11/24


### Step-by-Step Guide: Moving Kodi to a New Location on Android 10+

Overview
Starting with Android 10, the Android/data folder where Kodi typically stores its data is restricted. This guide will help you change Kodi’s data location to a more accessible folder: /storage/emulated/0/Kodi/.

Note: If you have an existing Kodi setup with custom builds, add-ons, or settings, you can copy them to the new location in Step 5. This will let you keep your current setup, copy individual add-ons and files as needed, or start fresh. There’s no need to delete anything in the new location, as any files you transfer will replace existing ones if there are conflicts.

### Reminder
If Kodi is not installed, install it as usual. If it is installed, close Kodi before proceeding with the steps below.

---

### Step 1: Create the New Kodi Data Folder
1. Open a file manager app on your device.
2. Navigate to Internal Storage (usually displayed as /storage/emulated/0/).
3. Create a new folder named
```
Kodi
```


### Step 2: Set Up the xbmc_env.properties File
1. In Internal Storage (typically /storage/emulated/0/), create a new file named:

```
xbmc_env.properties
```

2. Open the file and add the following line:

```
xbmc.data=/storage/emulated/0/Kodi/
```

> Note: The exact path for your device’s internal storage can vary. You may use a file manager app to confirm the correct path. The location should be where your main folders (like Downloads, Documents, or Pictures) are stored. If you’re unsure, Kodi’s File Manager can also help confirm the path as mentioned in Step 5.

> Explanation: This file instructs Kodi to use /storage/emulated/0/Kodi/ (or your confirmed storage location) as its new data directory instead of the restricted Android/data folder.

3. Save and close the file.

---

### Step 3: Launch Kodi to Initialize the New Folder
1. Open Kodi to allow it to create necessary subfolders in the new location.
2. Close Kodi. This confirms that default subfolders are now available in /storage/emulated/0/Kodi/.

---

### Step 4: Open Kodi and Confirm the Setup
1. Restart Kodi. It should now use the data from the new location.

---

### Summary
- New Folder: Kodi is now set to use /storage/emulated/0/Kodi/ as its new data directory.

You now have a fresh install of Kodi in an unrestricted Android location. You can install builds and add-ons as you would with any standard Kodi installation.

---

Step 5 Revised setup instructions 11/11/24

### Step 5: Optional - Transfer Your Existing Data from the Old to the New Location

Purpose: This step allows you to transfer your current Kodi settings, skin, build, add-ons, or individual files from the old restricted folder to the new location, preserving your custom setup.

Important: Kodi uses "special paths" for compatibility across platforms, so in most cases, transferred files should work smoothly. Files in the new location that match those from the old location will be replaced during the transfer.

#### Instructions:
1. Temporarily Disable the New Data Path 
   To access the original Kodi setup for this transfer, rename the xbmc_env.properties file to temporarily disable it:
   - Change xbmc_env.properties to off-xbmc_env.properties.
   - Restart Kodi. This reverts it to the original location, allowing you to access and transfer files from the old setup.

2. Add the Data Locations in Kodi’s File Manager 
   - Open Kodi and go to Settings > File Manager.
   - Add both the old and new data locations as sources:
     - Old Kodi Data: Select Add Source and enter:
     
```
       special://home/
       ```

       Name this source Old Kodi Data.
     - New Kodi Data: Add another source. Manually enter the path as (same path used in Step 2):
     
```
       /storage/emulated/0/Kodi/
       ```

       Or, use the file browsing option to select the path directly. Name this source New Kodi Data.

3. View the Sources in Split View 
   Kodi’s File Manager will display both sources in split view:
   - Left Side: Select Old Kodi Data to view your original Kodi data.
   - Right Side: Select New Kodi Data as the destination for transferred files.

4. Transfer the Files 
   - On the left side (Old Kodi Data), select the folders and files you want to move.
   - Use Kodi’s context menu (press and hold or right-click) and select Copy.
   - Kodi will automatically copy the files from Old Kodi Data to New Kodi Data.

   > Tip: You can copy your entire setup or only specific add-ons and files. Files copied to the new location will replace existing ones with the same names. Kodi’s file system typically handles these transitions smoothly.

5. Close and Restart Kodi 
   - After the transfer, close Kodi completely to ensure all changes take effect.

6. Re-enable the New Data Path 
   - Rename off-xbmc_env.properties back to xbmc_env.properties to reactivate the new data location.
   - Restart Kodi once more to complete the process.

---

Once completed, your Kodi setup from the original location should now be ready to go in the new location. Enjoy your customized Kodi experience, now fully accessible without restrictions!


RE: Solved : Solution to the closed Android Data folder on Android devices! - jonathanwine1985 - 2024-11-12

Genius! Thanks to everyone that contributed to this workaround! Well deserved bit of gratitude!


RE: Solved : Solution to the closed Android Data folder on Android devices! - Macaroni Slick - 2024-11-28

Thanxeversomuch.
Countless hours were spent researching this until i cracked this sucker!
I enlisted Diamonds help and he laid out the instructional manual of this process better than i could have!
I believe i wept when i saw the clarity of his instruction.

I have great hopes for a new project, who knows what new trouble i can get in...

I hope this helps the community at large and opens the Android platform for access and development


RE: Solved : Solution to the closed Android Data folder on Android devices! - hdmkv - 2024-12-02

Thank you for this... tried all kinds of file manager apps to no avail.


RE: Solved : Solution to the closed Android Data folder on Android devices! - hdmkv - 2024-12-03

This is not working for me... tried it on my Hisense TV w/Google TV OS. Wouldn't let me create a Kodi folder in /storage/emulated/0/ (permission denied), so did so in /storage/emulated/0/Download instead. When I open Kodi, nothing, still same old set-up. How do I instruct Kodi to use /storage/emulated/0/Download/xbmc_env.properties?


RE: Solved : Solution to the closed Android Data folder on Android devices! - izprtxqkft - 2024-12-03

(2024-12-03, 03:39)hdmkv Wrote: How do I instruct Kodi to use /storage/emulated/0/Download/xbmc_env.properties?

you can't unless you compile it, it's hard coded into kodi's source code https://github.com/xbmc/xbmc/blob/master/tools/android/packaging/xbmc/src/XBMCProperties.java.in#L34


RE: Solved : Solution to the closed Android Data folder on Android devices! - izprtxqkft - 2024-12-03

(2024-12-03, 03:39)hdmkv Wrote: Wouldn't let me create a Kodi folder in /storage/emulated/0/ (permission denied)

i was just testing on my hisense, from adb i can access /sdcard/
 
Code:
hengshan:/sdcard $ mkdir Kodi
hengshan:/sdcard $ ls
Alarms  Android  Audiobooks  DCIM  Documents  Download  Kodi  Movies  Music  Notifications  Pictures  Podcasts  Recordings  Ringtones

how are you trying to do this?

if you can create the xbmc_env.properties on /sdcard then the contents of it can still make kodi go to /sdcard/Download/Kodi, it's just the properties file that must be in the /sdcard/ folder


RE: Solved : Solution to the closed Android Data folder on Android devices! - hdmkv - 2024-12-03

I tried using Xplore File Manager. Do you have instructions on how to adb into Hisense? Thanks.