1

i have a corrupted Lightroom catalog file(.lrcat) which is a SQL database, which i usually repair by creating an SQL file using these commands:

echo .dump | sqlite3 CorruptedFile.lrcat > Temp.sql

From the SQL file i then rebuild the lrcat file with this command:

sqlite3 -init Temp.sql New.lrcat

In this case it loads the resources from the SQL file and after a while i get this message:

Error: incomplete SQL:  ■P

Since I am not a programmer, but a somewhat nerdy photographer I am stuck at this point. Any hints would be greatly appreciated.

Thanks, Holger

Nikonite
  • 13
  • 4
  • 2
    Even if the database is corrupted, `.dump` should never generate invalid SQL. Can you upload the file somewhere? – CL. May 02 '17 at 19:23
  • Hi CL. Thanks for the quick response. I can upload it to Dropbox and send you the link, if you want to look at it. – Nikonite May 02 '17 at 20:08
  • I'm more interested in the .sql file. (Are you using the latest version of the `sqlite3` tool?) – CL. May 02 '17 at 20:14
  • I'm using sqlite 3.10.2. I have compressed the sql file and am uploading to Dropbox now. Thanks again :) – Nikonite May 02 '17 at 20:27
  • Here is the file: https://www.dropbox.com/s/k8b1ntqyf0yy3hf/Temp.zip?dl=0 – Nikonite May 02 '17 at 20:32

1 Answers1

0
000000: FF FE 50 00 52 00 41 00 47 00 4D 00 41 00 20 00  ..P.R.A.G.M.A. .
000010: 66 00 6F 00 72 00 65 00 69 00 67 00 6E 00 5F 00  f.o.r.e.i.g.n._.
000020: 6B 00 65 00 79 00 73 00 3D 00 4F 00 46 00 46 00  k.e.y.s.=.O.F.F.
000030: 3B 00 0D 00 0A 00 42 00 45 00 47 00 49 00 4E 00  ;.....B.E.G.I.N.
000040: 20 00 54 00 52 00 41 00 4E 00 53 00 41 00 43 00   .T.R.A.N.S.A.C.
000050: 54 00 49 00 4F 00 4E 00 3B 00 0D 00 0A 00 43 00  T.I.O.N.;.....C.
000060: 52 00 45 00 41 00 54 00 45 00 20 00 54 00 41 00  R.E.A.T.E. .T.A.
...

This is not a plain text file; it is encoded in UTF-16. This might happen if you have modified the file in a misconfigured editor, or used PowerShell instead of cmd.exe.

Community
  • 1
  • 1
CL.
  • 173,858
  • 17
  • 217
  • 259
  • You are absolutely right. Since there last update Windows 10 right clicking in the explorer brings up the Powershell and not CMD anymore. Now it all worked out nicely. Thanks a lot for your help. I need to find a good book and out learn SQL properly so I don't ask any more stupid questions. – Nikonite May 03 '17 at 10:39