Back Up and Restore the API Portal

We recommend that you regularly back up your existing CA API Developer Portal for safeguarding. There are two methods to back up the API Portal. We recommend that you use both methods.
apidp31
We recommend that you regularly back up your existing CA API Developer Portal for safeguarding. There are two methods to back up the API Portal. We recommend that you use both methods.
  • Use your VMware solution to either take a snapshot of the API Portal VM or, if your VMware solution supports it, make a backup of the API Portal VM. We recommend making a backup of the VM. For more information, see your VMware user documentation.
  • Use the 
    portal_backup_restore.sh
     script to back up the API Portal. You can use the same script to restore your backed up API Portal.
The rest of this section describes how to use the 
portal_backup_restore.sh
 script to back up and restore the API Portal.
The back up occurs on a source API Portal while the restore occurs on a target API Portal. The source and target can be the same API Portal. 
Prerequisites
To back up and restore the API Portal, you need the following files and privileges:
  • A MySQL user account with sufficient privileges to alter API Portal databases. The default API Portal MySQL lrs account will suffice. The MySQL user account will need to be able to create, drop, dump, and restore both lrs and lrsdata databases. 
  • portal_backup_restore.sh
  • backup_restore.properties
     
The files are in the 
backup_restore.zip
 file for the Portal version you wish to upgrade to. The zip file can be found under "CA API Developer Portal Patches" on the CA API Management Solutions & Patches page.
Backing Up an API Portal 
This section describes how to back up an API Portal.
To back up an API Portal:
  1. Open a root shell on the API Portal and navigate to the 
    /opt
     directory. 
  2. Create a working directory named backup.
  3. Copy the 
    portal_backup_restore.sh
     and 
    backup_restore.properties
     files to /opt/backup.
  4. Configure the 
    backup_restore.properties
     file:
    • SOURCE lrs database lrsUserSrc=lrs lrsHostSrc=source.portal.hostname lrsPortSrc=3306 
    • SOURCE lrsdata database lrsdataUserSrc=lrs lrsdataHostSrc= lrsdataPortSrc= 
    Note:
    If you do not specify values for the Host and Port properties, the script will use the default values. The default Host value is
    localhost
    . The default Port value is
    3306
    .
  5. Run the 
    portal_backup_restore.sh
     script.
  6. When the script prompts you to select Backup Option 1 or 2:
    • Select option 1 if the databases are not located on the localhost.
    • Select option 2 if the databases are located on the localhost.
  7. When the script asks if you want to restart the API Portal, select No. 
  8. Copy the 
    portal-migration.tgz
     file to a secure location. 
    IMPORTANT:
     You need the 
    portal-migration.tgz
     file to restore the API Portal.
Restoring a Backed Up API Portal 
This section describes how to restore a backed up API Portal. You need the following files: 
  • portal-migration.tgz, which was created when the API Portal was backed up.
  • portal_backup_restore.sh
  • backup_restore.properties
To restore a backed up API Portal:
  1. Open a root shell on the API Portal and navigate to the /opt directory. 
  2. Create a working directory named restore.
  3. Copy the portal_backup_restore.sh, backup_restore.properties, and portal- migration.tgz files to /opt/restore. 
  4. Configure the backup_restore.properties file: 
    • TARGET lrs database lrsUserTrg=lrs lrsHostTrg= lrsPortTrg= 
    • TARGET lrsdata database lrsdataUserTrg=lrs lrsdataHostTrg=localhost lrsdataPortTrg=3306 
    Note:
    If you do not specify values for the Host and Port properties, the script will use the default values. The default Host value is localhost. The default Port value is 3306.
  5. Run the 
    portal_backup_restore.sh
     script.
  6. When the script prompts you to select Backup Option 3 or 4: 
    • Select option 3 if the databases are not located on the localhost.
    • Select option 4 if the databases are located on the localhost. 
  7. When the script asks if you want to restart the restored API Portal, select Yes.
  8. Test the restored API Portal to ensure that it is working properly.