Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support (Russian)
  3. Проблема миграции БД с MySQL в PostgreSQL

Проблема миграции БД с MySQL в PostgreSQL

Scheduled Pinned Locked Moved Support (Russian)
2 Posts 1 Posters 6.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T
    T
    tusov
    wrote on last edited by
    #1

    Добрый день,
    Столкнулся с проблемой не выполняется миграция данных с базы MySQL в PostgreSQL выдает ошибку (полный лог во вложении):

    Migrating table nodes
    SQL query failed (22P02 ОШИБКА:  неверное значение для целого числа: ""):
    INSERT INTO nodes (id,primary_name,primary_ip,node_flags,runtime_flags,snmp_version,snmp_port,community,usm_auth_password,usm_priv_password,usm_methods,snmp_oid,auth_method,secret,agent_port,status_poll_type,agent_version,platform_name,poller_node_id,zone_guid,proxy_node,snmp_proxy,icmp_proxy,required_polls,uname,use_ifxtable,snmp_sys_name,snmp_sys_contact,snmp_sys_location,bridge_base_addr,down_since,boot_time,driver_name,rack_image_front,rack_position,rack_height,rack_id,agent_cache_mode,last_agent_comm_time,syslog_msg_count,snmp_trap_count,chassis_id,node_type,node_subtype,ssh_login,ssh_password,ssh_proxy,port_rows,port_numbering_scheme,agent_comp_mode,tunnel_id,lldp_id,fail_time_snmp,fail_time_agent,rack_orientation,rack_image_rear) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
    
    ...
    
    Database migration failed.
    

    Версии программ:

    NetXMS Database Manager Version 2.2.4 Build 9506 (2.2.4)
    
    mysql  Ver 14.14 Distrib 5.5.53, for debian-linux-gnu (x86_64) using readline 6.3
    
    psql (PostgreSQL) 10.3 (Debian 10.3-1.pgdg80+1)
    

    Миграцию выполняю по инструкции https://wiki.netxms.org/wiki/How_to_migrate_to_another_database

    Кто что посоветует?


    nxdbmgr.log

    1 Reply Last reply
    0
    • T
      T
      tusov
      wrote on last edited by
      #2

      Разобрался в причине ошибки

      Некоторые узлы в таблице nodes в полях port_rows, port_numbering_scheme имеют значение NULL, но как я в момент миграции для этих полей значения заменяются на "" на что и ругается затем PostgreSQL так как "" - это строка, а указанные поля типа число

      в моем случае помогло проставить в MySQL  вместо null значение например -1:

      update netxms.nodes
      set port_numbering_scheme = -1
      where
      port_numbering_scheme is null;
      
      update netxms.nodes
      set port_rows = -1
      where
      port_rows is null;
      

      Выполнил

      nxdbmgr migrate /etc/netxmsd.conf.old
      

      а затем в PostgreSQL вернул null обратно:

      update nodes
      set port_numbering_scheme = null
      where
      port_numbering_scheme = -1;
      
      update nodes
      set port_rows = null
      where
      port_rows = -1;
      

      Просьба к разработчика: исправьте данный баг

      1 Reply Last reply
      0

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      Powered by NodeBB Contributors
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups