Backup and restore Evolution - gHacks Tech News

Backup and restore Evolution

How many times have you migrated from one Linux box to another, only to say goodbye to your email and knowing you were going to have to set your email client up all over again. Oh sure you could tar up that ~/.evolution directory and hope that it worked. Most likely you would wind up with a train wreck of a folder system and you would still wind up having to re-configure all of those email accounts and calendars all over again.

It doesn't have to be that way. The Evolution groupware suite has a built in backup/restore system that will amaze you how how well (and quickly) it works. We're not talking about the time consuming back up and restore of Outlook PST files. It doesn't matter how large your Evolution folders have grown, this backup/restore is fast and painless. And in this article, I am going to show you just how easy this task is.

Assumptions

It should be fairly safe to assume that you will backing up and restoring from and to the same release of Evolution. I have not tested this, but you might be safe to do so only if the releases are not far apart. To be safe, however, you should make sure both source and target are of the same release. You will also have to have the means with which to copy files back and forth. If you are restoring to a new machine it would be safe to say that you have either placed these files on a backup drive. This article will also assume you have not already set up Evolution. You can restore over a currently configured Evolution, but we don't want to do that. With that said, let's begin the backup/restore.

Backup

If you open up Evolution click on File > Backup Settings. When you do this a new window will open asking you where to save the file and what name to give the file. The default filename is evolution-backup.tar.gz. If you do change the name, make sure you do not change the extension .tar.gz as that is the extension the Evolution restore system will need to see.

Believe it or not, that is all you need to do for the restore. The size of your Evolution folders will determine how long the backup process will take. I'm fairly confident you will be surprised how quickly this backs up.

Restore

Figure 1

Now for the fun. The restore process is just as simple. When you fire up Evolution for the first time you will see the Welcome window.  After the first Welcome screen (just click Forward to get past that) you will see the only screen you need for the restore (see Figure 1).

The first step is to check the box for Restore Evolution from backup file. Once you have done that click the Folder button and then navigate to where you have your evolution-backup.tar.gz file saved. Once you have located that file click Apply and the restoration will commence.

When the restore is complete the only thing you will need to do is to enter your email password(s) in order to download the mail you've missed during the process.

If, like me, you use scripts for your signature, you will have to make sure those scripts are on the new machine (as well as in the same place).

Final thoughts

The backup/restore of the Evolution groupware suite is one of the most painless I have come across. It's fast, reliable, and requires very little work.

We need your help

Advertising revenue is falling fast across the Internet, and independently-run sites like Ghacks are hit hardest by it. The advertising model in its current form is coming to an end, and we have to find other ways to continue operating this site.

We are committed to keeping our content free and independent, which means no paywalls, no sponsored posts, no annoying ad formats or subscription fees.

If you like our content, and would like to help, please consider making a contribution:

