B4J Question IM Snippet Manager problem: Unable to restore database data

toby

Well-Known Member
Licensed User
Longtime User
I'm using version 2.3.0.

Steps to reproduce
1. Backup your database data by clicking Export and and name the backup file snippetBackup.db
2. Make some change, any change, to one of your snippets and save the change
3. Restore your backup data: Click Import and select snippetBackup.db file to import
4. Verify your change at step 2: It should be gone. It's not when I tried it.

Can @LucaMs or anyone else show me how to make it work, please?
 

LucaMs

Expert
Licensed User
Longtime User
I'm using version 2.3.0.

Steps to reproduce
1. Backup your database data by clicking Export and and name the backup file snippetBackup.db
2. Make some change, any change, to one of your snippets and save the change
3. Restore your backup data: Click Import and select snippetBackup.db file to import
4. Verify your change at step 2: It should be gone. It's not when I tried it.

Can @LucaMs or anyone else show me how to make it work, please?
I'll take a look at it shortly.


Note that the name is lmSnippetManager, L M, Luca Messina (although I absolutely don't know who he is ? ) and not I M.
(I typed its name wrong at the beginning, anyway, and it is still so; it should be lmSnippetSManager).
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
"Sorry I'm late" (it is also the title of an Italian film, with a good actor, much loved in Italy, who unfortunately died young; he deserves to be mentioned: Massimo Troisi).

The problem is due to the fact that the "dumping" of the tables, generated by an external tool, for which I don't have the source code, generates "strange" code. The generated text file contains replace statements for the newline characters, which are different between Java and Windows.

"Fixing" these text files isn't easy at all. At this point I have two alternatives:

  • implement only a real backup & restore, which was your request, that is only the copy of the db file in the backup phase and the replacement of the current file with the copy, in the restore phase;
  • or, if you want a real "Export & Import", write "by hand" the queries necessary to create the backup db file.

The second is better, because no data added after the backup date would be lost but obviously it is also the most demanding.
 
Upvote 0

toby

Well-Known Member
Licensed User
Longtime User
Keep it simple, mi amico, the B4X community needs you for a long time; I don't want you to overwork like Massimo Troisi. The first option is good enough for me.

I'm doing manual backups and restores as follow
1. Backup: save a copy of the current snippets.db to somewhere else
2. Restore: Replace the current snippets.db with the desired backup file.
3. Restart lmSnippetManager

What I would like to get from you is: when Import (or restore) button is pressed, above step 2 and 3 will be done automatically.

Ciao
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
I replaced the whole "Import & Export" part.

I uploaded right now the new version (3.0.0) to my Google Drive but I don't know if this will cause the notification to be sent to you automatically or I will have to manually send it :confused: to the many hundreds of members ? who have requested this wonderful tool ?

Let me know.
 
Upvote 0
Top