lute-v3 icon indicating copy to clipboard operation
lute-v3 copied to clipboard

Change Default Backup and User Data Directory to Enhance Data Portability and Reliability (Windows OS)

Open voothi opened this issue 8 months ago • 2 comments

Description

Hello.

Question of portability and reliability of storing user data.

Currently, initialization of Lute v3 and backup, by default, in the Windows system occurs in the directory C:\Users\%username%\AppData\Local\Lute3

Every time I start Lute, I see a line on the main screen containing this path in its part: Backup created: C:\Users\%username%\AppData\Local\Lute3\Lute3\backups\lute_backup_2025-03-13_082714.db.gz

As a Windows system administrator, I believe that storing configurations and backups in the user profile directory C:\Users\username\AppData\Local\ is not a correct solution due to the fact that the logic of system software does not assume that valuable user data is normally stored there. For example, so-called roaming Windows profiles do not capture this area and do not transfer this data. Or, in the case of a Windows recovery, the data in this directory is not saved. This is how I lost my previous version of data. I had to recover, but the backup of this directory was not performed. Usually, executable files of application distributions are stored in this directory. And the data of these specific user applications is stored in a portable directory, next to it, by the path C:\Users\%username%\AppData\Roaming\

For example, the GoldenDict-ng application stores user data at C:\Users\%username%\AppData\Roaming\GoldenDict\, not at ...\AppData\Local\GoldenDict\. In ...\AppData\Local\..., GoldenDict-ng stores data, but it does not provide any value to the user experience.

A partial solution could be changing the default backup export directory from C:\Users\%username%\AppData\Local\Lute3\Lute3\backups to C:\Users\%username%\AppData\Roaming\Lute3\Lute3\backups, in order to protect the user from data loss by default.

To Reproduce

Look above.

Screenshots

Image Image

Extra software info, if not already included in the Description:

  • OS (e.g., iOS, windows): Windows 11. Local: UTF-8 (systemwide).
  • Browser (e.g., chrome, safari): Version 133.0.6943.142 (Official Build) (64-bit)
  • How you've installed Lute (Docker, python, source) Python 3.12. Installed with venv.
  • Version: Starting Lute version 3.10.1.

voothi avatar Mar 13 '25 08:03 voothi

Hi @voothi - sorry for not responding earlier! Thanks for your thoughts.

Lute uses python package, platformdirs to determine the best-guess location where user data should be stored. I'm not a Windows user, and so I had to rely on that library to do the best guess for me ... but I appreciate your expertise here. I honestly have no idea how to tackle this intelligently for all platforms.

jzohrab avatar Mar 28 '25 02:03 jzohrab

Marked as "question" because -- well, I'm not sure where to begin with this. platformdirs seems like a reasonable approach to me, but I know I'm not up to speed on all of the problems. Maybe Anki's source code will have a better suggestion as to how to approach this.

jzohrab avatar Mar 28 '25 02:03 jzohrab