NS7 to NS8 migration - sync data fails

In NS8 you can remove the last instance, it was just to test…

remove-module --no-preserve roundcubemail3

Then go to NS7 and stop/kill the ns8-bind-app command. Ctrl+C should do the job.

Try to run it again, this time with bash -x, to see what happens:

MODULE_NODE_ID=1 bash -x ns8-bind-app nethserver-roundcubemail

:white_flag: Then, if you like give me SSH access to your NS7, send me a PM.

1 Like
[root@neth nethserver-mail]# MODULE_NODE_ID=1 bash -x ns8-bind-app nethserver-roundcubemail
+ set -e
+ app_id=nethserver-roundcubemail
+ source /etc/nethserver/agent.env
++ PATH=/usr/local/agent/pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/local/agent/bin
++ AGENT_INSTALL_DIR=/usr/share/nethesis/nethserver-ns8-migration
++ AGENT_STATE_DIR=/var/lib/nethserver/nethserver-ns8-migration
+ source /var/lib/nethserver/nethserver-ns8-migration/agent.env
++ REDIS_ADDRESS=10.5.4.1:6379
++ AGENT_ID=node/2
++ REDIS_USER=node/2
++ REDIS_PASSWORD=0db642da-c27f-4fc5-b4c4-92491723ae4a
+ source /var/lib/nethserver/nethserver-ns8-migration/environment
++ NODE_ID=2
++ USER_DOMAIN=directory.nh
+ app_idir=/usr/share/nethesis/nethserver-ns8-migration/apps/nethserver-roundcubemail
+ app_sdir=/var/lib/nethserver/nethserver-ns8-migration/nethserver-roundcubemail
+ [[ ! -f /usr/share/nethesis/nethserver-ns8-migration/apps/nethserver-roundcubemail/bind.env ]]
+ mkdir -vp /var/lib/nethserver/nethserver-ns8-migration/nethserver-roundcubemail
+ cd /var/lib/nethserver/nethserver-ns8-migration/nethserver-roundcubemail
+ set -a
+ source /usr/share/nethesis/nethserver-ns8-migration/apps/nethserver-roundcubemail/bind.env
++ MODULE_VOLUMES=
++ MODULE_IMAGE_URL=roundcubemail
+ [[ ! -f bind.env ]]
+ source bind.env
++ RSYNC_ENDPOINT=rsync://roundcubemail2@10.5.4.1:20024
++ RSYNC_PASSWORD=1716198affbecd6-19cf-4706-a1b9-4db8d9b4b0de
++ MODULE_INSTANCE_ID=roundcubemail2
++ MODULE_NODE_ID=1
++ IMPORT_TASK_ID=module/roundcubemail2/task/5f669d4f-643a-40ae-b442-8ca3f66559f4
+ set +a
+ :
+ rsync -v rsync://roundcubemail2@10.5.4.1:20024/
+ sleep 2
+ :
+ rsync -v rsync://roundcubemail2@10.5.4.1:20024/
+ sleep 2
+ :
+ rsync -v rsync://roundcubemail2@10.5.4.1:20024/
+ sleep 2
+ :
+ rsync -v rsync://roundcubemail2@10.5.4.1:20024/
+ sleep 2
+ :

The rsync; sleep2 seems to be repeating indefinitely.

Sorry, you’ve to remove the bind.env file before running that command:

rm -vf /var/lib/nethserver/nethserver-ns8-migration/nethserver-roundcubemail/bind.env

There is no bind.env in nethserver-mail (I’d renamed it to bind_env.old, which is where I’ve been running all these commands–but I now see that I should have been in nethserver-roundcubemail all along. Not sure how I made that mistake.

So, I restored bind.env in nethserver-mail, renamed bind.env to bind_env.old in nethserver-roundcubemail, and let’s try again:

[root@neth nethserver-roundcubemail]# MODULE_NODE_ID=1 bash -x ns8-bind-app nethserver-roundcubemail
+ set -e
+ app_id=nethserver-roundcubemail
+ source /etc/nethserver/agent.env
++ PATH=/usr/local/agent/pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/local/agent/bin
++ AGENT_INSTALL_DIR=/usr/share/nethesis/nethserver-ns8-migration
++ AGENT_STATE_DIR=/var/lib/nethserver/nethserver-ns8-migration
+ source /var/lib/nethserver/nethserver-ns8-migration/agent.env
++ REDIS_ADDRESS=10.5.4.1:6379
++ AGENT_ID=node/2
++ REDIS_USER=node/2
++ REDIS_PASSWORD=0db642da-c27f-4fc5-b4c4-92491723ae4a
+ source /var/lib/nethserver/nethserver-ns8-migration/environment
++ NODE_ID=2
++ USER_DOMAIN=directory.nh
+ app_idir=/usr/share/nethesis/nethserver-ns8-migration/apps/nethserver-roundcubemail
+ app_sdir=/var/lib/nethserver/nethserver-ns8-migration/nethserver-roundcubemail
+ [[ ! -f /usr/share/nethesis/nethserver-ns8-migration/apps/nethserver-roundcubemail/bind.env ]]
+ echo '[ERROR] Unknown app ID nethserver-roundcubemail'
[ERROR] Unknown app ID nethserver-roundcubemail
+ exit 1
[root@neth nethserver-roundcubemail]#

Right, because the app is named roundcubemail:

 MODULE_NODE_ID=1 bash -x ns8-bind-app roundcubemail

My mistake, sorry.

[root@neth nethserver-roundcubemail]# MODULE_NODE_ID=1 bash -x ns8-bind-app roundcubemail
+ set -e
+ app_id=roundcubemail
+ source /etc/nethserver/agent.env
++ PATH=/usr/local/agent/pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/local/agent/bin
++ AGENT_INSTALL_DIR=/usr/share/nethesis/nethserver-ns8-migration
++ AGENT_STATE_DIR=/var/lib/nethserver/nethserver-ns8-migration
+ source /var/lib/nethserver/nethserver-ns8-migration/agent.env
++ REDIS_ADDRESS=10.5.4.1:6379
++ AGENT_ID=node/2
++ REDIS_USER=node/2
++ REDIS_PASSWORD=0db642da-c27f-4fc5-b4c4-92491723ae4a
+ source /var/lib/nethserver/nethserver-ns8-migration/environment
++ NODE_ID=2
++ USER_DOMAIN=directory.nh
+ app_idir=/usr/share/nethesis/nethserver-ns8-migration/apps/roundcubemail
+ app_sdir=/var/lib/nethserver/nethserver-ns8-migration/roundcubemail
+ [[ ! -f /usr/share/nethesis/nethserver-ns8-migration/apps/roundcubemail/bind.env ]]
+ echo '[ERROR] Unknown app ID roundcubemail'
[ERROR] Unknown app ID roundcubemail
+ exit 1
[root@neth nethserver-roundcubemail]#

:thinking: I’m afraid you removed the wrong file.

yum reinstall --noplugins nethserver-ns8-migration

Then remove the bind.env under /var (not /usr)

And (hopefully) that command should do something:

MODULE_NODE_ID=1 bash -x ns8-bind-app nethserver-roundcubemail
1 Like

Not sure how I would have gotten into /usr/share, but removing the wrong file would certainly explain why things would have broken. The yum reinstall ran without an issue, deleted bind.env in the right place this time, and now the ns8-bind-app ran without an error.

…and following that, “sync data” through the UI also completes without errors for “Email.”

2 Likes

Just for the record, I want to say

The UI Abort button does the same. It also tries to remove the NS8 module.

https://docs.nethserver.org/projects/ns8/en/latest/migration.html#migrate-an-application

1 Like