You might want to import/export the PostgreSQL DB in the following situations:

  • Moving the DB from one server to another (for example, staging to production).
  • Moving from one architecture to another (HA, external DB).

Export Siemplify databases

  1. Change to postgres user by using this command:
    su postgres
  2. Execute the following commands by using the pg_dump command:
pg_dump siemplify_agents_db>siemplify_agents_db.bak
pg_dump siemplify_dashboards_db>siemplify_dashboards_db.bak
pg_dump siemplify_entityexplorer_db>siemplify_entityexplorer_db.bak
pg_dump siemplify_homepage_db>siemplify_homepage_db.bak
pg_dump siemplify_integrations_db>siemplify_integrations_db.bak
pg_dump siemplify_jobs_db>siemplify_jobs_db.bak
pg_dump siemplify_metadata_db>siemplify_metadata_db.bak
pg_dump siemplify_monitoring_db>siemplify_monitoring_db.bak
pg_dump siemplify_notifications_db>siemplify_notifications_db.bak
pg_dump siemplify_ontology_db>siemplify_ontology_db.bak
pg_dump siemplify_orchestration_db>siemplify_orchestration_db.bak
pg_dump siemplify_report_system_db>siemplify_report_system_db.bak
pg_dump siemplify_search_everything_db>siemplify_search_everything_db.bak
pg_dump siemplify_system_db>siemplify_system_db.bak
pg_dump siemplify_war_room_db>siemplify_war_room_db.bak
  1. Verify that all the backup files are in the current folder:
  2. Move these files into the postgres folder (in the target server) using this command:

Import Backup Files

  1. Connect to the DB via CLI as follows:
    sudo -u postgres psql
  1. Delete the existing databases (by using the DROP command):
DROP DATABASE siemplify_dashboards_db;
DROP DATABASE siemplify_agents_db;
DROP DATABASE siemplify_entityexplorer_db;
DROP DATABASE siemplify_homepage_db;
DROP DATABASE siemplify_integrations_db;
DROP DATABASE siemplify_jobs_db;
DROP DATABASE siemplify_metadata_db;
DROP DATABASE siemplify_monitoring_db;
DROP DATABASE siemplify_notifications_db;
DROP DATABASE siemplify_ontology_db;
DROP DATABASE siemplify_orchestration_db;
DROP DATABASE siemplify_report_system_db;
DROP DATABASE siemplify_search_everything_db;
DROP DATABASE siemplify_system_db;
DROP DATABASE siemplify_war_room_db;
  1. Create new (and empty) databases:
CREATE DATABASE siemplify_agents_db;
CREATE DATABASE siemplify_dashboards_db;
CREATE DATABASE siemplify_entityexplorer_db;
CREATE DATABASE siemplify_homepage_db;
CREATE DATABASE siemplify_integrations_db;
CREATE DATABASE siemplify_jobs_db;
CREATE DATABASE siemplify_metadata_db;
CREATE DATABASE siemplify_monitoring_db;
CREATE DATABASE siemplify_notifications_db;
CREATE DATABASE siemplify_ontology_db;
CREATE DATABASE siemplify_orchestration_db;
CREATE DATABASE siemplify_report_system_db;
CREATE DATABASE siemplify_search_everything_db;
CREATE DATABASE siemplify_system_db;
CREATE DATABASE siemplify_war_room_db;
  1. Change the owner of the DB to the local user using by siemplify (default – sa)
ALTER DATABASE siemplify_agents_db OWNER TO sa;
ALTER DATABASE siemplify_dashboards_db OWNER TO sa;
ALTER DATABASE siemplify_entityexplorer_db OWNER TO sa;
ALTER DATABASE siemplify_homepage_db OWNER TO sa;
ALTER DATABASE siemplify_integrations_db OWNER TO sa;
ALTER DATABASE siemplify_jobs_db OWNER TO sa;
ALTER DATABASE siemplify_metadata_db OWNER TO sa;
ALTER DATABASE siemplify_monitoring_db OWNER TO sa;
ALTER DATABASE siemplify_notifications_db OWNER TO sa;
ALTER DATABASE siemplify_ontology_db OWNER TO sa;
ALTER DATABASE siemplify_orchestration_db OWNER TO sa;
ALTER DATABASE siemplify_report_system_db OWNER TO sa;
ALTER DATABASE siemplify_search_everything_db OWNER TO sa;
ALTER DATABASE siemplify_system_db OWNER TO sa;
ALTER DATABASE siemplify_war_room_db OWNER TO sa;
  1. Verify the databases. They should display as in the screenshot below:
  1. Exit postgres, and change the user to postgres by using this command:
    su postgres
  1. Make sure that all the .bak files are located in the postgres folder:
  1. Run the following commands to load the .bak files into the empty databases:
psql -U postgres siemplify_dashboards_db < siemplify_dashboards_db.bak
psql -U postgres siemplify_agents_db<siemplify_agents_db.bak
psql -U postgres siemplify_entityexplorer_db<siemplify_entityexplorer_db.bak
psql -U postgres siemplify_homepage_db<siemplify_homepage_db.bak
psql -U postgres siemplify_integrations_db<siemplify_integrations_db.bak
psql -U postgres siemplify_jobs_db<siemplify_jobs_db.bak
psql -U postgres siemplify_metadata_db<siemplify_metadata_db.bak
psql -U postgres siemplify_monitoring_db<siemplify_monitoring_db.bak
psql -U postgres siemplify_notifications_db<siemplify_notifications_db.bak
psql -U postgres siemplify_ontology_db<siemplify_ontology_db.bak
psql -U postgres siemplify_orchestration_db<siemplify_orchestration_db.bak
psql -U postgres siemplify_report_system_db<siemplify_report_system_db.bak
psql -U postgres siemplify_search_everything_db<siemplify_search_everything_db.bak
psql -U postgres siemplify_system_db<siemplify_system_db.bak
psql -U postgres siemplify_war_room_db<siemplify_war_room_db.bak
  1. Run Siemplify server and validate the database (cases, playbooks, users, etc.)

Need more help with this?
Click here to open a Support ticket

Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.