Backing up and restoring Zimbra (Open Source Version)
If you wish to have a more automated backup feature, you should try the [Network Version of Zimbra.]
Preparing to Back Up
Before we begin, make sure that you are logged in as a user that can perform the tasks outlined here.
It is always good practice to backup your copy of Zimbra in the event of unforeseen circumstances.
To prevent changes to any Zimbra databases during the backup processes you may wish to use:
to terminate Zimbra.
If you get some kind of error, you may want to make sure that Zimbra has completly stopped by running:
>ps auxww | grep zimbra
and kill any left over processes such as the log.
Copying Your Working Files to a Safe Location
Make sure that the copy location has enough space to support your backup copy (i.e. the /tmp folder probably isn't the best location).
Since all of the components Zimbra needs are stored in the Zimbra folder itself, you can simply copy the folder to a safe location.
It may be possible to create a cron job to do these tasks automatically.
Copy Command: cp -r /opt/zimbra [location path]
Depending on your hardware and the amount of data contained in your Zimbra installation, this process can take a while.
Note: It is a very good idea to tag your installation with the version/build of zimbra that will be backed up (ie 3.0.0_GA_156) and the date of backup. You'll need this later.
Before restoring, you should make sure that all of the processes accociated with the damaged/failed Zimbra installation are terminated. Failure to terminate all of the processes could have dire consquences. See "Preparing to Backup" for additional info.
Rename your "broken" Zimbra installation.
You may be able to scavenge data, if needed. If you simply do not want the old data, you can skip this part.
>[insert command for renaming here]
You may want to move it completly out of the /opt folder just to be safe.
Copy your backup Zimbra installation to the /opt folder and name it "zimbra".
>cp -r [location of backup] /opt
>[insert command for renaming here]
Downloading a Dummy Copy of Zimbra
Now, we need to know what build/version of zimbra you were running. If you followed the backup instructions above, then the backup folder should be tagged with the version/build you have backed up.
You need to download the full install of the Zimbra version you were running. You may find all Zimbra releases at: Sourceforge.
If you don't know your version number, you can find it by [insert way here].
Installing the Dummy Copy of Zimbra
Once you have downloaded the tar file, you will need to uncompress it by:
>tar -xvzf [name of file].tgz
This will create a folder in the directory named "zcs", cd to it and run the install script:
WARNING: Do not run the script with the -u option. You will remove all of your backup data & you must run the script as root, NOT ZIMBRA.
If all goes well, you will see the following:
The Zimbra Collaboration Suite appears already to be installed.
It can be upgraded with no effect on existing accounts,
or the current installation can be completely removed prior
to installation for a clean install.
Do you wish to upgrade? [Y]
The script will remove the existing packages, and install them again. The script will attempt to stop Zimbra Services and "UPGRADE FAILED - exiting". This is okay, simply rerun the script, and it will install normally.
If you experence error 389, -1, connection refused errors, please search the Forums. These errors are covered extensivly.
If you are up and running now, you may have one more hurdle to overcome: permissions.
You may need to reset the permissions on the message store by running the following:
>chown -R zimbra:zimbra /opt/zimbra/st*