Home Forums Miria forums – EN Miria : How To ? Restore Miria PostgreSQL DB – Windows

Viewing 0 reply threads
  • Author
    • #10480
      Eric CollartEric Collart

        Note: Restoration method changed for Miria 2021 R2 (3.14) and later, the below procedure cannot be used for those newer versions.

        Tested with Miria installed in folder c:\Miria on a Windows Server 2019 Standard.
        Standard PostgreSQL port 5433 is used.
        Test DB to restore is compressed, named TESTDB_5433_DATA_Backup.bz2 and located in Administrator’s download folder.
        Note: this article doesn’t handle AMM databse restore.

        1. Prepare new Windows server
        2. Let first Windows updates run and reboot
        3. Install good version of Miria Server + AMM Server if needed
        4. Install Admin UI or use the Web UI
        5. Connect to Miria as Admin (and define first password)
        6. Disconnect Admin
        7. Start a Command Prompt as Administrator
        8. Stop services:
          1. net stop ADA
          2. net stop mm_agent
          3. net stop mm_server
          4. net stop mm_db
          5. net stop ADADB_ADA
        9. Check there is no more process with name starting by “ada” (Task Manager)
        10. Rename actual data folder to data.old
          1. cd c:\Miria\Database\PostgreSQL
          2. move data data.old
        11. Copy an empty data cluster (provided by Miria)
          1. mkdir data
          2. copy c:\Miria\Tools\empty_ADA_cluster.zip c:\Miria\Database\PostgreSQL\data
          3. cd data
          4. PowerShell Expand-Archive -Path empty_ADA_cluster.zip -DestinationPath .
        12. Copy the previous database configuration
          1. copy ..\data.old\postgresql.conf .
        13. Restart the PostgreSQL ADADB_ADA service
          1. net start ADADB_ADA
        14. Unzip the backup file if compressed
          1. c:\Miria\Tools\bzip2 -d C:\Users\Administrator\Downloads\TESTDB_5433_DATA_Backup.bz2
        15. Restore the database
          1. cd c:\Miria\Database\PostgreSQL\bin
          2. psql.exe -p 5433 -q -f ..\TESTDB_5433_DATA_Backup -U postgres
            1. Enter “postgres” without the quote as password
        16. Restart Miria services
          1. net start mm_db
          2. net start mm_server
          3. net start mm_agent
          4. net start ADA
        17. If all OK, don’t forget to set back all services in “automatic”
        Spread the love
    Viewing 0 reply threads
    • You must be logged in to reply to this topic.