Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Backup/Restore is not system agnostic #237

Open
jingsno opened this issue Jul 23, 2023 · 3 comments
Open

[Bug]: Backup/Restore is not system agnostic #237

jingsno opened this issue Jul 23, 2023 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@jingsno
Copy link

jingsno commented Jul 23, 2023

Binner version

v2.6.0

Operating System

Windows -> Ubuntu

Describe the bug and the steps to reproduce it

The Backup/Restore function is not system agnostic. If I use a .bak backup file from a Windows install, and try to restore it on a Ubuntu install, the software states "Binner restored successfully!", but no data is restored correctly. (This is due to different filenames/paths between the versions, but if this is fixed, we might run into #236 aswell.)

If I check my Ubuntu install, I can see that the "Binner.bak" file is restored as "binner.db " (Note the extra space). The appsettings.json is restored correctly, but it contains references to "C:\Binner", specifically:

"Filename": "C:\\Binner\\binner.db",
"UserUploadedFilesPath": "C:\\Binner\\UserFiles"

When the Binner service is restartet on the Ubuntu install, it created the empty database FILE "C:\Binner\binner.db" and uses that instead of binner.db

It also creates a "C:\Binner\UserFiles" directory

The original appsettings.json had
"Filename": "./binner.db "
"UserUploadedFilesPath": "./UserFiles"

If I rename the "binner.db " (Note the extra space) file to the correct name "binner.db", and fix the appsettings.json paths while the service is stopped, the restore works, and the inventory is working/populated.

Would you like to attach your appsetings.json configuration?

No response

Screenshots or Videos (Optional, but they help!)

Screenshot 2023-07-23 133023

Are you able to contribute a PR? (No is ok!)

None

@jingsno jingsno added the bug Something isn't working label Jul 23, 2023
@jingsno
Copy link
Author

jingsno commented Jul 23, 2023

Note that in the screenshot above, the "binner.db " file with an empty space, is just observable on the bottom. (I uploaded the screenshot before I figured out what was actually happening)

@replaysMike replaysMike self-assigned this Jan 8, 2024
@replaysMike replaysMike added the in-progress This ticket is currently being worked on label Apr 8, 2024
@replaysMike replaysMike modified the milestones: v2.6.3, v2.6.2 Apr 8, 2024
@replaysMike
Copy link
Owner

got it - yes I don't think I accounted for doing a backup/restore across different operating systems. I'll rereview the current process and see if I can come up with a better way to handle it.

@replaysMike
Copy link
Owner

this is a little more tricky to accomplish, as the backup contains your settings file appsettings.json which is configured for Windows, however it's being restored on a Unix environment and isn't aware of that. It's simply going to overwrite the existing appsettings.json from the restore. It's also possible in this scenario that your Unix environment is configured for a different storage provider, and it can't restore the database to a different provider.

The quick fix would be to update the paths in the appsettings.json after restoring, but before restarting the service so they are correct when it starts up.

I think a longer term approach would be to export things to an intermediary format like CSV (how it used to work) but it gets complicated fast. I'll have to save something like this for a future major update, as there is no quick solution.

@replaysMike replaysMike removed the in-progress This ticket is currently being worked on label Apr 22, 2024
@replaysMike replaysMike modified the milestones: v2.6.3, v2.7.0 Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants