Backup and Import to a New Environment¶
The steps below show how to backup and import to a new environment.
Export:
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:sftpw@172.29.41.107/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
Create a local backup:
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.
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
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
- The system ID is appended as a directory to the backup
Import:
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/
Import the file as a local backup, for example:
$ backup import localbackup media/VOSS_202004021348.tar.gz
Get the file timestamp of the imported backup with backup list and restore the backup, for example:
$ backup restore localbackup 2020-04-02 15:41