First of all, remember that the simplest way to backup a vCSA server is to make a backup copy in the GUI on the Summary tab:
But if you need to back up and restore using PowerCLI scripts, then you can use the Backup-VCSAToFile function. A backup can be conducted to the following repositories:
You can use the following functions to manage the backup process:
Performs Backup-VCSAToFile as follows:
On the basis of the function Backup-VCSAToFile a script is created which allows you to backup the vCSA server by setting several parameters in the script header:
- Backup server and directory
- User name and password on the destination store
- The backup type is Fullbackup (full) or Seatbackup (vCSA configuration only)
- Password for the backup file that you need when restoring
- Backup storage type
- A comment
I must say that for the script you need to use a user defined at the SSO level, since if you take a user from AD, with the rights of the SSO Administrators group, script will not work anyway.
You can download the script from the repository on GitHub using this link.
You can restore the vCSA backup via the vCenter Server Appliance Installer by selecting the Restore option: