Cloud sync all budgie-settings / backup & restore

Ubuntu Budgie settings backup - workflow logic and task breakdown

Workflow Logic

Backup

  1. Create backup directory ~/budgiebackup/. We will use this directory to store temporary files. Upon completion, we will create an archive and remove this temporary folder.
  2. Query installed budgie software, filter by “budgie applets” output list to file.This is needed to avoid issues when restoring budgie settings with dconf, as restoring an applet that is not installed will not give a desirable result.
  3. Query installed budgie themes, filter by “theme name”, and output list to file. This will be a specific query limited to only specific themes that are supported by ubuntu budgie team. Therefore themes available in the budgie-themes panel.
  4. Save budgie applet data, such as notes. Available in ~/.config/budgie-extras.
  5. Save plank launchers configuration. Available in ~/.config/plank.
  6. Save budgie settings by dumping dconf to file, filter by “/com/solus-project/”.
  7. Save plank docks settings by dumping dconf to file, filter by “/net/launchpad/plank/docks/”.
  8. Compress all files in the temporary folder “~/budgiebackup/” into a .tar.gz archive called “budgiebackup.tar.gz”.
  9. Delete temporary folder “~/budgiebackup/”.

Restore

  1. Decompress/extract tar archive “budgiebackup.tar.gz” to temporary location “~/budgiebackup/”.
  2. Install PPAs used by ubuntu budgie applets and themes.
  3. Grab previously installed budgie software from list (backup task 2), and issue install command.
  4. Grab previoulsy installed budgie themes from list (backup task 3), and issue install command.
  5. Restore budgie applet data, from backup archive (backup task 4) to ~/.config/budgie-extras.
  6. Restore plank configuration, from backup archive (backup task 5) to ~/.config/plank.
  7. Restore budgie settings using dconf, from file (backup task 6).
  8. Restore plank settings using dconf, from file (backup task 7).
  9. Delete temporary folder “~/budgiebackup/”

Task Breakdown - Backup

Backup Task 1.

mkdir ~/budgiebackup

Backup Task 2.

dpkg --get-selections \budgie*\*applet | awk '{print $1}' > ~/budgiebackup/budgiebackup-applets.txt

Backup Task 3

dpkg --get-selections ubuntu-budgie-themes | awk '{print $1}' >> ~/budgiebackup/budgiebackup-themes.txt
dpkg --get-selections ant-theme | awk '{print $1}' >> ~/budgiebackup/budgiebackup-themes.txt
dpkg --get-selections arc-theme | awk '{print $1}' >> ~/budgiebackup/budgiebackup-themes.txt
dpkg --get-selections evopop-gtk-theme | awk '{print $1}' >> ~/budgiebackup/budgiebackup-themes.txt
dpkg --get-selections adapta-gtk-theme | awk '{print $1}' >> ~/budgiebackup/budgiebackup-themes.txt
dpkg --get-selections materia-gtk-theme | awk '{print $1}' >> ~/budgiebackup/budgiebackup-themes.txt
dpkg --get-selections vimix-gtk-themes | awk '{print $1}' >> ~/budgiebackup/budgiebackup-themes.txt
dpkg --get-selections plata-theme | awk '{print $1}' >> ~/budgiebackup/budgiebackup-themes.txt
dpkg --get-selections pocillo-icon-theme | awk '{print $1}' >> ~/budgiebackup/budgiebackup-themes.txt

Backup Task 4

rsync -vah ~/.config/budgie-extras ~/budgiebackup/

Backup Task 5

rsync -vah ~/.config/plank ~/budgiebackup/

Backup Task 6

dconf dump /com/solus-project/ > ~/budgiebackup/budgie-dconf-dump

Backup Task 7

dconf dump /net/launchpad/plank/docks/ > ~/budgiebackup/plank-dconf-dump

Backup Task 8

cd ~/ ; tar -czvf budgiebackup.tar.gz budgiebackup/

Backup Task 9

rm -R ~/budgiebackup/

Task Breakdown - Restore

Restore Task 1

mkdir ~/budgiebackup/

Restore Task 2

cd ~/ ; tar -xzvf budgiebackup.tar.gz

Restore Task 3

sudo add-apt-repository -y ppa:ubuntubudgie/backports
sudo add-apt-repository -y ppa:tista/adapta
sudo add-apt-repository -y ppa:tista/plata-theme

Restore Task 4

sudo apt-get install $(awk '{print $1'} ~/budgiebackup/budgiebackup-applets.txt)

Restore Task 5

sudo apt-get install $(awk '{print $1'} ~/budgiebackup/budgiebackup-themes.txt)

Restore Task 6

rsync -vah --delete ~/budgiebackup/budgie-extras/ ~/.config/budgie-extras 

Restore Task 7

rsync -vah --delete ~/budgiebackup/plank/ ~/.config/plank

Restore Task 8

dconf load /com/solus-project/ < ~/budgiebackup/budgie-dconf-dump

Restore Task 9

dconf load /net/launchpad/plank/docks/ < ~/budgiebackup/plank-dconf-dump

I shared what I have done so far. I hope it helps

Thanks for the above - now that 19.10 is done and dusted I can concentrate on this. So cheers for all your efforts so far.

