Backup and Import to a New Environment#

The steps below show how to backup and import to a new environment.

  1. Export:

    1. On the source system, create a remote backup location, for example location name sftpbackup:

      backup add sftpbackup <URI>

      For example:

      backup add sftpbackup sftp://sftpusr:[email protected]/home/sftp
      

      If a directory is specified in the <URI>, this will be created during the backup. Backups to sftp require ssh key-based authentication to be set up. Refer to SSH key management for further details.

      Alternatively, enter the password at the prompt, for example:

      $ backup add sftpbackup sftp://sftpusr:[email protected]/home/sftp
      
       No password found. Do you want to use sshkeys? no
       What is the host ssh password?
      
       <type password here>
      
       Location has been added
      
    2. Create a local backup:

      Important

      Backups should be created and restored in a screen session - see: Using the screen command.

      backup create localbackup

      In a multi-node configuration, the database backup will be created on the secondary node with the highest priority. Use database config to check the priority.

    3. List backups to get the date:

      backup list

      For example:

      $ backup list
       localbackup:
          URI: file:///backups
          Backups:
             1 backups have been created - most recently 2020-03-19 08:21
       sftpbackup:
          URI: sftp://sftpusr:********@172.29.41.107:home/sftp
          Backups:
             No backups created yet
      
    4. Export the local backup to the remote destination created by backup add <remote_name>.

      • The system ID is appended as a directory to the backup <URI> destination path. This can be checked locally by running system id.

      • The backup file is called <hostname>_<timestamp>.tar.gz.

      Example output:

      platform@VOSS:~$ backup export localbackup sftpbackup 2020-04-02 11:34
      This operation could take a while if the backup is sizeable. Do you wish to continue? y
      Compressing backup files for date 2020-04-02 11:34
      Backup files successfully compressed to 202004021134.tar.gz
      Backup files successfully compressed to /backups/49940d3feaa39a6a9f36cb5ff533202157c3b77a/VOSS_202004021348.tar.gz
      [email protected]'s password:
      [email protected]'s password:
      Export successfully created at [email protected]:media/49940d3feaa39a6a9f36cb5ff533202157c3b77a/VOSS_202004021348.tar.gz
      
  2. Import:

    Note

    For large backup files that cannot be imported due to space limitations, see: Restoring backup files too large for import.

    1. From the SFTP server, scp the VOSS_202004021348.tar.gz file to the new box (for example, platform@172.29.21.97). If the file on the SFTP server is in the directory /backups/49940d3feaa39a6a9f36cb5ff533202157c3b77a, change to the directory, then:

      $ ls
      
       VOSS_202004021348.tar.gz
      
      $ scp VOSS_202004021348.tar.gz [email protected]:/opt/platform/admin/home/media/
      
    2. Import the file as a local backup, for example:

      $ backup import localbackup media/VOSS_202004021348.tar.gz
      
    3. Get the file timestamp of the imported backup with backup list and restore the backup, for example:

      Important

      Backups should be created and restored in a screen session - see: Using the screen command.

      $  backup restore localbackup 2020-04-02 15:41
      

Restoring backup files too large for import#

If a backup file is available and is too large to copy into the local system /home/media/ directory, the following procedure can be followed. (Available space on home/media can be checked using diag disk.)

  1. On the system where the backup is to be restored, add the remote SFTP site, for example:

    backup add sftpbackup sftp://sftpusr:[email protected]/home/sftp
    
  2. Obtain the system UUID by running system id. It should look like this:

    49940d3feaa39a6a9f36cb5ff533202157c3b77a
    
  3. Given an available backup file, e.g. VOSS_202004021348.tar.gz, (with timestamp reference: 2020-04-02 15:41) this file can be extracted to the remote SFTP site configured above as follows:

    1. On the remote SFTP site, locate the sub-directory with the name of the UUID, for example

      /home/sftp/49940d3feaa39a6a9f36cb5ff533202157c3b77a
      
    2. Extract the backup file in this directory. Ensure that the extracted backup files are listed in the root of this directory (not all in a subdirectory).

  4. On the system where the backup is to be restored, run the remote restore, for example:

    $  backup restore sftpbackup 2020-04-02 15:41