SNAP removed Ubuntu's snap directories, rollback possible?

Hi,

I just installed SNAP from ESA taking care to set the install dir to another location than the ubuntu’s /home//snap.

However, after the install I loose part of my ubuntu snap applications (including my zotero bibliography with my notes, which contains days of work, not synchronized of course…).

By inspecting the installation logs I found this part:

[INFO] com.install4j.runtime.beans.actions.files.DeleteFileAction [ID 3549]: Execute action
   Property directoryFilter: null
   Property fileFilter: null
   Property files: [/home/mercier/snap]
   Property filesRoot: null
   Property backupForRollback: true
   Property recursive: true
   Property rollbackSupported: true
   Property showFileNames: true
   Property showProgress: false
   Backing up /home/mercier/snap/keepassxc/common/org.keepassxc.KeePassXC.BrowserServer
   Backing up /home/mercier/snap/keepassxc/common/.cache/keepassxc/keepassxc.ini
...

so it looks like my ubuntu snap was deleted, but there is this line “Property backupForRollback: true” and the following lines “Backing up…” for every files in the directory.

Is there a way to rollback the installation and recover my files?

I think this is not possible. Rollback here means, that in case of an error the installation can be rolled back. But since it succeeded, I think it is not possible to get it back.

Maybe you are lucky and they are still in a temp directory.
Check the installation.log file you have already found and look for the property exe4j.tempDir.
Maybe in the specified directory you can still find the data.

Thank you very much for the answer.

No luck, there is no exe4j.tempDir property in the installation.log.

I guess it’s time for me to learn how to create Ubuntu sandboxed snap packages, so that this kind of software behavior never happens again.

You shouldn’t use the application data directory for your important personal data. This directory belongs to the application.

Actually now that I learn the hard way, snap is now the standard way to install applications in Ubuntu (at least for Ubuntu 20.04). The applications data directories are located in /snap/ (actually they are compressed filesystem contained in /var/lib/snap mounted in /snap). The directory ~/snap is meant to store personal data, it has several functions including data containment for each app and data snapshots (automatic during app upgrade, can be manual too, now I know).

This problem is likely to be reproduced for all future Ubuntu users.