Installation Guides
DB Backup and Restore Procedur...

Database Backup and Restore Procedure

2min

Perform the following steps only if the database backup is required.

Backing up Database

  1. Switch user to enterprisedb. [root@kronpam~]# su – enterprisedb
  2. Set the password variable. [enterprisedb@kronpam~]$ export PGPASSWORD="1qaz2wsx"
  3. Export the radius schema. [enterprisedb@kronpam~]$ /u01/PostgresPlus/9.5AS/bin/pg_dump -p 5444 -w -U enterprisedb -n radius -Fp -f "backup_schema_radius.dmp" aioc
  4. Export the aioc schema. [enterprisedb@kronpam~]$ /u01/PostgresPlus/9.5AS/bin/pg_dump -p 5444 -w -U enterprisedb -n aioc -Fp -f "backup_schema_aioc.dmp" aioc

Restoring Database

To import a database, you need to install a new database and remove the default Kron PAM parameters or existing schemas.

  1. Set password variable. [enterprisedb@kronpam~]$ export PGPASSWORD="1qaz2wsx".
  2. Connect to the new database and create users. Change the passwords with proper values. [enterprisedb@kronpam~]$ ./psql -p 5444 -d edb -U enterprisedb edb=# CREATE ROLE aioc LOGIN PASSWORD ‘aioc’ SUPERUSER INHERIT CREATEDB CREATEROLE REPLICATION; edb=# CREATE ROLE radius LOGIN PASSWORD ‘radius’ SUPERUSER INHERIT CREATEDB CREATEROLE  REPLICATION; edb=# ALTER ROLE aioc SET search_path = "$user", public, radius; edb=# ALTER ROLE radius SET search_path = "$user", aioc, public;
  3. Create aioc table. edb=# CREATE DATABASE aioc WITH OWNER = aioc ENCODING = 'UTF8' TABLESPACE = pg_default LC_COLLATE = 'en_US.utf8' LC_CTYPE = 'en_US.utf8' CONNECTION LIMIT = -1;
  4. Import schemas. [enterprisedb@kronpam~]$ ./psql -p 5444 -d aioc -U enterprisedb -f "backup_schema_radius.dmp" [enterprisedb@kronpam~]$ ./psql -p 5444 -d aioc -U enterprisedb -f "backup_schema_aioc.dmp"