migrate netxms core server and db to another server

Started by luccosen, November 05, 2023, 11:47:41 AM

Previous topic - Next topic

luccosen

Hi, I know there are several posts with this question, but still, following various procedures I was unable to migrate the db from an old netxms to another, unfortunately I'm inexperienced.

I tried to run the command to export the db from the old one:
nxdbmgr -s export file_name, but then I can't reimport it to the new one, as it obviously has the latest release, and the nxdbmgr -s command fails.

using debian and fedora, the repositories, always install the latest version available and don't let me choose what to install, I have several active devices all with old releases, which I can't update, but which I have to migrate. Thanks for the answers you give me.

Filipp Sudanov

Yes, we need same version of NetXMS to migrate db.
To summarize the possible ways:

- upgrade the "old" netxms first, then export the database and import into same version.

- install older NetXMS on the new system - for Debian/Ubuntu repository actually stores a number of previous versions, you can check with:
apt-cache policy netxms-server

Then you can install specific version, but you need to specify the version also for all netxms packages which server depends upon. E.g. for to install agent there's two more packages, for server there are a bit more:
apt install netxms-base=4.3.4-1 netxms-dbdrv-sqlite3=4.3.4-1 netxms-agent=4.3.4-1

- export file produced by nxdbmgr is actually sqlite database. So you can specify that file in netxmsd.conf:
DBDriver=sqlite.ddr
DBName=/path/to/your/file/netxms.db
and start the server. It will upgrade the sql file to the latest version, then you can stop the server and use nxdbmgr to perform import.


luccosen

Hi, Thank yoy for the answer.

All my installation is in postgres db. Then you say that the nxdbmr, will newer be able to import the backup to a newer server with postgres? so, if I had some advice, when creating the new server, with the old release, shouldn't I initialize the db? is there perhaps the possibility of switching from a version of netxms on windows, and then re-entering the db in postgres on the new server? but the backup is in sqlite, and therefore it wouldn't work? Right?
can we migrate a sqlite db to postgres or vice versa, or, do you have a tool that migrates the backup of one version
 to another? Thank you.


in the row :
apt install netxms-base=4.3.4-1 netxms-dbdrv-sqlite3=4.3.4-1 netxms-agent=4.3.4-1

is missing :
netxms-dbdrv-pgsql


How should I insert it correctly?

Do you perhaps recommend always using another database, to better manage backups?




Luciano



luccosen

I saw that the old versions I have are not in the list of installable releases.
 so how can I do it? manual installation? Could I have the correct steps for a manual installation on Debian?
 with importable and exportable backup? like the 3.9.280? or the old release 3.9.280 is iportable on the old 3.9.420?

thank you. 




Filipp Sudanov

The option to get older release on Debian is to compile from sources, but this might be a bit complicated.

What about the first option - can you upgrade your current installation of netxms and migrate the database then?

luccosen

I could try, but they are real-time machines,
and if the update failed, I would have big problems.
This was why I had planned the backup, with the creation of a new machine, to test in the office.
But wasn't there the possibility of migrating the configuration without touching the old server?
The old servers are physical, and for this very reason their virtual activation was planned.
But since I wasn't able to migrate the db I got stuck.

Luciano.


Borgso

If you are using 3.9.280 now, you can safe upgarde to latest 3.9 that is 3.9.420 first
Atleast i found 3.9.420 in repo for ubuntu focal https://packages.netxms.org/ubuntu/pool/focal/main/n/netxms/

You can also migrate the DB to a virtual server, just use a Postgresql guide on how to migrate data.
Then you have both Bare-Metal db + VM DB you can connect NetXMS server to.
You can now edit netxms Bare-Metal installation to point to VM DB (Ie Snapshot as backup), then upgrade bare-metal install to latest 4.4 stable.
Rollback plan will be to reinstall  3.9.420 and point to bare-metal db that you didnt touch