NS8 / MeshCentral - migrate meshcentral-data folder/files and mongo database

NethServer Version: NS8
Module: mechcentral

Originally after switching to NS8 I got most things I needed running on again. I was lacking one item, and that was migrating meshcentral to NS8.

Unfortunately, the meshcentral migration was not available at the time when I did my migration of NS7,9 to NS8. I’m not even sure if there is a clean/clear migration path with the NS8 migration tool at this time for meshcentral from NS7.9 to NS8.

So I was trying just recently to install meshcentral on NS8 to get to the part of trying to migrate the old NS7.9 MeshCentral to NS8.

The first try of just loading meshcentral app on NS8 gave me errors and did not look like it took. So I tried again, and then I had the first install (botched - failed) and a second install that looks like everything worked, except it is not started - I guess. So I uninstalled the first botched/failed install and kept the second install.

This is what it shows now -

As you can see above, the meshcetnral app is inactive and disabled, as well as the mongo-app.

I thought that the meshcentral install would have started and have a working version of meshcentral. I was also hoping that the working version of meshcental app in NS8 would have a restore backups and autobackups into the now running NS8 meshcentral app. As far as I know, it does not. So it seems that I would have to somehow do it manually through CLI on server.

Looked through the forums, it’s possible I have overlooked someone asking for help on this issue in the forums, but didn’t see anything to my searching.

I am hoping someone may be able to shed some light on the proper way to take the autobackups from the old NS7.9 and manually install them in NS8 meshcentral.

Thanks

1 Like

You’re right, there’s no migration path yet and meshcentral doesn’t support restoring via web UI and I think one also needs to restore mongodb manually.
I’m going to test it and report my findings.

EDIT:

It seems to work, I documented the migration process here: ns8-meshcentral/README.md at main · mrmarkuz/ns8-meshcentral · GitHub

3 Likes

Awesome that it worked for you. Thats super encouraging. I will try it out, I should see the same results. I will report back.

Thanks mrmarkuz

1 Like

So i got to the following part -

Start mongo container named restore_db:

podman run \
  --rm \
  --detach \
  --interactive \
  --network=none \
  --volume mongo-app:/data/db:Z \
  --replace --name=restore_db \
${MONGO_IMAGE}

Do I need to change anything like --name=restore_db. With the database name or is that just script object and place holder for the command.

I tried it like it was and then it spits out a large alpha-numeric

So I am guessing it completed correctly, so I did the next

podman cp backup.archive restore_db:/

So for me this should it be as follows -

podman cp mongodump-2025-02-25-03-40.archive restore_db:/

But when I run it, I get the following

Error: container “restore_db” does not exist

Obviously, I have done something incorrectly, but I am unsure if the last commands I did have script object holders or placeholders for the real names of the files.

I must be thinking too hard. :smile:

Yes, that should be ok.

You could check the running containers using

podman ps

If the container db_restore is not running, you could check if there’s an error in the container by running it without --detach like

podman run \
  --rm \
  --interactive \
  --network=none \
  --volume mongo-app:/data/db:Z \
  --replace --name=restore_db \
${MONGO_IMAGE}

EDIT:

These steps need to be done as app user → runagent -m meshcentral1

1 Like

I am working with meshcentral2 (not meshcentral1 - I uninstalled that one)

Well, I am still getting a challenge. Here is a screenshot for you to see what I am seeing when I run the commands.

Thoughts?

It seems the container is not running.

EDIT:

root@debianns8test:~# runagent -m meshcentral1
runagent: [INFO] starting bash -l
runagent: [INFO] working directory: /home/meshcentral1/.config/state
meshcentral1@debianns8test:~/.config/state$ systemctl --user stop meshcentral
meshcentral1@debianns8test:~/.config/state$ podman run \
  --rm \
  --detach \
  --interactive \
  --network=none \
  --volume mongo-app:/data/db:Z \
  --replace --name=restore_db \
${MONGO_IMAGE}
4ad4bf7db13a6cb48b3c179b1b1269b9754ec8a8ff7d07fd44acf3b7ab06c1f4
meshcentral1@debianns8test:~/.config/state$ podman ps
CONTAINER ID  IMAGE                           COMMAND     CREATED        STATUS            PORTS       NAMES
4ad4bf7db13a  docker.io/library/mongo:7.0.17  mongod      9 seconds ago  Up 5 seconds ago              restore_db
meshcentral1@debianns8test:~/.config/state$
1 Like

You are correct!

WARNING: MongoDB 5.0+ requires a CPU with AVX support, and your current system does not appear to have that!
see https://jira.mongodb.org/browse/SERVER-54407
see also MongoDB 5.0 CPU Intel G4650 compatibility - #2 by Stennie_X - Installation & Upgrades - MongoDB Developer Community Forums
see also Mongo 5.0.0 crashes but 4.4.6 works · Issue #485 · docker-library/mongo · GitHub

Looks like the equipment I am running is the challenge. It doesn’t have a CPU with AVX support.

Thanks for you help on this. Let me fix that issue first and I believe that will fix the other issue.

I will update you further, when I get that adjusted.

Thanks again mrmarkus!

1 Like

If you use Proxmox, set CPU to host, see also GitHub - mrmarkuz/ns8-meshcentral

To check AVX support:

If AVX isn’t supported by the CPU you could switch to GitHub - mrmarkuz/ns8-meshcentral-light without mongodb but db migration may be hard.

1 Like