Backing Up and Restoring SwaggerHub On-Premise Data and Configuration

Last modified on July 27, 2021

You can back up your SwaggerHub On-Premise data and configuration. These backups are useful in the following cases:

  • As an additional backup method to supplement VM snapshots.

  • If you need to transfer your data to another SwaggerHub On-Premise instance (for example, when migrating to another hypervisor).

What is included in a backup

A SwaggerHub On-Premise backup includes:

  • All the data from the main SwaggerHub application:

    • all users (both active and inactive)
    • all organizations, teams, and projects
    • all API definitions, domains, and versions
    • collaborators and comments
    • integration settings
    • and other
  • Admin Center configuration: authentication method, SMTP and proxy settings, SSL certificates, custom codegen templates, and so on

  • SwaggerHub system logs

Not included: License, SSH users, NTP settings.

Manage backups

You can create, manage, and restore backups on the System page of the Admin Center. The Backups table lists all the available backups stored on your SwaggerHub On-Premise instance.

Managing backups

Click the image to enlarge it.

Create a backup

Click Backup to create a new backup. Backups are saved as a .tar.gz file, with a timestamp in the file name:

backup_<version>_2020-03-05-11-51-37UTC.tar.gz  # SwaggerHub On-Premise v. 1.18.8 and later

backup_2020-03-05-11-51-37UTC.tar.gz  # SwaggerHub On-Premise v. 20180116, 1.18.0–1.18.7

backup_1519853159685.tar.gz           # Earlier versions use Unix timestamps
                                      # (number of seconds since midnight UTC, January 1, 1970)

After creating a backup, you may want to download it to your computer (see below) and then copy it to a remote location.

Download a backup

We strongly recommend that you save backups to a remote location for added backup protection. To do that, click Download next to a backup to download it to your computer. Then you can copy this backup to the desired remote location.

Restore a backup

A backup can be restored only to the same version of SwaggerHub from which it was taken. For example, a backup from v. 1.25.1 cannot be restored to v. 1.27.0.

To restore a backup:

  1. If the backup is stored outside SwaggerHub, you first need to copy it to SwaggerHub’s internal storage. To do that, click Import and browse for the backup file (.tar.gz). This backup will then appear in the Backups table.

  2. In the Backups table, click Restore next to the backup you want to restore and confirm the action by clicking OK.

  3. Restoring may take a few minutes and must not be interrupted.

    Do not close the browser or navigate anywhere while the data is being restored.

  4. The restore status is displayed in the Server Status area. The “still processing” messages mean that the restore is in progress.

  5. When the restore is complete, you will see the following messages in Server Status:

    Status: COMPLETED

    ...
    still processing
    still processing
    Restarting SwaggerHub, this may take several minutes
    Restored registry database
    Restored user database
    Finished processing maintenance script
    Restarting SwaggerHub, this may take several minutes
    restarted everything

You can now close the Admin Center or perform other tasks.

Delete a backup

You can delete old backups to free up disk space. To do that, click Delete next to the backup you want to delete.

Automate backup creation

There is a bash script to create SwaggerHub On-Premise backups automatically:

https://s3.amazonaws.com/onprem-files/get-backup.sh

You can have this script to run regularly as a cron job. For details, see Automated Data Backups.

See Also

Backup and Recovery
Creating VM Snapshots

Highlight search results