This document provides complete schema documentation for ibi device databases recovered from data recovery operations. This information enables others to create parsers, recovery tools, and analysis scripts for ibi data.
/restsdk/data/db/index.db
/restsdk/data/dbBackup/index.db
/restsdk-info/data/db/index.db
/restsdk/data/files/
├── a/ # Files with contentID starting with 'a'
│ ├── aB1C2D3E... # Actual file (contentID as filename)
│ └── aF4G5H6I...
├── b/ # Files with contentID starting with 'b'
├── ...
└── z/
/files/{contentID[0]}/{contentID}
jT9JduP8vIHpwuY32gLQ
→ /files/j/jT9JduP8vIHpwuY32gLQ
CREATE TABLE Files(
id TEXT NOT NULL PRIMARY KEY, -- Unique file identifier
parentID TEXT REFERENCES Files(id), -- Directory structure
contentID TEXT UNIQUE, -- Maps to physical file storage
version INTEGER NOT NULL, -- File version number
name TEXT NOT NULL, -- Original filename
birthTime INTEGER NOT NULL, -- Creation time (ms since epoch)
cTime INTEGER NOT NULL, -- Data creation time
uTime INTEGER, -- Update time
mTime INTEGER, -- Data modification time
size INTEGER NOT NULL DEFAULT 0, -- File size in bytes
mimeType TEXT NOT NULL DEFAULT '', -- MIME type
storageID TEXT NOT NULL, -- Storage backend ('local')
hidden INTEGER NOT NULL DEFAULT 1, -- Visibility flag
description TEXT NOT NULL DEFAULT '', -- User description
custom TEXT NOT NULL DEFAULT '', -- Internal hash/tracking
creatorEntityID TEXT REFERENCES Entities(id), -- User who created file
-- Image metadata
imageDate INTEGER, -- Image capture date (ms)
imageWidth INTEGER NOT NULL DEFAULT 0,
imageHeight INTEGER NOT NULL DEFAULT 0,
imageCameraMake TEXT NOT NULL DEFAULT '',
imageCameraModel TEXT NOT NULL DEFAULT '',
imageAperture REAL NOT NULL DEFAULT 0,
imageExposureTime REAL NOT NULL DEFAULT 0,
imageISOSpeed INTEGER NOT NULL DEFAULT 0,
imageFocalLength REAL NOT NULL DEFAULT 0,
imageFlashFired INTEGER,
imageOrientation INTEGER NOT NULL DEFAULT 0,
imageLatitude REAL, -- GPS coordinates
imageLongitude REAL,
imageAltitude REAL,
imageCity TEXT NOT NULL DEFAULT '', -- Location names
imageProvince TEXT NOT NULL DEFAULT '',
imageCountry TEXT NOT NULL DEFAULT '',
-- Video metadata
videoDate INTEGER, -- Video capture date (ms)
videoCodec TEXT NOT NULL DEFAULT '',
videoWidth INTEGER NOT NULL DEFAULT 0,
videoHeight INTEGER NOT NULL DEFAULT 0,
videoDuration REAL NOT NULL DEFAULT 0, -- Duration in seconds
videoOrientation INTEGER NOT NULL DEFAULT 0,
videoLatitude REAL, -- GPS coordinates
videoLongitude REAL,
videoAltitude REAL,
videoCity TEXT NOT NULL DEFAULT '', -- Location names
videoProvince TEXT NOT NULL DEFAULT '',
videoCountry TEXT NOT NULL DEFAULT '',
-- Audio metadata
audioDuration REAL NOT NULL DEFAULT 0,
audioTitle TEXT NOT NULL DEFAULT '',
audioAlbum TEXT NOT NULL DEFAULT '',
audioArtist TEXT NOT NULL DEFAULT '',
-- Additional fields...
category INTEGER, -- File categorization
month INTEGER NOT NULL DEFAULT 0, -- Time grouping
week INTEGER NOT NULL DEFAULT 0
);
CREATE TABLE FileGroups(
id TEXT NOT NULL PRIMARY KEY, -- Unique album identifier
name TEXT NOT NULL, -- Album name
previewFileID TEXT REFERENCES Files(id), -- Preview/cover image
cTime INTEGER NOT NULL, -- Creation time (ms)
mTime INTEGER, -- Modification time (ms)
description TEXT NOT NULL DEFAULT '', -- Album description
estCount INTEGER NOT NULL DEFAULT 0, -- Estimated file count
estMinTime INTEGER, -- Earliest content time
estMaxTime INTEGER, -- Latest content time
creatorEntityID TEXT REFERENCES Entities(id), -- Album creator
post INTEGER NOT NULL DEFAULT 0, -- Post/sharing flag
commentsCount INTEGER NOT NULL DEFAULT 0 -- Number of comments
);
CREATE TABLE FileGroupFiles(
id TEXT NOT NULL PRIMARY KEY, -- Unique relationship ID
fileID TEXT NOT NULL REFERENCES Files(id), -- File reference
fileGroupID TEXT NOT NULL REFERENCES FileGroups(id), -- Album reference
fileCTime INTEGER NOT NULL, -- File creation time for sorting
cTime INTEGER NOT NULL, -- Relationship creation time
changeID INTEGER NOT NULL DEFAULT 0, -- Change tracking
creatorEntityID TEXT REFERENCES Entities(id), -- Who added file to album
commentsCount INTEGER NOT NULL DEFAULT 0 -- Comments on this relationship
);
CREATE TABLE FilesTags(
fileID TEXT NOT NULL REFERENCES Files(id), -- File reference
tag TEXT NOT NULL, -- Content tag (e.g., "person", "beach")
auto INTEGER NOT NULL -- 1 = AI-generated, 0 = manual
);
CREATE TABLE Entities(
id TEXT NOT NULL PRIMARY KEY, -- Internal entity ID
extID TEXT NOT NULL, -- External ID (auth0, device UUID)
type INTEGER NOT NULL, -- 1=user, 2=device, 4=other
rootID TEXT REFERENCES Files(id), -- Root directory
cTime INTEGER NOT NULL, -- Creation time
version INTEGER NOT NULL, -- Version number
timeZoneName TEXT NOT NULL DEFAULT '', -- IANA timezone (e.g., "America/Los_Angeles")
lang TEXT NOT NULL DEFAULT '' -- Language code (e.g., "en-US")
);
SELECT f.id, f.name, f.contentID, f.mimeType, f.size,
f.imageDate, f.videoDate, f.cTime
FROM Files f
WHERE f.contentID IS NOT NULL AND f.contentID != ''
ORDER BY COALESCE(f.videoDate, f.imageDate, f.cTime);
SELECT f.name, ft.tag
FROM Files f
JOIN FilesTags ft ON f.id = ft.fileID
WHERE ft.auto = 1
ORDER BY f.name, ft.tag;
SELECT fg.name AS album_name, f.name AS filename
FROM FileGroups fg
JOIN FileGroupFiles fgf ON fg.id = fgf.fileGroupID
JOIN Files f ON fgf.fileID = f.id
ORDER BY fg.name, fgf.fileCTime;
SELECT f.name, f.imageLatitude, f.imageLongitude,
f.imageCity, f.imageCountry
FROM Files f
WHERE f.imageLatitude IS NOT NULL
AND f.imageLongitude IS NOT NULL;
/restsdk/data/db/index.db
contentID
to locate physical files/files/{contentID[0]}/{contentID}
This schema documentation is based on analysis of recovered ibi databases with the following identified characteristics:
Note: This represents ibi software that was in use during 2017-2023 with database schema version 166. Different ibi versions may have different schemas, but this documentation covers the format found in typical consumer ibi devices from this era.
Core tables: Files
, FileGroups
, FileGroupFiles
, FilesTags
, Entities
Supporting tables: CategoriesStats
, Changes
, Comments
, DevicePerms
, ExtraContents
, FilesKeywords
, Filesystems
, Info
, MediaTimeGroups
, Reactions
, Settings
, SharedFiles
, Volumes
ibi-specific: CloudFilesystems
, CloudFilesystemFiles
, DeletedContent
, FilePerms
, FileGroupPerms
, ResumableFiles
, PendingFilePermUpdates
Search/indexing: FilesFTS
, FilesFTS_*
(Full-text search tables)
This schema documentation is released under CC0 (Public Domain) to benefit the data recovery community. Use freely for:
If you discover additional schema details, variations, or corrections, please contribute back to help others in the data recovery community.