Migrating from 7 to brand new NS8 VM

Hi everyone!

I’m currently running a NS7 vm and planning to switch to 8, however, I would like a fresh start.

I have been running the current one for many years and multiple issues came up (sogo spamming logs, not working configuration backup just to name a few) and instead of troubleshooting these issues, I want to use a brand new NS8 vm to replace the current one on a new proxmox cluster.

What do you guys think would be the best option for that? The main objectives is to migrate the users (local LDAP) and the mails. No other service is running on the current one.

Can I somehow migrate these two things to the new system without updating the current one? Or maybe update the current one, join the cluster and somehow clone the users to the new vm node?

Thank you in advance!

Hi @scania471

Welcome back.

Just an idea.
Someone will correct me if I’m wrong.

Don’t touch the original NS-7.

Backup your NS7 machine.

At the Proxmox command line, locate the backup file if you didn’t receive an email after the successful backup.
# updatedb
# locate NS-7_VMID | grep vma.zst

Restore to another VMID.
qmrestore <archive> <vmid> [OPTIONS]
Example:
# qmrestore vzdump-qemu-111-2023_12_13-14_02_31.vma.zst 222 --storage miroir-1-zfs

If you can stop your original NS-7 VM for just a few minutes:
Start the VM 222 (the CLONE)
Change domain name and IP address. (Users and emails should come back as before but under the new domain name).

Restart the original NS-7

Make all your tests with the CLONE and NS8.

When finished, and you are absolutely sure that all is working correctly on the CLONE and on your NS8, make a snapshot of the original NS-7.

Repeat the working procedures with the original NS-7 and a new NS8.

You have a CLONE, a backup, and a snapshot - you should be safe.

Good luck,

Michel-André

1 Like

Thank you for the idea!

In fact, that’s exactly what I had in mind last night.
Clone the NS7 vm, change the IPs on it, so I have a test environment. Update that one and if it’s working correctly, I will do exactly what you mentioned with the original one. :+1:

Well, my journey lasted for quite a while, the NS8 migration tool does not load on the cloned 7 vm. It’s just loading and loading.
Can I somehow check for its logs? In the Logs menu, I can’t find relatable logs.

Or should I create a different topic for it?

The logs on NS7 are in /var/log/ns8-migration.log
On NS8 you could check the cluster logs on the log page.

I think you can go on in this topic.

1 Like

That is the interesting part, that log file is empty. It does not tell me why the tool does not load.
In the browser’s console, I can see the following:

API exec: nethserver-ns8-migration/connection/read$  echo '{}' | /usr/bin/sudo /usr/libexec/nethserver/api/nethserver-ns8-migration/connection/read | jq

If I run that command above in the terminal, I get the following:

{
  "configuration": {
    "ns8": 1
  }
}

I also get this error in the console log:

TypeError: Cannot read properties of undefined (reading 'Host') - Dashboard.vue:1465

Do you have any advice?

EDIT: typo

I investigated a little and found that the command /sbin/e-smith/config getjson ns8 returns only 1 value which is 1 and it does not have the used attributes in Dashboard.vue. In theory, the get_config() is called in nethserver-ns8-migration / api / connection / read.