Some thoughts.

  1. We need to add in validation subtasks for each task identified.
  2. All the backup validation subtasks need to run and successfully pass before the actual “doing” task is performed.
  3. Likewise - 1 & 2 need to apply for the restore subtasks.
  4. I guess we need to save the distro version and maybe the machine the backup tasks are being run on. When restoring, it should warning the user that the distro/machine is different. Not a show-stopper as long as the restore validation subtasks are thorough enough to find potential issues.
  5. Restore task 3 - the principle is fine to restore the PPA’s - we obviously need to first backup the PPA’s in the backup task first.
  6. Obviously task 3 is a classic validation subtask - is the PPA still valid for the restore if the distro version has changed - sometimes the PPA does not contain packages/or the package has been removed from the distro series being restore to.
  7. I get the idea behind task 3 - think with a bit of magic pulling the “budgie themes” from https://github.com/UbuntuBudgie/budgie-welcome/blob/master/data/config/packages.json will automate this somewhat - themes can change per distro series.
  8. backup task 2 - guess anything starting “budgie” is a candidate here - that would cover all budgie related stuff on ubuntu
  9. think backup task 1 should be /tmp rather than the home folder - i.e. stage everything in /tmp and only after completing would you then move stuff from /tmp to somewhere safe.
  10. I’m intrigued in a straight dconf dump in task 6 is restorable on a different installation without issues - will need to test this scenario thoroughly.

So the initial types of validation subtasks I’m thinking of:

  1. Look at the current space - is there a suitable sized buffer to complete all the backup tasks
  2. Is the current package management ok, up-to-date without warnings/errors - need to run I guess sudo apt update && sudo apt upgrade -y and look to see if there are any warnings/errors in the output
  3. when restoring plank - shortcuts may/will no longer be valid on another machine - think we need to look through the plank shortcuts and report potential issues - not a show stopper by giving the user more feedback first if to proceed.
  4. Restore subtask - are the budgie package names saved in the backup still valid for the potential restore - different distro series argument above.
1 Like

Hello,

Thanks for your reply and encouragement. And yes mine are rough attempts at looking if the whole thing is feasible and share knowledge on the steps and issues that arise.
I am currently testing between ubuntu budgie LTS installs, and will soon try to backup and restore across different releases. I will share the issues i encounter, if any.

I will look at your comments and see if I can come up with some way to add checks and move temp directory to /tmp . Funny enough that was my initial thought as well :slight_smile:
Regarding themes, yes I found a shortcut with manually adding the ppa as I did not want to waste time with how to deal with that, and wanted to produce something for you to have a look. But yes a more elegant/smart way to deal with those themes, ppas etc. would be really great.

And, by the way, I am using xfce4 a bit lately, and I found out there is a small utility to reset panel settings to default, and another one to apply different templates (similar to what is in MATE). And also the same tool can help with backup, restore, export, import of panel profiles. Obviously it is not as comprehensive as the one you are looking to do for Budgie, but might be a good starting point?
In case you think it is worth having a look, this is what I am talking about. https://git.xfce.org/apps/xfce4-panel-profiles/about/

Quick update.
I have been working on this lately, and I created 2 small bash scripts to run things faster.

  • First phase of testing was from 18.04 (Hardware) to 18.04 (VM). It seems to be working ok for me, I have backed up and restored multiple times. I did add a check to make sure there is enough disk space, but well, the tar.gz archive is around 2.1KB so there is not much to worry there :slight_smile:
  • Second phase of testing was from 18.04 (Hardware) to 19.10 (VM). I noticed a few issues there restoring themes, as it seems some theme-related PPAs changed from 18.04 to 19.10. I guess I will need to add some commands to check release name of the system before restore, and add PPAs accordingly. Or leave themes out of this tool. I am open to suggestions on that part.

Edit: I have not found any issue restoring budgie and plank settings using dconf. However, I am still testing. And if issues happen when restoring, I found a command to reset budgie to the default settings. I can always add this as an optional step, to make sure budgie is standard before settings are restored.

1 Like

@fossfreedom

I figured out the theme-dilemma.
2 themes use external repositories, and those repositories are not consistent between releases. For example:

  • Tista Adapta has PPA for: 18.04 and 18.10 . After that, theme is in universe repos.
  • Tista Plata has PPA for: 18.04, 19.04 and 19.10. (according to launchpad. more investigation needed if you want me to make the script compatible with 18.10 too)

So I added a small section in the script where PPAs are added according to the release number of system where I am restoring to. For now I focused only on 18.04 and 19.10. It seems to be working pretty well. Also PPAs are not added again if already present in system where I am restoring to.

I tested across releases and I had no issues so far. Last couple of things do to, cosmetic changes and some user friendly echo messages :slight_smile:

Once I am ready to share the scripts. Where would you want me to send those?

PS
Do you want me to also make the script compatible to other releases, or are 18.04 and 19.10 enough?

ta - do you have a github userID? I would like to create a repo and give you dev rights to it to push your work.

18.04 and 19.10 and later is ok

1 Like

Sure, I have a github userID: @ilvipero

Quick disclaimer. What I did is just basic documentation with the work logic, list of commands used, and simple bash scripts. It is far from being a GUI app with cloud sync. Having said that, if it is still valuable to your team, I am happy to share.

If you want to discuss more, you can PM/email me. Thanks!

I wouldn’t stress about that (as we discussed when we had that audio call). There is value in having the logic all done!

1 Like

@bashfulrobot thanks and no problem.
@fossfreedom I confirm access to git was received.

I will start uploading my documents and scripts later today. Once files are uploaded, feel free to re arrange repo structure per your preferred standard.

Thank you guys!:+1:

1 Like

@fossfreedom @ilvipero Sorry to bring up an old conversation but was any progress made on this? I’d be interested in backing up my budgie-settings. I could test the eventual options if necessary.

Latest state of play is described in this issue

Basically some more tweaks and tucks are needed … all offers of help to progress are most welcome.

3 Likes