3

I want to backup my messages within KDE's Spacebar so that I may do a full system reinstallation. How can I backup my messages and restore them into a new installation?

1
  • I have no idea what Spacebar is, but I'm wondering WHY you want to do a full system reinstallation? Is there some problem with your current install? maybe it would be better to fix that instead? As for backups, start with backing up /home, /etc, and /usr/local with tar or rsync to a USB drive or another system. Maybe some of the directories under /var. and /opt too if you have any non-package programs installed there. Restoring /home and /usr/local and /opt should be straight-forward, but restoring /etc will probably require carefully choosing which config files to copy back to the new /etc. Commented Aug 10 at 11:23

1 Answer 1

5

Spacebar uses

QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + SL("/spacebar") 

as the location to store the database. (Note that this is not the right place to store mutable databases that are used by one application. It's still what Spacebar uses, so, well, we have to deal with the software that is, not with the software that should be.)

That translates to ~/.local/share/spacebar on your machine. Simply backing up and restoring that directory should do the trick – but usually, you just back up and restore your whole home directory (maybe with the exception of ~/.cache, which is generally disposable).

5
  • 1
    XDG Basedir Spec is somewhat ambiguous about the purpose of ~/.local/share beyond it being for "user-specific data". But I think there is universal agreement among developers that in absence of any better location (at least until the introduction of ~/.local/state which happened probably two decades after), if nothing else it has become de facto the right place to store mutable databases that are used by one application. (Which either way still matches /usr/share, which hier(7) describes as "subdirectories with specific application data".) Commented Aug 11 at 6:27
  • @grawity in fact, Qt5/6 documentation pretty explicitly states that GenericDataLocation is to be used for shared, permanent program data (e.g., icons), not databases. XDG is not that ambiguous (I don't disagree it is), but Qt and by extension KDE have pretty clear guidelines on that. Commented Aug 11 at 10:49
  • this does not seem to work—which is really weird because I definitely thought this was the answer. Commented Aug 18 at 8:51
  • Perhaps, in copying the files over the permissions were changed? What should the permissions be? Commented Aug 18 at 8:51
  • @newunix exactly the permissions of the original. When you do a backup / transfer of data to a new machine, you'd very much always make sure that's the case. Commented Aug 18 at 10:21

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.