Restoring Product Data from Backup
Here is how to restore Paragon Active Assurance data from backup files. In this chapter, the backup files are assumed to be named in the same way as in the chapter Backing Up Product Data.
The procedure that follows requires that Control Center has been installed (so that the
netrounds
database exists).
-
Stop all Paragon Active Assurance services that are accessing the database:
sudo systemctl stop "netrounds-*" apache2 kafka openvpn@netrounds
-
Drop the PostgreSQL database:
sudo -u postgres psql -c "DROP DATABASE netrounds;"
-
Recreate the database:
sudo -u postgres psql -c "CREATE DATABASE netrounds OWNER netrounds \ENCODING 'UTF8' TEMPLATE 'template0';"
-
Restore the database:
sudo -u postgres psql --set ON_ERROR_STOP=on netrounds < ncc_postgres.sql
Setting
ON_ERROR_STOP
to on will cause psql to exit if an error occurs. For further details, see the PostgreSQL documentation: https://www.postgresql.org/docs/9.4/backup-dump.html#BACKUP-DUMP-RESTORE.There are several options for the backup format. Please refer to the psql documentation (https://www.postgresql.org/docs/) if you are using anything other than plain .sql.
If you are restoring from a backup of an earlier version of Control Center than the one you currently have installed, you also need to run
sudo ncc migrate
.Note:Netrounds versions prior to 2.29 used a MySQL database. If you are restoring such a database, please use this command instead:
mysql --user=root --database=netrounds --password < ncc_mysql.sql
If you backed up the database in binary format, use this command to restore it:
pg_restore -Fc -h localhost -d netrounds -c --verbose --disable-triggers netrounds_db.bak -U netrounds --password
-
Restore the OpenVPN keys:
# Remove any existing OpenVPN keys sudo rm -rf /var/lib/netrounds/openvpn # Unpack the backed-up keys sudo tar -xzf ncc_openvpn.tar.gz -C /
-
Restore RRD files, either from a tarball or from a snapshot. Compare the chapter Backing Up Product Data. In the tarball case, the procedure is as follows:
# Remove any existing RRDs sudo rm -rf /var/lib/netrounds/rrd # Unpack the backed-up RRDs sudo tar -xzf ncc_rrd.tar.gz -C /
-
Copy the configuration files into their original locations.
-
Copy the license files into their original location. (Alternatively, you may download the license files once more from the Juniper EMS Portal and apply them using the
ncc license activate
command, as explained in the Installation Guide.) -
Start Paragon Active Assurance services:
sudo systemctl start --all "netrounds-*" apache2 kafka openvpn@netrounds