keepcalculator

06 Numbers and Powers

Restore Accidentally Cleared Data on Kodi

Card No. 06·43125 · Updated · Standard formula, shown below

If you accidentally cleared Kodi’s database or library and lost your media entries, watch history, or add-on settings, you can restore them from a backup or by re-scanning your sources—but only if you had a backup or your media files are still on disk. This guide explains the exact recovery steps for each scenario, what you can and cannot recover, and how to prevent it from happening again.

What “Cleared Data” Actually Means in Kodi

Kodi stores your library (movies, TV shows, music), watch status, resume points, and add-on settings in a set of SQLite databases and JSON files inside its userdata folder. When you choose “Clear data” from the system settings, or when an add-on like a skin or a maintenance tool wipes the library, several things happen:

  • Video and music databases (MyVideos*.db, MyMusic*.db) are deleted, removing all library entries and watch history.
  • Add-on settings (addon_data folder) may be erased, resetting each add-on to defaults.
  • Thumbnails and cached artwork are removed, but this is cosmetic and rebuilds automatically.
  • Your media files themselves are never deleted—Kodi only removes its index of them.

So the first question to ask is: did you clear the library only, or the entire userdata folder? The recovery path differs.

Recovery Method 1: Restore from a Backup

If you used a backup add-on (like the official Kodi Backup or a third-party one) or manually copied the userdata folder before the accident, restoration is straightforward:

  1. Install the same backup add-on you used before (or navigate to your manual backup location).
  2. Run the restore function, pointing it to the backup file or folder.
  3. Restart Kodi. Your library, watch history, and settings should return exactly as they were at backup time.

If the backup is on a network drive or USB stick, copy it to a local folder first to avoid permission issues. Note that the backup must be from the same Kodi version or newer—restoring an older database into a newer Kodi can cause errors.

Recovery Method 2: Re-Scan Your Media Sources

If you have no backup but your media files are still on your hard drive or NAS, you can rebuild the library by re-adding your sources and scanning. This restores the entries but not your watch status or resume points.

  1. Go to Videos → Files → Add videos.
  2. Browse to the folder containing your movies or TV shows and select it.
  3. Choose the content type (Movies or TV Shows) and let Kodi scrape metadata from The Movie Database or TVDB.
  4. Repeat for each source you had. Music works the same way under the Music section.

This process can take a while for large libraries, and you’ll lose any custom artwork or manual metadata edits unless they were stored as .nfo files alongside the media.

Recovery Method 3: Reinstall Add-Ons and Reconfigure

If the cleared data included add-on settings, you’ll need to reinstall and reconfigure each add-on. This is tedious but often unavoidable without a backup. For popular add-ons, you can sometimes export settings to a file before clearing (if you had done so earlier), but after the fact, you’re starting fresh.

To reinstall:

  1. Go to Add-ons → Install from repository.
  2. Pick the add-on and install it.
  3. Open the add-on and enter your credentials or preferences again.

If you use a build or a wizard, re-running the build will restore the whole setup, but only if the build itself is still available.

Why You Can’t “Undo” a Clear in Kodi

Kodi has no built-in recycle bin or undo function. When you clear the library or userdata, the files are permanently deleted from the system (though on some operating systems, a file recovery tool might find them if you act quickly and the disk hasn’t been overwritten). This is why the only reliable recovery is a pre-existing backup.

One common misconception is that clearing the library also deletes your media files. It does not—your movies and music remain untouched on disk. Only Kodi’s index is gone.

How to Prevent Accidental Data Loss in the Future

The best fix is prevention. Set up an automatic backup schedule so you never lose more than a day’s changes:

  • Use the official Kodi Backup add-on and schedule daily or weekly backups to a network location.
  • Manually copy the userdata folder (found in %APPDATA%\Kodi on Windows, ~/.kodi on Linux, ~/Library/Application Support/Kodi on macOS) to an external drive.
  • Before clearing anything, export the library to .nfo files (Settings → Media → Export library). This preserves metadata and watch status in a form that can be re-imported.
  • Use a maintenance add-on that asks for confirmation before clearing, or disable the “Clear data” button in the skin if possible.

Frequently Asked Questions

Can I recover cleared Kodi data without a backup?

Only partially. You can re-scan your media to rebuild the library entries, but watch history, resume points, and add-on settings are gone unless you had exported them to .nfo files or a backup. There is no hidden trash in Kodi.

Does clearing Kodi data delete my movies and TV shows?

No. Kodi only removes its database entries and settings. Your actual media files on the hard drive, NAS, or external storage remain untouched. You just need to re-add the sources and scan again.

Where does Kodi store its database and settings?

In the userdata folder: %APPDATA%\Kodi on Windows, ~/.kodi on Linux, ~/Library/Application Support/Kodi on macOS, and /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi on Android. The video database is usually named MyVideos*.db inside the Database subfolder.

Will re-scanning my library restore my watched status?

No. Re-scanning creates fresh entries with no watch history. If you previously exported the library to .nfo files, you can re-import those to restore the status. Otherwise, you’ll have to mark items as watched manually.

Can I use file recovery software to get back Kodi’s deleted database?

Possibly, if you act immediately and the storage device is not heavily used. Tools like PhotoRec or Recuva can sometimes recover deleted .db files, but success is not guaranteed and depends on whether the disk sectors were overwritten. It’s worth trying if the data is critical, but a backup is far more reliable.

How do I back up Kodi automatically?

Install the Kodi Backup add-on from the official repository, go to its settings, choose a destination (local folder, network share, or cloud), and set a schedule (e.g., daily at 3 AM). The add-on will create a full backup of your userdata folder without needing to stop Kodi.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →