Reindexing of the SQlite files.

Hi everyone

In the event of a catastrophic failure with the SQlite index files, how can they be recreated? Has anyone from the community solved this problem?

Many greetings


I’m not speaking with any authority, but if you haven’t associated custom metadata with the DICOM files, could you not simply import the raw files to a new Orthanc instance? Unless I am missing something, Orthanc, stores the original files on disk (or in S3), and all the DICOM tag data is retained.

That said, I recommend using something like PostgreSQL for anything important, and to verify you back up your data frequently enough for a corruption/deletion to not be catastrophic.



Hi Nick

If the index files are lost or damaged due to a failure, access to the studies stored in Orthanc is lost, even though they are still located in the folders where they were originally stored. This is precisely the reason why I want to know how the studies can be reindexed with the SQlite so as not to lose access to that information.
I personally back up those files every day but would like to know how to “repair” them if necessary.

According to an answer I read in the forum some time ago, if I started using Orthanc with SQlite I can’t switch to PostgreSQL, unless I install a new Orthanc. If that is the case, it is not convenient for me to migrate the data so I would like to be prepared for a failure.




If the SQLite index is destroyed, you’ll have to re-import all the DICOM files that are stored in the “OrthancStorage” folder. The SQLite database is mainly just an index: All your DICOM files are still stored in the storage area.

This task can be automated by using the “” sample script that is available in the source distribution of Orthanc:

For more information:

As noticed in the page above, note that it is normal that only half the files are reported to have been properly imported, as Orthanc stores a JSON summary of the DICOM tags together with each DICOM instance in its database:

You should also read the following page of the Orthanc Book if you want to backup, or to migrate from SQLite to PostgreSQL (which is known as “replication”):


Hi Sebastien

Thank you very much for the response and for the information.

Many greetings