Historical data dump from sqlite to mysql

I already know how to switch sqlite to mysql, but the problem I encountered was that sqlite access was very slow due to a large amount of data. I know that I can use Replicate.py for instance synchronization, but the old instance of sqlite is too slow. So I wonder if there is another way (without starting the old instance) to implement the historical data from sqlite to mysql, such as synchronizing the sqlite database to the mysql database without changing the dicom file directory (I tried and failed to start). log:Uncaught exception, stopping now: [Error with the database engine] (code 11))

Hello,

What about using the “Direct access to the filesystem” scenario that is documented in the Orthanc Book?

Regards,
Sébastien-

I don’t think this will work either, as the original file is quite large and is not kept on the server. I only have the files saved by the old SQLite instance, which are not DICOM files and are not supported by the ImportDicomFiles.py script. An error message appears: Importing D:\orthanc_sqlite\ff\cb\ffcb4793-0d33-47cc-ba8f-61bb117e682f => failure (Is it a DICOM file?) Is there a password?)

I think that what Sébastien means it that you can use direct access to the DICOM files on the filesystem, to import them in the new instance.

You can simply discard the older database and not deal with the SQLite file at all : the new Orthanc will reconstruct its database fully from the instances.

So you would :

  • locate the folders containing the instances in the old Orthanc
  • for instance, load them in memory and post them to the /instances endpoint

The only situation where this would be a problem is, for instance, if you have metadata (in the sense of the /metadata API) or labels that you would lose in this fashion, because some information would be lost in that case by discarding the older DB, for these metadata are not stored in the DICOM files.

If your DB is only an index on the DICOM files, forgetting about the old DB is the easiest solution.

HTH

Some files in the storage are not DICOM files. Plugins like the DICOMWeb plugin can also store json files there. Just ignore the error. Orthanc will accept only the DICOM files and rebuild everything it needs.