Backing up and restoring the Developer Portal
You can back up individual Developer Portal sites, or all of the sites and Developer Portal configuration settings. You can then restore backed up sites and portal configurations. You can also take snapshots of your Developer Portal servers.
About this task
You can use the backup_site
command to back up all of the information that is
needed to restore a single Developer Portal
site. Or use the backup_devportal
command to back up all of your Developer Portal
sites and all of the cluster configuration that was set with other commands, such as
set_apim_host
. For more information, see backup_site and backup_devportal.
You can also take a snapshot of your Developer Portal
server by using the tools that are provided by your virtualization environment. Snapshots are useful
when you want to preserve the state of a server, so you can return to the same state if needed. For
example, for short-term scenarios such as taking a checkpoint immediately before you apply a fix
pack upgrade. You can then delete the snapshot after a few days when the changes are confirmed as
successful.
Note:
- Snapshots are not the same as backups. A snapshot is a change log of the original virtual disk, and is not portable. Therefore, do not rely on it as your only backup process. The virtual machine runs on the most current snapshot, not the original vmdk disk files. For optimum recovery readiness, you should take both snapshots and backups of your Developer Portal configuration.
- Site and Developer Portal backup files don't store details of the users, applications, and subscriptions. This information is stored by the Management server. Backups contain Portal configuration and customization data. If a non-PDUR site hasn't been customized in any way, then it can be restored by re-creating the site in the API Manager UI; for more information see Restoring a Portal site by re-creating in the Troubleshooting the Developer Portal guide.
- Backup files are intended for recovery on the same API Connect deployment on
which they were taken. Extra steps might be needed if you're attempting to restore a backup file on
a different API Connect
deployment. For example, updating IP addresses and hostnames, restoring Portal sites to different
UUIDs (
restore_site -i
), and so on.
- Backing up individual Developer Portal sites
- Restoring individual Developer Portal sites
- Backing up your whole Developer Portal
- Restoring your whole Developer Portal
- Taking a snapshot of a single Developer Portal server
- Taking a rolling snapshot of a Developer Portal cluster with zero downtime
- Taking a snapshot of a Developer Portal cluster with downtime
Procedure
- Backing up individual Developer Portal sites
-
- Restoring individual Developer Portal sites
-
- To list all of the backup files for an individual Developer Portal
site, enter the following command:
ls -ltr /var/aegir/backups/your_site*
Note: These backup files are listed with the newest at the end of the list. - To restore a target site, select an appropriate backup file, then enter the following command:
where backup_file_absolute_path is the location of the backup file you created for the site you want to restore.restore_site backup_file_absolute_path
- To list all of the backup files for an individual Developer Portal
site, enter the following command:
- Backing up your whole Developer Portal
-
- To back up your whole Developer Portal,
enter the following command:
The console lists the filepath where the backup has been created, as follows:backup_devportal
Backup created: backup_file_absolute_pathwhere backup_file_absolute_path is the location of the backup file that has been created.Important: Copy the backup file to a remote server so that you can restore the whole Developer Portal if there is a catastrophic failure.
- To back up your whole Developer Portal,
enter the following command:
- Restoring your whole Developer Portal
-
- To list all of the backup files for the whole Developer Portal,
enter the following command:
ls -ltr /home/admin/backups
Note: These backup files are listed with the most recent files listed at the end: - To restore your whole Developer Portal,
enter the following
command:
where backup_file_absolute_path is the location of the backup file that you created for your portal. If you want to restore the node specific configuration, you must include the optionrestore_devportal backup_file_absolute_path
-n
in the command. See restore_devportal for more options.
- To list all of the backup files for the whole Developer Portal,
enter the following command:
- Taking a snapshot of a single Developer Portal server
- While it is possible to take snapshots with the database running, to ensure data integrity it is
recommended that you quiesce the database before you take the snapshot.
- Stop the database for your Developer Portal
server by using the following command:
stop_db
- Take a snapshot of your server by using the tools that are provided by your virtualization environment.
- Start the database for your Developer Portal
server by using the following command:
start_db
- Stop the database for your Developer Portal
server by using the following command:
- Taking a rolling snapshot of a Developer Portal cluster with zero downtime
- To avoid the risk of database reclustering issues on restoration, when you take a snapshot of a
Developer Portal
cluster, the database of each server should be stopped before the snapshot is taken, and then
restarted again after. In this way, you can achieve a rolling snapshot of your cluster with zero
downtime. If you must restore all the snapshots at the same time, then the cluster will
automatically bootstrap itself with the data from the last server that was snapshot.
- Stop the database for one of your Developer Portal
servers by using the following command:
stop_db
Note: If your cluster uses a load balancer, you must stop the load balancer from directing any requests to the server before stopping the database on that server. - Take a snapshot of your server by using the tools that are provided by your virtualization environment.
- Start the database for your Developer Portal
server by using the following command:
If your cluster uses a load balancer, you can resume directing requests to the restarted database server.start_db
- Repeat Steps 1 to 3 for each server in your cluster.
- Stop the database for one of your Developer Portal
servers by using the following command:
- Taking a snapshot of a Developer Portal cluster with downtime
- If the databases on all the cluster members are stopped at the same time, the databases will
attempt to auto-recover, unless you stop the cron processes first. In this instance, use the
following instructions to take snapshots of your Developer Portal cluster:
- Stop the cron processes by using the following command on each cluster member
server:
sudo service cron stop
- Stop the databases on all cluster member servers by using the following command on any single
server:
bootstrap_cluster -t
- Take a snapshot of each server by using the tools that are provided by your virtualization environment.
- Bootstrap the database cluster by using the following command on any single cluster
member:
This command bootstraps the databases by using the most up-to-date stopped cluster member as the master replica.bootstrap_cluster -b
- Start the cron processes again by using the following command on each cluster
member:
sudo service cron start
- Wait for all the cluster members to restart. You can check on the current state of the databases
on all cluster members that are reachable by running
bootstrap_cluster -s
.
- Stop the cron processes by using the following command on each cluster member
server:
Note: If you need to restore a snapshot of a single Developer Portal
server in a cluster, you must run
start_db
on its database so the server rejoins
the cluster.
You can manage the number of Developer Portal
backups that are kept on the file system by setting the variable
SITE_BACKUPS_DAYS_WORTH_TO_KEEP
in the config.ini file.