If I create a breakpoint at line 1445 in Dashboard.vue to disable the loading variable, so if the nethserver.exec(["nethserver-ns8-migration/connection/read"], ... fails, the UI does not stuck at loading. In this case, the form loads to enter the NS8 admin credentials.

That may be a different story that if I enter the credentials, the connection is refused with the following error:

{"steps":2,"pid":32526,"args":"","event":"nethserver-ns8-migration-save"} 
{"step":1,"pid":32526,"action":"S05generic_template_expand","event":"nethserver-ns8-migration-save","state":"running"} 
{"progress":"0.50","time":"0.077799","exit":0,"event":"nethserver-ns8-migration-save","state":"done","step":1,"pid":32526,"action":"S05generic_template_expand"} 
{"step":2,"pid":32526,"action":"S90adjust-services","event":"nethserver-ns8-migration-save","state":"running"} {"progress":"1.00","time":"0.28576","exit":0,"event":"nethserver-ns8-migration-save","state":"done","step":2,"pid":32526,"action":"S90adjust-services"} {"pid":32526,"status":"success","event":"nethserver-ns8-migration-save"} 
Traceback (most recent call last): 
File "/usr/lib64/python3.6/urllib/request.py", line 1349, in do_open encode_chunked=req.has_header('Transfer-encoding')) 
File "/usr/lib64/python3.6/http/client.py", line 1254, in request self._send_request(method, url, body, headers, encode_chunked) 
File "/usr/lib64/python3.6/http/client.py", line 1300, in _send_request self.endheaders(body, encode_chunked=encode_chunked) 
File "/usr/lib64/python3.6/http/client.py", line 1249, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) 
File "/usr/lib64/python3.6/http/client.py", line 1036, in _send_output self.send(msg) File "/usr/lib64/python3.6/http/client.py", line 974, in send self.connect() 
File "/usr/lib64/python3.6/http/client.py", line 946, in connect (self.host,self.port), self.timeout, self.source_address) 
File "/usr/lib64/python3.6/socket.py", line 724, in create_connection raise err 
File "/usr/lib64/python3.6/socket.py", line 713, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 111] Connection refused During handling of the above exception, another exception occurred: Traceback (most recent call last): 
File "/usr/sbin/ns8-join", line 237, in <module> call(api_endpoint, "remove-external-domain", payload['token'], 
{"domain": account_provider_domain}, False) 
File "/usr/sbin/ns8-join", line 47, in call post = request.urlopen(req, context=ctx) 
File "/usr/lib64/python3.6/urllib/request.py", line 223, in urlopen return opener.open(url, data, timeout) 
File "/usr/lib64/python3.6/urllib/request.py", line 526, in open response = self._open(req, data) File "/usr/lib64/python3.6/urllib/request.py", line 544, in _open '_open', req) 
File "/usr/lib64/python3.6/urllib/request.py", line 504, in _call_chain result = func(*args) File "/usr/lib64/python3.6/urllib/request.py", line 1377, in http_open return self.do_open(http.client.HTTPConnection, req) 
File "/usr/lib64/python3.6/urllib/request.py", line 1351, in do_open raise URLError(err) urllib.error.URLError: <urlopen error [Errno 111] Connection refused>"`

Do you have any ideas what the /sbin/e-smith/config getjson ns8 should do and return?

NethServer 7 uses databases like the config db.

Output the config settings of the migration tool:

config show ns8

Output the config settings as json:

config getjson ns8

[root@server2 ~]# /sbin/e-smith/config getjson ns8
{"props":{"Password":"","User":"","TLSVerify":"enabled","LeaderIpAddress":"","Host":""},"name":"ns8","type":"configuration"}

[root@server2 ~]# config show ns8
ns8=configuration
    Host=
    LeaderIpAddress=
    Password=
    TLSVerify=enabled
    User=

That’s strange.

Did you already use Wireguard on the NS7? It could lead to conflicts.

Maybe you could remove the migration tool and start over? See also nethserver-ns8-migration — NethServer 7 documentation

Actually I tried it 2 times previously on a new copy of the current NS7 VM and got the same result every time, also tried to remove the migration tool and reinstall it before but only by removing the migration tool, not completely uninstalling everything with it.
Just now, I reinstalled the whole thing like the doc mentioned but still doing the same thing, still returns the weird values.

It is supposed to return the empty objects like this before entering the credentials of the admin NS8 node, right?

In terms of Wireguard, I have ever used it on this system, I use a different Wireguard docker in my homelab on a separate machine. Removed that thing as well with yum remove nethserver-ns8-migration kmod-wireguard wireguard-tools

config show ns8 returns nothing, so that’s exiting :neutral_face:

Is that an option to migrate the current NS7 data to a brand new NS7 VM and try to migrate that one to NS8? Only 2 things are important on this system, the users and the mails, nothing else, so if I could somehow migrate these things to a new VM, maybe that could help. Question is that can it be achieved without moving the bad stuff to the new VM so it doesn’t break the migration tool.