Ad Widget

Collapse

Migrating users/groups

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RoyK
    Junior Member
    • Jan 2016
    • 20

    #1

    Migrating users/groups

    Hi all

    I have an old zabbix server, v5, and a new one, v6. After several issues migrating templates (the new ones had different names and just migrating was problematic), we chose to setup a new system from scratch. Migrating the config seems to be easy, but not the users/groups. Authentication is done by LDAP, so no issues with passwords, those few local accounts that exists can be recreated manually. But - how can we export/import the users and groups? I have asked around and it seems the answer is 'Use the API', but since that seems to be a long shot, is there anything readymade to do this without reinventing this wheel?

    roy
  • marco.lima
    Junior Member
    • Aug 2020
    • 8

    #2
    I sympathize with you. I went through the same issue during the pandemic when we had to rebuild our setup from scratch. I also toyed with the idea of using the API but didn't go through with it.

    I suppose you could consider doing a direct copy from your old database to the new one...provided you map out the necessary table dependencies and such....

    Here's what I did:

    - I called our intern over and said: "Guess what you'll be doing for the next couple of days...? *wink* *wink*" (it took him 3 recreate 125 users lol)

    Comment

    • RoyK
      Junior Member
      • Jan 2016
      • 20

      #3
      Give me a day or two and we'll post the code to do it the api way

      Comment

      • cyber
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • Dec 2006
        • 4811

        #4
        Table structures are identical I think... (4.4 vs 6 are, so I assume 5 there in between is also the same)... export data from old db, import to new...
        for postgres from one host to another...
        psql -tc "COPY (SELECT * FROM users) TO STDOUT DELIMITER ',' CSV" zabbix | psql postgresql://zdbuserasswd@dbhost:5432/zabbix -c "COPY users FROM STDIN CSV;"

        Comment

        Working...