Sailfish OS has a worker called Tracker. Tracker harvests all media/document folders in Sailfish device and in the memory card (if any), creating a registry of files found. We call this registry by the name of the media database in this article.
Sailfish media database contains the locations of music files, pictures, videos and documents.
The Tracker starts reindexing your files right after resetting the database below in chapter #1 or #2. After a few minutes, apps like Gallery and Media should show the found media contents again.
1. Sailfish Utilities - the recommended way
It may happen that the database gets corrupted. Then it is possible to refresh it by using Sailfish Utilities. The device should be restarted after this. It may take a couple of minutes before Tracker has re-created the database.
2. Command line
Should the database be badly corrupted then it may be necessary to go to the command line (Terminal app) and reset the database there. Guidance for Developer mode. Note that those commands do not erase any media files - they only clear the registry.
a) Sailfish OS releases 4.2.0 and earlier
Type the following command to run a soft reset:
tracker reset -e
This command executes a hard reset:
tracker reset -r
-r, --hard: Kill all Tracker processes and remove all databases
-e, --soft: Same as --hard but the backup & journal are restored after restart
b) Sailfish OS releases 4.3.0 and later
On Sailfish OS release 4.3.0, we upgraded the Tracker too to version 3. This changed the commands, too.
Type the following command to delete the filesystem indexer database:
tracker3 reset -s
3. Printout examples
a) On 4.1.0:
[nemo@sony ~]$ tracker reset -e
CAUTION: This process may irreversibly delete data.
Although most content indexed by Tracker can be safely reindexed, it can't be assured that this is the case for all data. Be aware that you may be incurring in a data loss situation,
proceed at your own risk. Are you sure you want to proceed? [y|N]: y
Found 4 PIDs?
Killed process 15410 ? ?tracker-miner-fs?
Killed process 15411 ? ?tracker-extract?
Killed process 15412 ? ?tracker-store?
Killed process 22142 ? ?tracker?
Setting database locations
Checking database directories exist
Checking database version
Checking database files exist
Removing all database/storage files
Removing first index file:'/home/nemo/.cache/tracker/first-index.txt'
Removing last crawl file:'/home/nemo/.cache/tracker/last-crawl.txt'
Removing db-locale file:'/home/nemo/.cache/tracker/db-locale.txt'
b) On 4.3.0:
[defaultuser@XperiaXA2-DualSIM ~]$ tracker3 reset -s
Found 1 PID…
Killed process 6240 — “tracker-miner-fs-3”