Difference between revisions of "Backup and Restore a GigaFlow Configuration"

From Observer GigaFlow Support | VIAVI Solutions Inc.
Jump to: navigation, search
Line 14: Line 14:
 
# In the '''Services (Local)''' list, find the '''postgresqlXXXXX''' service.
 
# In the '''Services (Local)''' list, find the '''postgresqlXXXXX''' service.
 
# Right-click the '''postgresqlXXXXX''' service, and select the '''Properties''' option.  
 
# Right-click the '''postgresqlXXXXX''' service, and select the '''Properties''' option.  
# From the '''General''' tab,  copy the '''"path to executable"'''.<br />'''Note:''' This is the location required to run the next commands on (for example, '''D:\Program Files\PostgreSQL\11\bin\''').
+
# From the '''General''' tab,  copy the '''"path to executable"'''.<br />'''Note:''' This is the location required to run the backup and restore commands on (for example, '''D:\Program Files\PostgreSQL\11\bin\''').
# Open an administrator command prompt, change to that folder and follow the backup/restore instructions below.
+
# Open an administrator command prompt shell, and change the current working directory to that folder.
  
 +
== Backing up ==
 +
 +
# Run: <br /><code>pg_dump -E UTF8 --table=attributecategories --table=attributevalues_0 --table=attributevalues_1 --table=attributevalues_2 --table=attributevalues_3 --table=attributevalues_4 --table=attributevalues_5 --table=attributevalues_6 --table=blacklistslocal --table=blacklistslocalentries --table=blacklistsources --table=customerdevicesettings --table=customersettings --table=dataaccessgroupmembers --table=dataaccessgroups --table=definedapplications --table=deviceinterfaces --table=devices  --table=eventtriggers --table=eventtypes --table=flowobjects --table=forensicsreports --table=geoips --table=gigastors --table=integrations --table=interfacefilters --table=interfacealertsettings --table=interfacetypes --table=ldapgroups --table=ldapusers --table=ldapnestedgroups --table=multiservertargets --table=networkaudits --table=pentypes --table=penvendors --table=portalusers --table=portparams --table=profilers --table=profilerstoallowedprofiles --table=profilerstoentryprofiles --table=queryfielderservers --table=reportlinks --table=reportnameoverrides --table=savedreports --table=serverparams --table=serversubnetport --table=serversubnets --table=snmppollerclasses --table=snmppollerclassesforsysoid --table=sqlreports --table=standardapplications --table=stattypes --table=syslogprocessors --table=syslogprocessorsdefault  --table=trafficgroups --table=trafficgroupsdeployed --table=trafficgroupsubnets --table=eventrunners --table=eventrunners_versioned --table=definedservers --table=usergroups --table=userldapsettings --table=userpermissions --table=users --table=whitelist --table=aws_s3_bucket_config --table=awsconnections --table=cloudinstancetoip --table=fwevent --table=fwextcode --table=fwextcodestoappids --table=netflowignores --table=statnames --host=127.0.0.1 -U myipfix -f GigaFlowConfigBackup.sql</code>
 +
# You may be prompted for the database password, i.e. <strong>myipfix</strong>. This will create the file '''GigaFlowConfigBackup.sql''' in the current directory. Move this to wherever you archive configurations.
  
 
=== Binaries For Linux ===  
 
=== Binaries For Linux ===  
Line 23: Line 27:
 
# Here, '''"/usr/pgsql-11/bin/"''' is the location of the required file, change into that directory and follow the backup/restore instructions below.
 
# Here, '''"/usr/pgsql-11/bin/"''' is the location of the required file, change into that directory and follow the backup/restore instructions below.
  
== Backing up ==
 
  
# Run: <br /><code>pg_dump -E UTF8 --table=attributecategories --table=attributevalues_0 --table=attributevalues_1 --table=attributevalues_2 --table=attributevalues_3 --table=attributevalues_4 --table=attributevalues_5 --table=attributevalues_6 --table=blacklistslocal --table=blacklistslocalentries --table=blacklistsources --table=customerdevicesettings --table=customersettings --table=dataaccessgroupmembers --table=dataaccessgroups --table=definedapplications --table=deviceinterfaces --table=devices  --table=eventtriggers --table=eventtypes --table=flowobjects --table=forensicsreports --table=geoips --table=gigastors --table=integrations --table=interfacefilters --table=interfacealertsettings --table=interfacetypes --table=ldapgroups --table=ldapusers --table=ldapnestedgroups --table=multiservertargets --table=networkaudits --table=pentypes --table=penvendors --table=portalusers --table=portparams --table=profilers --table=profilerstoallowedprofiles --table=profilerstoentryprofiles --table=queryfielderservers --table=reportlinks --table=reportnameoverrides --table=savedreports --table=serverparams --table=serversubnetport --table=serversubnets --table=snmppollerclasses --table=snmppollerclassesforsysoid --table=sqlreports --table=standardapplications --table=stattypes --table=syslogprocessors --table=syslogprocessorsdefault  --table=trafficgroups --table=trafficgroupsdeployed --table=trafficgroupsubnets --table=eventrunners --table=eventrunners_versioned --table=definedservers --table=usergroups --table=userldapsettings --table=userpermissions --table=users --table=whitelist --table=aws_s3_bucket_config --table=awsconnections --table=cloudinstancetoip --table=fwevent --table=fwextcode --table=fwextcodestoappids --table=netflowignores --table=statnames --host=127.0.0.1 -U myipfix -f GigaFlowConfigBackup.sql</code>
 
