Backup your Evolution data
Backup and Restore supported by Evolution
Since DebianWheezy Evolution has a backup and restore procedure incorporated. In the menu choose File > Save Evolution data or Restore Evolution data.
Basically, it generates an archive file like evolution-backup-20200527.tar.gz containing ~/.config/evolution and ~/.local/share/evolution.
Migrating Evolution configuration data
Migrating Evolution configuration data from one installed instance to another can't be done by simple "Backup and Restore".
Every new install and new account generation (not update) generate an unique string for each IMAP4 accessed mail folder. This string is used in Evolution configuration data as account-uid. The most annoying part was restoring "Message Filters". Generating carefully generated "Message Filters" supporting many mailing lists and receiving account reports from scratch is a daunting task no one wants to do.
Although there may be cleaner way, I was able to migrate ~/.config/evolution/mail/filters.xml using a single invocation of sed command.
- Step 1: set up access credentials via GNOME Setup "Online Accounts"
- Step 2: just make 1 test "Message Filters" for each account.
For example ~/.config/evolution/mail/filters.xml should look like:
<?xml version="1.0"?> <filteroptions> <ruleset> <rule enabled="true" grouping="all" source="incoming" account-uid="2222b495c8d2ac7a7ae6fd18d7b684121919a796"> <title>Mail from BOGUS SOURCE</title> <partset> <part name="sender"> <value name="sender-type" type="option" value="contains"/> <value name="sender" type="string" allow-empty="false"> <string>noreply@regular-mail.com</string> </value> </part> </partset> <actionset> <part name="move-to-folder"> <value name="folder" type="folder"> <folder uri="folder://2222b495c8d2ac7a7ae6fd18d7b684121919a796/Announcement"/> </value> </part> </actionset> </rule> <rule enabled="true" grouping="all" source="incoming" account-uid="1111cfac43bb20c801706fcae158ef180fdba5e8"> <title>savannah@ubg.org mailing list</title> <partset> <part name="mlist"> <value name="mlist-type" type="option" value="is"/> <value name="mlist" type="string" allow-empty="false"> <string>savannah@ung.org</string> </value> </part> </partset> <actionset> <part name="move-to-folder"> <value name="folder" type="folder"> <folder uri="folder://1111cfac43bb20c801706fcae158ef180fdba5e8/savannah%40ung.org"/> </value> </part> </actionset> </rule> </ruleset> </filteroptions>
step 3: rename above as ~/.config/evolution/mail/filters-ref.xml
step 4: get your backup ~/.config/evolution/mail/filters.xml from inside of the archived backup copy and copy it to your new system as ~/.config/evolution/mail/filters-base.xml. Let's assume you found 1234567890123456789012345678901234567890 and 0987654321098765432109876543210987654321 in it and you identified their correspondence as:
1111cfac43bb20c801706fcae158ef180fdba5e8 <-- 1234567890123456789012345678901234567890
2222b495c8d2ac7a7ae6fd18d7b684121919a796 <-- 0987654321098765432109876543210987654321
- step 5: run the following script.
$ cd ~/.config/evolution/mail/ $ sed -e 's/1234567890123456789012345678901234567890/1111cfac43bb20c801706fcae158ef180fdba5e8/g' \ -e 's/0987654321098765432109876543210987654321/2222b495c8d2ac7a7ae6fd18d7b684121919a796/g' \ < filters-base.xml > filters.xml
- Optional: You may apply thus filter manually onto the new unprocessed messages.
Manual Backup and Restore (outdated contents, needs updates)
First check the files and directories for this procedure. They changed over the years! (For Buster, .config/evolution and .local/share/evolution are used. So, followings are completely outdated)
Backing up your precious data is important and difficult, especially in Evolution. Knowing the virtue of preparations helps a lot, though. Try the backup and restore procedures on an account with only data you can throw away. Yes, TRY it. It's not that useful having good backups from every single day if the restore procedure doesn't work. Do this even before you start putting all your appointments and email into Evolution. If you already used Evolution for a while, backup and restore to a different, empty account to test it.
Backup
Shut down all evolution, evolution-data-server and related instances with 'evolution --force-shutdown'. Inspect that everything is gone with ps ax | grep evo. Rinse and repeat.
- Create a backup directory
Copy or compress gconf data (~/.gconf/apps/evolution) to the backup directory
Copy or compress data directory (~/.evolution) to the backup directory
- Copy or compress (you might also want to encrypt) the password file to the backup directory if you want to keep your passwords. Skip it if your backup is not secure
- Inspect the new backup and check that everything's there and looking good
This is a sequence of commands that cover steps 2-5:
DIR=~/evolution_backup_`date +%Y-%m-%d` mkdir $DIR cp -a ~/.gconf/apps/evolution $DIR/gconf_apps-evolution cp -a ~/.evolution $DIR/dotevolution cp -a ~/.gnome2_private/Evolution $DIR/passwords tar cvj -C `dirname $DIR` -f $DIR.tar.bz `basename $DIR` rm -rf $DIR
Restore
It's a very good idea to clean traces of old evolution data from the account you're restoring to.
Shut down all evolution instances with evolution --force-shutdown. Inspect that everything is gone with ps ax | grep evo. Rinse and repeat.
Remove ~/.evolution
Remove ~/.gnome2_private/Evolution
Unset all related gconf values (/apps/evolution)
rm -rf ~/.evolution rm ~/.gnome2_private/Evolution gconftool --recursive-unset /apps/evolution
It's time to restore the old backup. Find your backup data and copy the data in place again (in my case 'tar xvj -C ~/ -f ~/evolution_backup_2006-06-18.tar.bz' will unpack the data).
DIR=~/evolution_backup_2006-06-18 cp -a $DIR/gconf_apps-evolution ~/.gconf/apps/evolution cp -a $DIR/dotevolution ~/.evolution cp -a $DIR/passwords ~/.gnome2_private/Evolution
We're basically done, but one last thing - cross your fingers before you start evolution again.