Logic Machine Forum
Reloading a database - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: General (https://forum.logicmachine.net/forumdisplay.php?fid=2)
+--- Thread: Reloading a database (/showthread.php?tid=1161)



Reloading a database - Mackiovello - 30.12.2017

I'm trying to unload, modify, and reload the database. These are the step I'm taking, and it's not working:

Setup 

1. Download and install DB Browser for SQLite
2. Download and install PeaZip

Steps

1. Unload the database on the Logic Machine by going to "Utilities" and click "Backup". This will download a tar.gz file with all the required files.
2. Right-click on the downloaded file and choose `PeaZip -> Extract here`, this will create a tar file with the same name
3. Right-click on the tar file and choose `PeaZip -> Extract here`, that will extract all the files to the directory, such as `current.db` and the `icons` directory
4. Open DB Browser for SQLite
5. Click `Open Database` and choose the extracted `current.db` file
6. Change the data you want to change
7. Click `Write Changes` to persist the changes in the database
8. Go to `http://onlinemd5.com/`
9. Click `Choose File` and select `current.db`
10. Copy the file checksum
11. Open `current.md5` with Notepad or any other text editor
12. Change the existing checksum to the new checksum
13. Save and close `current.md5`
14. Select all the files that were extracted in step three, right-click, and choose `PeaZip -> Convert`
15. Select `GZip` as the output format and click `OK`
16. Go to the `Utilities` tab of the Logic Machine
17. Click `Restore` and select the tar.gz file created in step 15
18. See the message "Backup file is invalid"

Is there a step that's incorrect? What format should the file that you reload be in?


RE: Reloading a database - Erwin van der Zwart - 30.12.2017

Hi,

Why do you want to change the DB offline when you can run a script to modify the DB online..

BR,

Erwin


RE: Reloading a database - admin - 30.12.2017

Try using 7-Zip instead, you can also upload .tar instead of .tar.gz


RE: Reloading a database - Mackiovello - 30.12.2017

Quote:Why do you want to change the DB offline when you can run a script to modify the DB online..

A couple of reasons:

1. The application takes a bunch of input to determine how to alter the data, the input is easier to enter with a GUI

2. I can have tests and more controlled deployment

3. C# is more comfortable to code with

On the other hand, there are some drawbacks too: 

1. I have to deploy the application that alters the data separately, by running it is a script there's none of that since you can just copy paste the code

2. No need to unload etc. which makes it easier for the user

3. Easier to change since it doesn't require a separate environment

I'm not completely convinced that it's easier to do offline. How hard is it to alter the data with Lua? Is there a neat API? 

Quote:Try using 7-Zip instead, you can also upload .tar instead of .tar.gz
Thanks, I'll try that


RE: Reloading a database - Mackiovello - 31.12.2017

I've now also tried with 7Zip to compress to a tar file - same result.


RE: Reloading a database - Mackiovello - 03.01.2018

Are you also able to reproduce this behavior?


RE: Reloading a database - admin - 03.01.2018

Can you provide the archive that you have created?


RE: Reloading a database - Mackiovello - 04.01.2018

You can download it here: https://drive.google.com/file/d/1rysaMMGcStxdpYVS64r7Hie6LSyHZL44/view


RE: Reloading a database - admin - 05.01.2018

The archive is fine it's just that the validation procedure is quite strict. For now, if you have access to Linux you can run busybox gzip on your tar archive. We'll make the required changes in the upcoming firmware.


RE: Reloading a database - Mackiovello - 08.01.2018

Quote:We'll make the required changes in the upcoming firmware

Do you have an approximation of when the upcoming firmware is released?


RE: Reloading a database - admin - 09.01.2018

This month.