# You may be prompted for the database password, i.e. <strong>myipfix</strong>. This will create the file '''GigaFlowConfigBackup.sql''' in the current directory. Move this to wherever you archive configurations.
 
  
 
== Restoring From a GigaFlow Configuration Backup ==
 
== Restoring From a GigaFlow Configuration Backup ==

Revision as of 14:00, 20 October 2023


It is important to create a backup of the configuration after you did the changes to the GigaFlow server’s configuration.

Contents

Creating a GigaFlow configuration backup for use on a new server on Windows

All the settings made to Gigaflow are stored in the Postgresql database. Thus, it is necessary to use the Postgres pg_dump command to perform the backup.

Find the binaries for windows

The binaries will be installed in the Postgres installation folder. To find this folder, perform the following steps:

  1. Open the Services panel in Windows.
  2. In the Services (Local) list, find the postgresqlXXXXX service.
  3. Right-click the postgresqlXXXXX service, and select the Properties option.
  4. From the General tab, copy the "path to executable".
    Note: This is the location required to run the backup and restore commands on (for example, D:\Program Files\PostgreSQL\11\bin\).
  5. Open an administrator command prompt shell, and change the current working directory to that folder.

Backing up

  1. Run:
    pg_dump -E UTF8 --table=attributecategories --table=attributevalues_0 --table=attributevalues_1 --table=attributevalues_2 --table=attributevalues_3 --table=attributevalues_4 --table=attributevalues_5 --table=attributevalues_6 --table=blacklistslocal --table=blacklistslocalentries --table=blacklistsources --table=customerdevicesettings --table=customersettings --table=dataaccessgroupmembers --table=dataaccessgroups --table=definedapplications --table=deviceinterfaces --table=devices --table=eventtriggers --table=eventtypes --table=flowobjects --table=forensicsreports --table=geoips --table=gigastors --table=integrations --table=interfacefilters --table=interfacealertsettings --table=interfacetypes --table=ldapgroups --table=ldapusers --table=ldapnestedgroups --table=multiservertargets --table=networkaudits --table=pentypes --table=penvendors --table=portalusers --table=portparams --table=profilers --table=profilerstoallowedprofiles --table=profilerstoentryprofiles --table=queryfielderservers --table=reportlinks --table=reportnameoverrides --table=savedreports --table=serverparams --table=serversubnetport --table=serversubnets --table=snmppollerclasses --table=snmppollerclassesforsysoid --table=sqlreports --table=standardapplications --table=stattypes --table=syslogprocessors --table=syslogprocessorsdefault --table=trafficgroups --table=trafficgroupsdeployed --table=trafficgroupsubnets --table=eventrunners --table=eventrunners_versioned --table=definedservers --table=usergroups --table=userldapsettings --table=userpermissions --table=users --table=whitelist --table=aws_s3_bucket_config --table=awsconnections --table=cloudinstancetoip --table=fwevent --table=fwextcode --table=fwextcodestoappids --table=netflowignores --table=statnames --host=127.0.0.1 -U myipfix -f GigaFlowConfigBackup.sql
  2. You may be prompted for the database password, i.e. myipfix. This will create the file GigaFlowConfigBackup.sql in the current directory. Move this to wherever you archive configurations.

Binaries For Linux

  1. Open a terminal window with suitable permissions.
  2. Run the following command "ps aux | grep postmaster". You should get an output similar to postgres 1834 0.0 0.4 17464052 443692 ? Ss Jul10 0:02 /usr/pgsql-11/bin/postmaster -D /var/lib/pgsql/11/data/.
  3. Here, "/usr/pgsql-11/bin/" is the location of the required file, change into that directory and follow the backup/restore instructions below.


Restoring From a GigaFlow Configuration Backup

Warning: the following process will drop the existing database on the server.

  1. Stop the GigaFlow service (GigaFlow for windows or systemctl stop rosd for linux).
  2. Upload the required GigaFlowConfigBackup.sql file to the machine.
  3. psql --host=127.0.0.1 --username=myipfix -c "drop database myipfix" postgres //Only if getting rid of old data, you will have to "\c postgres" first and make sure gigaflow is stopped
  4. psql --host=127.0.0.1 --username=myipfix -c "create database myipfix owner=myipfix" postgres
  5. psql --host=127.0.0.1 --username=myipfix < ./GigaFlowConfigBackup.sql
  6. You may be prompted for the database password, i.e. myipfix.
  7. Restart GigaFlow.


  1. Run the following command if you want to reset the serverid on a new box:
    psql --host=127.0.0.1 --username=myipfix -c "delete from serverparams where key in('serverid','installtime','license')"