Cisco Backup and Restore ONP Database Software User Guide
- June 16, 2024
- Cisco
Table of Contents
Backup and Restore Cisco ONP Database
Backup Database
Based on the database backup configuration on the server, as set by the system admins, you can take the backup of the complete database on a daily, weekly, or monthly basis. Only system admins can access the backup folders and restore them. Backup archive is stored on highly durable NFS share. The following backup archives are available:
- Archives for the last 7 days
- Weekly archives for the last 4 weeks
- Monthly archives for the last 6 months
Note
You can change the duration for monthly archives.
Setup Backup
Before you begin
- Ensure that highly durable 2 TB NFS storage is available to store database archives.
- Ensure that the storage is accessible from the Cisco ONP environment. Set up rules that are defined by the Cisco ONP network and appropriate ACL (Access Control List) to permit or deny access to the storage.
Step 1 Log into the Cisco ONP server, where you have installed Cisco ONP
by using the tar archive.
Step 2 Create a folder for backup. Ideally it should be mounted on a
reliable object storage (like NFS).
Step 3 Copy backup, rotation, and setup backup scripts from ONP/images
folder to the new folder created in step 2.
Example:
$ cd
$ mkdir cnp_backups
$ tree ~/cnp_backups/
/home/ciscocnp/cnp_backups/
└── rotation.sh
└── setup_backup.sh
Ensure that all scripts have necessary permissions:
$ chmod +x rotation.sh
$ chmod +x setup_backup.sh
$ ls -l | grep .sh
-rwxrwxr-x 1 ciscocnp ciscocnp 518 Jan 16 05:23 backup_mongo.sh
-rwxrwxr-x 1 ciscocnp ciscocnp 1412 Feb 1 05:50 rotation.sh
Step 4 Copy restore_mongo.sh from /ONP/images/.
Perform Manual Backup
Perform the following steps for the backup operation:
Step 1 Browse to the location, where the backup_mongo.sh script is
stored.
Step 2 Execute the backup_mongo.sh script using the following command:
Example:
user@server:~/cnp_backups$ bash backup_mongo.sh
The backup file gets stored in the daily backup folder (backup.daily) with the
current time stamp.
Schedule a Backup
Schedule a Backup Using Script
Use this task to schedule the backup operation using script:
Step 1 Log in to the Cisco ONP server.
Step 2 Execute the rotation.sh script using the following command:
user@server:~/cnp_backups$ bash rotation.sh
This command creates necessary folder structure.
Step 3 Execute the setup_backup.sh script using the following command:
Example:
The backup file gets stored in the daily backup folder (backup.daily) with the
current time stamp.
Step 4 Enter the path in the user prompt to store the file.
Backup files are stored in your required file path as following:
/user-defined path/backups/backup.daily
Schedule a Backup
Use this task to schedule the backup operation using Crontab:
Step 1 Log in to the Cisco ONP server.
Step 2 Configure the Crontab job using the following command.
user@server~/cnp_backups$ sudo crontab -e
Step 3 Modify the Crontab.sh script to schedule the backup.
Example:
The following example shows the scheduling of the backup operation, at 3 a.m
daily.
0 3 * /home/ciscocnp/cnp_backups/backup_mongo.sh
Syntax to Schedule the Backup Using Crontab
Use the following syntax to schedule backup in Crontab:
m h dom mon dow
Where:
- m—Minutes (0–59)
- h—Hours (1–23)
- dom—Day of the month
- mon—Month of the year
- dow—Day of the week
To define the time, you can provide concrete values for minute (m), hour (h),
day of the month (dom), month (mon), and day of the week (dow), or use the
wildcard, ‘*’ in these fields (for ‘any’).
Note
The backup jobs start based on the cron’s system daemon’s notion of time
and time zones.
Restore Database Using Script
You can restore the database using script, which is available at the following
location:
/ONP/Images/restore_mongo.sh
Execute the following command:
$ sudo bash restore_mongo.sh DB backup archive file path.
For example:
$ sudo bash restore_mongo.sh /backups/backup.daily/2019-05-05-23-58.archive
The database backup is created and a confirmation prompt appears asking to
delete the database (y/n).
Enter y to delete the database.
Enter n to not delete the database.
Enter No to not delete the database and apply only missing data(s) from backup
file.
Backup and Restore Cisco ONP Database
Documents / Resources
|
Cisco Backup and Restore ONP Database
Software
[pdf] User Guide
Backup and Restore ONP Database Software, Restore ONP Database Software, ONP
Database Software, Database Software, Software
---|---
Read User Manual Online (PDF format)
Read User Manual Online (PDF format) >>