2.6 Backing Up Your Mobility System

All of the user data that exists at any time in your Mobility system also exists in GroupWise. Therefore, if there is a problem with your Mobility system, you can always resynchronize in order to restore your user data to a current working state.

However, you can back up your entire Mobility system in order to preserve the Mobility Service software, configuration files, certificate files, and database.

2.6.1 Understanding What to Back Up

Before you get started, understand the following:

  • Use your backup software of choice to back up the following directories on your Mobility server:

    Directory

    Description

    /opt/novell/datasync

    Mobility Service software

    /etc/datasync

    Configuration files

    /var/lib/datasync

    Certificate files

  • Use a PostgreSQL-supported backup solution to back up the Mobility Service database in the following directory:

    /var/lib/pgsql
  • Decide how you want to back up the data:

2.6.2 Backing Up a Mobility System after Stopping It

Stopping your Mobility system before backing it up is the safest way to ensure a completely consistent backup.

  1. In a terminal window on the Mobility server, become root by entering su - and the root password.

  2. Create a directory for storing your backup files, for example:

    mkdir /var/gmsbackup
  3. Create a script similar to the following:

    #!/bin/bash
    # back up stopped Mobility system
    gms stop
    systemctl stop postgresql.service
    #
    tar -czvpf /var/gmsbackup/pgsql.tgz /var/lib/pgsql 
    tar -czvpf /var/gmsbackup/vardatasync.tgz /var/lib/datasync
    tar -czvpf /var/gmsbackup/optdatasync.tgz /opt/novell/datasync 
    tar -czvpf /var/gmsbackup/etcdatasync.tgz /etc/datasync 
    #
    systemctl start postgresql.service
    gms start

    For example, you could create a script named gmsbackup.sh in the /opt/novell/datasync directory.

  4. Add execute permissions to the backup script:

    chmod +x script_name.sh
  5. Execute the backup script.

  6. Change to the directory where you backed up the Mobility files to verify that the .tgz files were successfully created.

2.6.3 Backing Up a Mobility System While It Is Running

For convenience, you might want to back up your Mobility system while it is still running.

  1. In a terminal window on the Mobility server, become root by entering su - and the root password.

  2. Create a script to back up the Mobility Service database:

    1. Create a file named .pgpass in the root user’s home directory (/root).

    2. Put the following contents in the .pgpass file.

      *:*:*:datasync_user:database_password

      The Mobility Service database user is datasync_user. The Mobility Service database password was established during installation.

    3. Create a database backup script similar to the following, using the pg_dump command to back up just the Mobility Service databases:

      #!/bin/bash
      # back up Mobility Service database
      pg_dump -U datasync_user mobility > /tmp/mobility.out
      pg_dump -U datasync_user datasync > /tmp/datasync.out
      /usr/bin/bzip2 /tmp/mobility.out
      /usr/bin/bzip2 /tmp/datasync.out

      For example, you could create a database backup script named gmsdbbackup.sh in the /opt/novell/datasync directory.

    4. Add execute permissions to the backup script:

      chmod +x script_name.sh
    5. Execute the backup script.

  3. Create a script to back up the Mobility Service directories:

    1. Create a directory for storing your backup files, for example:

      mkdir /var/gmsbackup
    2. Use the following script to back up the rest of your Mobility system while it is sill running:

      #!/bin/bash
      # back up running Mobility system 
      tar -czvpf /var/gmsbackup/vardatasync.tgz /var/lib/datasync
      tar -czvpf /var/gmsbackup/optdatasync.tgz /opt/novell/datasync 
      tar -czvpf /var/gmsbackup/etcdatasync.tgz /etc/datasync 

      For example, you could create a script named gmsdirbackup.sh in the /opt/novell/datasync directory.

    3. Add execute permissions to the backup script:

      chmod +x script_name.sh
    4. Execute the backup script.

    5. Change to the directory where you backed up the Mobility files to verify that the .tgz files were successfully created.

2.6.4 Restoring Your Mobility System

To restore your Mobility system:

  1. Change to the directory where you backed up the Mobility files.

  2. Use the following tar command to restore the backed-up Mobility directories:

    tar -xzvf file_name.tgz
  3. (Conditional) If you used the pg_dump command to back up the Mobility Service databases separately, use the psql command to restore it.