Ad Widget

Collapse

Zabbix Server Migration PostgreSQL and TimescaleDB

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • d.roeper
    Junior Member
    • Feb 2022
    • 17

    #1

    Zabbix Server Migration PostgreSQL and TimescaleDB

    Hello,

    I would like to migrate my complete Zabbix 6.0 LTS installation to a new server

    old server:
    Ubuntu 20.04 LTS with PostgreSQL 13 and TimescaleDB 2.7.0

    new server:
    Debian 11 with PostgreSQL 13 and TimescaleDB 2.7.0

    the new server is also already running with a newly created database. My idea now was
    - disable Zabbix services on the old and new server
    - export database
    - Copy export to the new server
    - import database
    - start Zabbix service on the new server

    Unfortunately, it already hangs with me when exporting the database:​

    Code:
    # sudo su - postgres
    # pg_dump -S postgres zabbix --disable-triggers > /tmp/dbexport.pgsql​
    pg_dump: Warnung: Es gibt zirkuläre Fremdschlüssel-Constraints für diese Tabelle:
    pg_dump: hypertable
    pg_dump: Möglicherweise kann der Dump nur wiederhergestellt werden, wenn --disable-triggers verwendet wird oder die Constraints vorübergehend entfernt werden.
    pg_dump: Führen Sie einen vollen Dump statt eines Dumps mit --data-only durch, um dieses Problem zu vermeiden.
    pg_dump: Warnung: Es gibt zirkuläre Fremdschlüssel-Constraints für diese Tabelle:
    pg_dump: chunk
    pg_dump: Möglicherweise kann der Dump nur wiederhergestellt werden, wenn --disable-triggers verwendet wird oder die Constraints vorübergehend entfernt werden.
    pg_dump: Führen Sie einen vollen Dump statt eines Dumps mit --data-only durch, um dieses Problem zu vermeiden.
    pg_dump: HINWEIS: hypertable data are in the chunks, no data will be copied
    DETAIL: Data for hypertables are stored in the chunks of a hypertable so COPY TO of a hypertable will not copy any data.
    TIP: Use "COPY (SELECT * FROM <hypertable>) TO ..." to copy all data in hypertable, or copy each chunk individually.
    pg_dump: HINWEIS: hypertable data are in the chunks, no data will be copied
    DETAIL: Data for hypertables are stored in the chunks of a hypertable so COPY TO of a hypertable will not copy any data.
    TIP: Use "COPY (SELECT * FROM <hypertable>) TO ..." to copy all data in hypertable, or copy each chunk individually.
    pg_dump: HINWEIS: hypertable data are in the chunks, no data will be copied
    then also started the export with --disable-triggers, which led to the same error.

    I'm sure someone has done the migration before. Probably there is also a docu for it at zabbix, but unfortunately I can't find anything suitable.
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    If all the versions are same, then why not just copy over all the files from data directory instead of data export/import?

    And it is not exactly a Zabbix issue, but a DB related, if you want to move your DB-s around..

    Comment

    • d.roeper
      Junior Member
      • Feb 2022
      • 17

      #3
      Thanks for the info,

      that it is so simple I would not have thought now. But actually stop services on both servers with rsync copy everything to the other server. Start service and be happy

      Comment

      Working...