Important
When restoring a backup on a new instance, follow these steps to avoid errors and ensure proper functionality.
During restoration, the new instance may retain the IP address of the original instance.
If AutoMocking is enabled, update the IP address to match the new instance. Use the Maintenance Operations
bulk-replace
feature to ensure the new IP address matches the required settings for your environment.
Ensure all users log out before starting the backup or restore process.
If users remain logged in, they may encounter a
TOKEN_UNKNOWN
error and lose access to SwaggerHub.To resolve this issue, users should clear their cookies and site data, and then log in again.
Restore backups only to the same version of SwaggerHub they were created on.
Do not rename the
.tar
files generated during backup.Place all required files in the target directory without modifying their names. The restore script relies on these file names and their locations.
The search type on the new instance must match the search type used on the original instance. If they differ, the
registry-api
will return a 500 status code.
Depending on your environment, execute scripts as sudo or use an account with the required permissions.
Test the backup and restore process in a non-production environment before applying it to production.
If you use an external database, modify the
backup-restore-external-db.sh
script to accommodate your database's specifics.SwaggerHub does not provide support for external database configurations.
Store backups outside the SwaggerHub installation environment to ensure retrieval after a critical failure.
Download the following backup script and paste it to a machine that can access the cluster: https://maintenance.sonp.swaggerhub.com/backup-restore-dbs.sh
Make the script privileges executable:
chmod +x backup-restore-dbs.sh
Create a directory to store the backup, for example,
mkdir db-dump
.Execute the script:
./backup-restore-dbs.sh dump <NAMESPACE> <PATH>
Define the following parameters in the script:
<NAMESPACE>
- the existing location of SwaggerHub installation.<PATH>
- the intended location of the backup.
Execute the script:
./backup-restore-dbs.sh restore <NAMESPACE> <PATH>
Define the following parameters in the script:
<NAMESPACE>
- the existing location of SwaggerHub installation.<PATH>
- the intended location of the backup.
Deploy a new sequence in the Admin Console. You can do that, for example, by changing any value in the config.
Download the following backup script and yaml files required for the script. Save these files to the EC2 instance where SwaggerHub is installed.
Make the script privileges executable:
chmod +x backup-restore-external-db.sh
Execute the script:
./backup-restore-external-db.sh dump <NAMESPACE>
Define the following parameters in the script:
<NAMESPACE>
- the existing location of SwaggerHub installation.
Execute the script:
./backup-restore-external-db.sh restore <NAMESPACE>
Define the following parameters in the script:
<NAMESPACE>
- the existing location of SwaggerHub installation.
Deploy a new sequence in the Admin Console. You can do that, for example, by changing any value in the config.