Installation Guides
DB Backup and Restore Procedur...
Database Backup and Restore Procedure
2min
Perform the following steps only if the database backup is required.
- Switch user to enterprisedb. [root@kronpam~]# su – enterprisedb
- Set the password variable. [enterprisedb@kronpam~]$ export PGPASSWORD="1qaz2wsx"
- 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
- 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
To import a database, you need to install a new database and remove the default Kron PAM parameters or existing schemas.
- Set password variable. [enterprisedb@kronpam~]$ export PGPASSWORD="1qaz2wsx".
- 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;
- 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;
- 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"