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

From Observer GigaFlow Support | VIAVI Solutions Inc.
Jump to: navigation, search
(27 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Category:Database]]
+
[[Category:Database]][[Category:Installation]]
 
+
== Creating a GigaFlow Configuration Backup For Use On A New Server ==
  
 
After making changes to the GigaFlow server’s configuration, it’s important to make a backup of the configuration.
 
After making changes to the GigaFlow server’s configuration, it’s important to make a backup of the configuration.
Line 8: Line 8:
 
# Open a Windows command prompt as administrator.
 
# Open a Windows command prompt as administrator.
 
# Assuming that the PostgreSQL path has been added to windows, you can run the pg_dump command below directly. If not, either add it to the path or change the active directory to <code>C:\Program Files\PostgreSQL\X.X\bin</code>, where X.X is the PostgreSQL revision, e.g 9.5.
 
# Assuming that the PostgreSQL path has been added to windows, you can run the pg_dump command below directly. If not, either add it to the path or change the active directory to <code>C:\Program Files\PostgreSQL\X.X\bin</code>, where X.X is the PostgreSQL revision, e.g 9.5.
# Run: <!--<p><code>
+
# Run: <br /><code>"D:\Program Files\PostgreSQL\10\bin\pg_dump.exe"  --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=gigastores --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=usergroups --table=userldapsettings --table=userpermissions --table=users --table=whitelist -U myipfix -f c:/temp/GigaFlowConfigBackup.sql</code>
pg_dump --host 127.0.0.1 --username=myipfix –exclude table="macaddressvendors" --exclude-table="userevent* --exclude-table="systemhealt*" --exclude-table="savedreportdata" --exclude-table="netflow*"  --exclude-table="arp*"  --exclude-table="cam*"  --exclude-table="searchip*" --exclude-table="all*" --exclude-table="events*" --exclude-table="all*" --exclude-table="profilingstats*" --exclude-table="summary*" --dbname=myipfix --clean --create --file=GigaFlowConfigBackup.sql
+
# You may be prompted for the database password, i.e. <strong>myipfix</strong>. This will create the file GigaFlowConfigBackup.sql in the active directory. Move this to wherever you archive configurations.
</code></p>-->
+
# You may be prompted for the database password, i.e. <strong>myipfix</strong>. This will create the file GigaFlowConfigBackup.sql in the active directory. Move this to wherever you archive configurations.
+
 
+
  
The following commands will create a db dump of the flowsec configuration. The only thing you should be prompted for is the 'myipfix' password. This will then create the file flowsecdump.sql in your current folder.
+
== Restoring From a GigaFlow Configuration Backup ==
  
<code>
+
<strong>Warning: the following process will drop the existing database on the server.</strong>
pg_dump --host 127.0.0.1 --username=myipfix --exclude-table="macaddressvendors" --exclude-table="userevent*"  --exclude-table="systemhealt*" --exclude-table="savedreportdata" --exclude-table="netflow*"  --exclude-table="arp*"  --exclude-table="cam*"  --exclude-table="searchip*"  --exclude-table="all*" --exclude-table="events*" --exclude-table="all*"  --exclude-table="profilingstats*" --exclude-table="summary*" --dbname=myipfix --clean --create --file=flowsecdump.sql
+
</code>
+
  
When restoring (this will drop the existing database on the server!!), stop the flowsec service, upload flowsecdump.sql file to the new machine and execute the following (supply the 'myipfix' password when prompted)
+
# Stop the GigaFlow service (GigaFlow.exe for windows or /etc/init.d/rosd for linux).
 +
# Upload the required GigaFlowConfigBackup.sql file to the machine.
 +
# 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'''
 +
# psql --host=127.0.0.1 --username=myipfix -c "create database myipfix owner=myipfix"  postgres
 +
# <code>psql --host=127.0.0.1 --username=myipfix < ./GigaFlowConfigBackup.sql<br />
 +
# You may be prompted for the database password, i.e. <strong>myipfix</strong>.
 +
# Restart GigaFlow.
  
<code>
 
psql --host 127.0.0.1 --username=myipfix < ./flowsecdump.sql
 
psql --host 127.0.0.1 --username=myipfix -c "delete from serverparams where key in('serverid','installtime','license')"
 
</code>
 
  
Now restart flowsec.
+
# Run below if you want to reset serverid on a new box:<br />psql --host 127.0.0.1 --username=myipfix -c "delete from serverparams where key in('serverid','installtime','license')"</code>

Revision as of 14:52, 12 August 2021

Creating a GigaFlow Configuration Backup For Use On A New Server

After making changes to the GigaFlow server’s configuration, it’s important to make a backup of the configuration.

Using Windows:

  1. Open a Windows command prompt as administrator.
  2. Assuming that the PostgreSQL path has been added to windows, you can run the pg_dump command below directly. If not, either add it to the path or change the active directory to C:\Program Files\PostgreSQL\X.X\bin, where X.X is the PostgreSQL revision, e.g 9.5.
  3. Run:
    "D:\Program Files\PostgreSQL\10\bin\pg_dump.exe" --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=gigastores --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=usergroups --table=userldapsettings --table=userpermissions --table=users --table=whitelist -U myipfix -f c:/temp/GigaFlowConfigBackup.sql
  4. You may be prompted for the database password, i.e. myipfix. This will create the file GigaFlowConfigBackup.sql in the active directory. Move this to wherever you archive configurations.

Restoring From a GigaFlow Configuration Backup

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

  1. Stop the GigaFlow service (GigaFlow.exe for windows or /etc/init.d/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 below if you want to reset serverid on a new box:
    psql --host 127.0.0.1 --username=myipfix -c "delete from serverparams where key in('serverid','installtime','license')"