Import existing device between seperate Librenms instances while keeping all performance data

Hi Everyone,

So this might be a bit of a strange situation. I have two Librenms installs running and they have been for around 6 months, I’m now looking to merge them both into the one instance.

To test if I would lose all historical performance data I copied the RRD files of a device on the remote Librenms to the central one and created a device to match the old using the web portal. This seemed to work for health related data but not for port bandwidth data. From what I can see the portids on the central Librenms don’t match the originals so the correct RRD files aren’t being used.

I’m guessing the fix would involve mysql which I’m not great with. Does anyone have any advice for this? I may just leave the port performance data out if needed as its more of a nice to have than essential.

rrd commands from each site:
rrdtool graph /tmp/tHhEJWhTNXQjeG0K --alt-autoscale-max --rigid -E --start 1525864800 --end 1525951200 --width 2160 --height 574 -c BACK#EEEEEE00 -c SHADEA#EEEEEE00 -c SHADEB#EEEEEE00 -c FONT#000000 -c CANVAS#FFFFFF00 -c GRID#a5a5a5 -c MGRID#FF9999 -c FRAME#5e5e5e -c ARROW#5e5e5e -R normal --font LEGEND:8:DejaVuSansMono --font AXIS:7:DejaVuSansMono --font-render-mode normal DEF:outoctets=/mnt/libre-data/rrd/fake-device-name/port-id15230.rrd:OUTOCTETS:AVERAGE DEF:inoctets=/mnt/libre-data/rrd/fake-device-name/port-id15230.rrd:INOCTETS:AVERAGE DEF:outoctets_max=/mnt/libre-data/rrd/fake-device-name/port-id15230.rrd:OUTOCTETS:MAX DEF:inoctets_max=/mnt/libre-data/rrd/fake-device-name/port-id15230.rrd:INOCTETS:MAX CDEF:octets=inoctets,outoctets,+ CDEF:doutoctets=outoctets,-1,* CDEF:outbits=outoctets,8,* CDEF:outbits_max=outoctets_max,8,* CDEF:doutoctets_max=outoctets_max,-1,* CDEF:doutbits=doutoctets,8,* CDEF:doutbits_max=doutoctets_max,8,* CDEF:inbits=inoctets,8,* CDEF:inbits_max=inoctets_max,8,* VDEF:totin=inoctets,TOTAL VDEF:totout=outoctets,TOTAL VDEF:tot=octets,TOTAL CDEF:dpercentile_outn=doutbits,-1,* VDEF:dpercentile_outnp=dpercentile_outn,95,PERCENT CDEF:dpercentile_outnpn=doutbits,doutbits,-,dpercentile_outnp,-1,*,+ VDEF:dpercentile_out=dpercentile_outnpn,FIRST VDEF:percentile_in=inbits,95,PERCENT VDEF:percentile_out=outbits,95,PERCENT COMMENT:'bps Now Ave Max 95th %\n' AREA:inbits_max#D7FFC7: AREA:inbits#90B040: LINE:inbits#608720:'In ' GPRINT:inbits:LAST:%6.2lf%s GPRINT:inbits:AVERAGE:%6.2lf%s GPRINT:inbits_max:MAX:%6.2lf%s GPRINT:percentile_in:%6.2lf%s\n AREA:doutbits_max#E0E0FF: AREA:doutbits#8080C0: LINE:doutbits#606090:'Out' GPRINT:outbits:LAST:%6.2lf%s GPRINT:outbits:AVERAGE:%6.2lf%s GPRINT:outbits_max:MAX:%6.2lf%s GPRINT:percentile_out:%6.2lf%s\n GPRINT:tot:'Total %6.2lf%sB' GPRINT:totin:'(In %6.2lf%sB' GPRINT:totout:'Out %6.2lf%sB)\l' LINE1:percentile_in#aa0000 LINE1:dpercentile_out#aa0000

rrdtool graph /tmp/F1gmaPmV5ryStdrr --alt-autoscale-max --rigid -E --start 1525873500 --end 1525959900 --width 2476.8 --height 628.5 -c BACK#EEEEEE00 -c SHADEA#EEEEEE00 -c SHADEB#EEEEEE00 -c FONT#000000 -c CANVAS#FFFFFF00 -c GRID#a5a5a5 -c MGRID#FF9999 -c FRAME#5e5e5e -c ARROW#5e5e5e -R normal --font LEGEND:8:DejaVuSansMono --font AXIS:7:DejaVuSansMono --font-render-mode normal DEF:outoctets=/mnt/dump/libre-data/rrd/fake-device-name/port-id124.rrd:OUTOCTETS:AVERAGE DEF:inoctets=/mnt/dump/libre-data/rrd/fake-device-name/port-id124.rrd:INOCTETS:AVERAGE DEF:outoctets_max=/mnt/dump/libre-data/rrd/fake-device-name/port-id124.rrd:OUTOCTETS:MAX DEF:inoctets_max=/mnt/dump/libre-data/rrd/fake-device-name/port-id124.rrd:INOCTETS:MAX CDEF:octets=inoctets,outoctets,+ CDEF:doutoctets=outoctets,-1,* CDEF:outbits=outoctets,8,* CDEF:outbits_max=outoctets_max,8,* CDEF:doutoctets_max=outoctets_max,-1,* CDEF:doutbits=doutoctets,8,* CDEF:doutbits_max=doutoctets_max,8,* CDEF:inbits=inoctets,8,* CDEF:inbits_max=inoctets_max,8,* VDEF:totin=inoctets,TOTAL VDEF:totout=outoctets,TOTAL VDEF:tot=octets,TOTAL CDEF:dpercentile_outn=doutbits,-1,* VDEF:dpercentile_outnp=dpercentile_outn,95,PERCENT CDEF:dpercentile_outnpn=doutbits,doutbits,-,dpercentile_outnp,-1,*,+ VDEF:dpercentile_out=dpercentile_outnpn,FIRST VDEF:percentile_in=inbits,95,PERCENT VDEF:percentile_out=outbits,95,PERCENT COMMENT:'bps Now Ave Max 95th %\n' AREA:inbits_max#D7FFC7: AREA:inbits#90B040: LINE:inbits#608720:'In ' GPRINT:inbits:LAST:%6.2lf%s GPRINT:inbits:AVERAGE:%6.2lf%s GPRINT:inbits_max:MAX:%6.2lf%s GPRINT:percentile_in:%6.2lf%s\n AREA:doutbits_max#E0E0FF: AREA:doutbits#8080C0: LINE:doutbits#606090:'Out' GPRINT:outbits:LAST:%6.2lf%s GPRINT:outbits:AVERAGE:%6.2lf%s GPRINT:outbits_max:MAX:%6.2lf%s GPRINT:percentile_out:%6.2lf%s\n GPRINT:tot:'Total %6.2lf%sB' GPRINT:totin:'(In %6.2lf%sB' GPRINT:totout:'Out %6.2lf%sB)\l' LINE1:percentile_in#aa0000 LINE1:dpercentile_out#aa0000

Many Thanks,
Lee

I think your only option would be to rename the old port files to the new database ID.

With the amount of ports I think I will just sacrifice the port data, thanks for the feedback!