Comments

  1. Eric said on June 2, 2010 at 1:25 am
    Reply

    Actually performed these steps during my upgrade from Ubuntu 8.04 to 10.04. I backed up everything in my home directory, and also did an Evolution backup as well.
    I completed a fresh install of Ubuntu, and restored my data. When I launched Evolution, I selected the restore option and pointed it to the archive file that Evolution created. Restore was successful, but Evolution would not launch because it was seg-faulting. I don’t remember the error exactly.
    To get my mail back, and manually pulled my Evolution data from my home directory archive data.

    My point is, even though Evolution has this feature, it may not work if revisions of Evolution are too far apart

  2. artp said on June 2, 2010 at 5:13 am
    Reply

    I don’t understand why anyone would have to lose data.

    Don’t you:

    1) have a separate partition for the /home directory so that it doesn’t get clobbered on upgrades and installs ? Not to do this is to dumb up Linux so that it works like Windows.

    2) Have your home directory on a server so that #1 is not necessary on each system you use ? NFS is not that hard to set up.

    After these two steps are taken, then the only issue left would be migrating data from one version of Evolution (or any other program, for that matter) to another. That SHOULD be the responsibility of the developers, but I have had to figure out ways to migrate data across many different versions of many different programs. Apparently, it is just a fact of life.

    The other advantage of this setup is that you can always just rename old dot.directories, start from scratch, and still have the old data available if needed for reference.

    email has many options available so that you don’t have to carry your data around with you without making you go without it. Even for a guy on the run. VPNs, ssh, an email server like squirrelmail et al. that gives you remote access….., all offer options for the mobile user.

  3. Eric said on June 2, 2010 at 2:37 pm
    Reply

    I did have a separate home partition. My goal was to reconfigure my RAID to give me better reliability. I have my /home backed up to a local NAS, so I didn’t lose data. In my example, I had to manually restore the data because Evolution backup / restore failed to restore my data into a working copy of Evolution.

    I also didn’t feel confident that Ubuntu 8.04 to 10.04 upgrade would work, so a fresh install was the best option.

  4. Michael said on June 18, 2010 at 10:35 pm
    Reply

    The built-in backup & restore works well but has a serious drawback: the backup can’t be automated. That means, it can’t be run in a cronjob.
    If you look into /usr/lib/evolution you will find there Evolutions backup binary. Run it in a terminal and you see what it does. It is simple and straightforward.
    Using this information I wrote a backup script for Evolution. It works straight in a terminal and from a users cronjob. May be it is useful for someone else, you can find it on my website.
    BTW, if you do a reinstall of Evolution, I recommend to delete the .evolution folder _and_ to unset recursively all entries under evolution in the Gnome configuration database first. Do this as well if you do a not so compatible update, i. e. from Evo 2.28 to Evo 2.30. If you move your data from the previous version to the new one via the export/import options in Evolution , then this will work independent from the version jump.

    1. tseshagiri said on July 27, 2010 at 3:29 pm
      Reply

      can u send me the script as i want to migrate from evolution to outlook

      1. Michael said on July 27, 2010 at 3:58 pm
        Reply

        Hi,
        as said, you can find the script on my website, i. e.
        http://dr-luthardt.de/linux.htm?tip=evo
        Scroll down to *Backup*. I hope the script evobackup.sh is commented
        enough to understand it.
        BTW, I can’t see how an evolution backup helps to migrate to outlook. Here,
        instead, use the export tools. Hopefully, outlook can import some stuff. This
        means UTF-8 -> ISO Latin1 as well :-(

  5. Liviu said on November 17, 2010 at 2:43 pm
    Reply

    Did anyone of you guys managed to backup his e-mail on a Evolution mail used on Linux and then restore that same backup on a Windows platform?
    I`m looking to install Evolution mail for windows on a xp machine and restore the linux backup on it. so i wont lose any e-mails and accounts.

    If you guys have a tutorial about that please let me know.
    Kindly appreciate it

    1. Matt said on January 26, 2011 at 3:24 am
      Reply

      Well, here’s what I did: First, I got fed up with Ubuntu constantly re-breaking fixes from previous versions and I just had enough. Anyway, I had my old evolution-backup.tar.gz file from Evolution under ubuntu 10.10 but evolution for windows wouldn’t restore it, got that path error. I finally realized it was trying to restore to the same file structure as Evo under Linux, but it has some different filenames and pathnames, etc. I downloaded the gz extractor for windows, then I downloaded the tar extractor and had a look at the path and files. Since I also had my original .evolution directory backed up, I didn’t wind up extracting the tar file, but I wound up looking at hidden files in my user directory and I found the evolution structure, copied the old linux files over the existing structure and hoped for the best. It didn’t take my mail config, but my messages and contacts were there, with just a few messages that appear to be corrupted. You might try this to keep your contacts and msgs, but maybe do a little more careful job than I did. I’ve set up my prefs and now it’s working okay.

  6. eddi said on August 16, 2012 at 4:55 pm
    Reply

    Hi all. The backup and restore process in old versions of evolution worked as described in this article. Now I’m using evolution 3.4.3 and the menu-entry “File > Backup Settings” does not exist any more. Is there still a possibility to create a backup. How does it work?

  7. Raj Upadhyaya said on September 24, 2012 at 9:01 am
    Reply

    I modified Dr. Luthardt’s script to work on Fedora 17 and with evolution 3.4.3. Here it is..

    #!/bin/bash
    # Backup for Evolution 3.4.4
    # use it as USER, not root!
    # it can be used in USER’s cronjobs
    # with full pathes given
    # http://dr-luthardt.de/linux.htm?tip=evo

    if [ -z $1 -o -d $1 ]; then
    echo “Usage: [/path/to/]evobackup.sh [/path/to/]backupfile”
    exit 1
    fi

    # remember evolutions running state for current user
    running=0
    pgrep -u $USER -f ‘.*alltray.*evolution’ > /dev/null
    if [ $? -eq 0 ]; then
    running=2
    else
    pgrep -u $USER -f evolution > /dev/null
    if [ $? -eq 0 ]; then
    running=1
    fi
    fi
    echo “evobackup: running=$running”

    # shutdown before doing a backup
    if [ $running -gt 0 ]; then
    evolution –quit
    sleep 5
    fi

    # just in case
    [ “`pgrep -f evolution`” ] && kill `pgrep -f evolution` 2> /dev/null

    cd $HOME
    if [ -d .config/evolution -a -d .local/share/evolution ]; then
    echo -e “[dirs]\ndata=.local/share/evolution\nconfig=.config/evolution\n”\
    > evolution.dir
    [ -f .local/share/evolution/.running ] && \
    rm .local/share/evolution/.running
    gconftool-2 –dump /apps/evolution > \
    .local/share/evolution/backup-restore-gconf.xml
    if [ -d $HOME/.camel_certs ]; then
    tar -chzf “${1%%.*}”_`date -I`.tar.gz evolution.dir \
    .local/share/evolution .config/evolution .camel_certs
    else
    tar -chzf “${1%%.*}”_`date -I`.tar.gz evolution.dir \
    .local/share/evolution .config/evolution
    fi
    else
    echo “evolution dirs not found. Exiting.”
    exit 1
    fi
    echo “evobackup: tar exit code $?”

    rm .local/share/evolution/backup-restore-gconf.xml

    #rm -f evolution.dir

    # test the backup – Cannot test as it does not exist.
    #/usr/lib/evolution/2.32/evolution-backup –check “${1%%.*}”_`date -I`.tar.gz

    # in case we’ll running a GUI program from cron,
    # we must give it a display
    [ -z $DISPLAY ] && export DISPLAY=:0.0

    # restart evolution detached and in its previous state
    [ $running -eq 1 ] && /usr/bin/evolution &
    [ $running -eq 2 ] && /usr/bin/alltray — /usr/bin/evolution &
    exit

  8. Ken Wood said on February 27, 2013 at 4:18 am
    Reply

    Migrating Evolution is the biggest pain in the arse I have to go through between Linux versions and there are no painless methods. Both the last two times I have migrated I have lost all my contacts. I will be taking another good hard look at Thunderbird real soon.

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

Please note that your comment may not appear immediately after you post it.