Issue
-
we want to set up an automated download of the DXP-cloud-backup. To connect to the server we have to run the following procedure:
- lcp auth token
- lcp remote
- lcp shellPlease can you help us finding the required token?
Alternatively, please inform us if there is another way of ensuring the backup.
Environment
- PaaS
Resolution
-
Please find below some information that might be helpful.
1. Use the Liferay Cloud CLI tool to download backups. The commandlcp backup download --backupId [ID]downloads both the database and document library volumes for the given backup ID. For specific volumes, use the flags--databaseor--doclib. Improve download speeds for the document library (database download is unaffected) using the--concurrencyflag (up to 10,000 parallel downloads). This requires CLI version 3.12.0+, Backup service 5.9.0+, and Liferay service 5.3.0+.
2. Use Backup APIs for CLI versions before 3.12.0 or Backup service before 5.9.0. Authenticate with basic authentication (username/password) or a user access token (mandatory for SSO). The API base URL ishttps://backup-[Project name]-[Environment].lfr.cloud. Append specific endpoints for database (/backup/download/database/[ID]) or document library downloads. Example using curl and basic authentication:curl -X GET https://backup-[Project name]-[Environment].lfr.cloud/backup/download/database/[ID] -u user@domain.com:password --output database.gz. For Backup service versions 3.2.0+, use the headerdxpcloud-authorization: Bearer [User token]. For older versions, useAuthorization: Bearer [Project master token](retrieved viaenv | grep LCP_PROJECT_MASTER_TOKENin the Liferay Cloud console).
3. For Backup service versions older than 4.3.5, download backups through the Liferay Cloud Console. As an administrator, navigate to the Backups page in the target environment, select the backup, click Actions (⋮), choose Download, and click the respective database (.gz) or Liferay (.tgz) file. Note: for Backup service versions before 4.2, the database is a .tgz archive.
Automating the download process can be achieved through scripts leveraging the Backup APIs or the CLI. The commandlcp auth token(CLI 3.14.0+) retrieves the authentication token for scripting purposes.
Below resources/articles might also help providing more accurate details:
https://learn.liferay.com/w/liferay-cloud/platform-services/backup-service/downloading-and-uploading-backups
https://help.liferay.com/hc/en-us/articles/17183733950349-Liferay-Cloud-Platform-CLI-Backup-Management
https://help.liferay.com/hc/en-us/articles/19941006498573-New-CLI-Commend-Display-Auth-Token-CLI-3-14-0