2 Replies Latest reply: Feb 17, 2018 6:37 PM by Shirajul Kabir Rab RSS

    Qlik Sense Repository Backup Automation

    Shirajul Kabir Rab



      I have been looking to automate the QS repository backup process using PS. So far I have found some really helpful posts here (Automating a Qlik Sense Site backup ) that has worked for people. I have tried that approach but I am stuck at the authentication to the postgres. I get the following error -


      "pg_dump: [archiver (db)] connection to database "QSR" failed: fe_sendauth: no password supplied"


      Anyone else having or had this issue that you have managed to resolve?


      I have created the "pgpass.conf" in "C:\Program Files\Qlik\Sense\Repository\PostgreSQL\9.6\bin\" as per below -



      I have also created "pg_hba.conf" in "C:\Program Files\Qlik\Sense\Repository\PostgreSQL\9.6\share" as per below -


      # Allow any user on the local system to connect to any database with

      # any database user name using Unix-domain sockets (the default for local

      # connections).


      # TYPE  DATABASE        USER            ADDRESS                 METHOD

      local        all                       all                                                     trust


      My PS script look as per below -


      $Today = Get-Date -UFormat "%Y%m%d_%H%M"

      $StartTime = Get-Date -UFormat "%Y%m%d_%H%M"

      $PostGreSQLLocation = "C:\Program Files\Qlik\Sense\Repository\PostgreSQL\9.6\bin"

      $PostGresBackupTarget = "C:\Qlik_Backups"


      # Shared Persistance Folder

      $SenseProgramData = "...."

      $Today = Get-Date -UFormat "%Y%m%d_%H%M"

      $StartTime = Get-Date -UFormat "%Y%m%d_%H%M"


      write-host "Stopping Qlik Services ...."

      stop-service QlikSenseProxyService -WarningAction SilentlyContinue

      stop-service QlikSenseEngineService -WarningAction SilentlyContinue

      stop-service QlikSenseSchedulerService -WarningAction SilentlyContinue

      stop-service QlikSensePrintingService -WarningAction SilentlyContinue

      stop-service QlikSenseServiceDispatcher -WarningAction SilentlyContinue

      stop-service QlikSenseRepositoryService -WarningAction SilentlyContinue


      write-host "Backing up PostgreSQL Repository Database ...."


      cd $PostGreSQLLocation


      .\pg_dump.exe -h localhost -p 4432 -U postgres -w -F t -f "$PostGresBackupTarget\QSR_backup_$Today.tar" QSR


      write-host "PostgreSQL backup Completed"


      Any help with this would be much appreciated. or a solution as to how we can automate the repository backup process.