waistline icon indicating copy to clipboard operation
waistline copied to clipboard

Database import failed

Open ghost opened this issue 1 year ago • 5 comments

I want to delete (not archive) some foods. I changed their name to DELETE and exported the database. I edited the exported database and removed the entries with "name":"DELETE" and the rest of that stuff that follows for that entry. But when I import that edited database I get: Import failed

ghost avatar Mar 14 '23 12:03 ghost

Are those items referenced anywhere else, in the diary for example?

davidhealey avatar Mar 14 '23 12:03 davidhealey

Yes, but that's why I edited the exported diary file too and delete them in there, but I can not import the edited diary file again.

ghost avatar Mar 14 '23 12:03 ghost

The most likely reason why you cannot import the backup file is because you made a mistake when editing it. You can paste the content of the file into an online json validator to check if it's still syntactically correct.

EmilJunker avatar Mar 14 '23 14:03 EmilJunker

I'm not confusing anything, how do you come to this? In Issue 705 @davidhealey suggested that I should try importing the diary file as a database file. I know what I'm doing!

ghost avatar Mar 14 '23 17:03 ghost

But you said that the diary export is not useful for humans because it only contains IDs. That's not true, so I assumed you were talking about the other file.

Anyway, the point is: If you make edits to the json file, you have to be careful not to mess up the syntax. Otherwise you won't be able to import the file again - which is exactly the issue you are having (i.e. the original topic of this issue).

EmilJunker avatar Mar 14 '23 18:03 EmilJunker