Restore Your Vision Database
Use the following tasks to restore your Vision database running on both Windows and Linux, and for both non-appliance and appliance versions of your Vision database.

- Stop the Vision services.
- Log on to the Vision server as administrator.
- From the Services panel, stop the Quantum Vision service.
- Restore the Vision database.
- Change your directory location to c:\Program Files (x86)\Quantum Vision\database.
- In the database folder, select and delete the existing rrd folder.
- Replace the deleted rrd folder with a backed-up rrd folder.
- Open a command window and run the following commands:
"C:\Program Files (x86)\Quantum Vision\database\PostgreSQL\8.4\bin\dropdb" -U postgres visiondb
"C:\Program Files (x86)\Quantum Vision\database\PostgreSQL\8.4\bin\createdb" -U postgres visiondb
"C:\Program Files (x86)\Quantum Vision\database\PostgreSQL\8.4\bin\pg_restore" -U postgres -d visiondb visiondb.pgdump
Error Message
When restoring the database, you might encounter the following error message. If so, disregard it.
# /opt/quantum-vision/database/PostgreSQL/8.4/bin/pg_restore - U postgres -d visiondb visiondb.pgdump
pg_reste: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 578; 2612 16386 PROCEDURAL LANGUAGE plpgsql postgres
pg_restore: [archiver (db)] could not execute query: ERROR: language "plpgsql" already exists
Command was: CREATE PROCEDURAL LANGUAGE plpgsql;
WARNING: errors ignored on restore: 1 - Restart the Vision services.
Log on to the Vision server as administrator.
- From the Services panel, start the Quantum Vision service.

- Stop the Vision services.
- Log on to the Vision server as root.
- Run the command
service vision stop
.
- Restore the Vision database.
- Change your directory location to opt/quantum-vision/database.
- In the database directory, select and delete the existing rrd subdirectory.
- Replace the deleted rrd subdirectory with a backed-up rrd subdirectory.
- Open a terminal window and run the following commands:
/opt/quantum-vision/database/PostgreSQL/8.4/bin/dropdb -U postgres visiondb
/opt/quantum-vision/database/PostgreSQL/8.4/bin/createdb -U postgres visiondb
/opt/quantum-vision/database/PostgreSQL/8.4/bin/pg_restore -U postgres -d visiondb visiondb.pgdump
Error Message
When restoring the database, you might encounter the following error message. If so, disregard it.
# /opt/quantum-vision/database/PostgreSQL/8.4/bin/pg_restore - U postgres -d visiondb visiondb.pgdump
pg_reste: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 578; 2612 16386 PROCEDURAL LANGUAGE plpgsql postgres
pg_restore: [archiver (db)] could not execute query: ERROR: language "plpgsql" already exists
Command was: CREATE PROCEDURAL LANGUAGE plpgsql;
WARNING: errors ignored on restore: 1 - Start the Vision services.
Log on to the Vision server as root.
- Run the command
service vision start
.

- Log on to the appliance as the sysadmin user.
- At the prompt, run the command
admin restore
. - Enter the following information at the appropriate prompts:
- The IP address of the remote server on which the backed-up database is stored.
- The user name and password for the remote server.
- The file name of the database backup that you want to restore.
- The SSH port number (default: 22) for the remote server.
Result
The Vision appliance retrieves the backup archive using secure copy with the provided credentials, and then restores the database on the appliance.