Request for Advice - OS upgrade/migration

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
DennisT
Posts: 37
Joined: Fri May 19, 2017 11:07 pm

Re: Request for Advice - OS upgrade/migration

Post by DennisT »

Post migration issues -
No Zimbra cron file/entries. I just recreated that from my backup of the original server. IDK if that will have an impact on the following issues. Most of the cron'd jobs should have run by tomorrow so I know then.

Smartscan is failing with a no write permissions on the Backups folder even though it does (/opt is 777, /opt/Backups is 777). All folders in /opt/Backups are zimbra:zimbra and 750 and all files are zimbra:zimbra and 640. I've opened a case with support but no fix yet.

Purge is failing too. It says there are corrupted files. I've run
zxsuite backup doCoherencyCheck /opt/Backups fixBackup true
but even after several times it continues to fail. I've added this to my support case as it is likely related.
User avatar
JDunphy
Outstanding Member
Outstanding Member
Posts: 889
Joined: Fri Sep 12, 2014 11:18 pm
Location: Victoria, BC
ZCS/ZD Version: 9.0.0_P39 NETWORK Edition

Re: Request for Advice - OS upgrade/migration

Post by JDunphy »

This is interesting... If you look in your /opt/zimbra/log directory, you can find some zmsetup.yyymmdd-xxxxxx.log entries. Find the latest one. Inside you should find something like this for Cron or some errors. Picking on one of the problems you have been able to discover.

Code: Select all

Sat Jun 12 12:04:41 2021 Setting up zimbra crontab...
Sat Jun 12 12:04:41 2021 Getting current backup schedule in restorable format.
no crontab for zimbra
Rebuilding backup cron
I would look in here to see what other surprises you might find. When you did your first install.sh -s, it should have created the /etc/passwd, /etc/group, libraries, cron entry, sudo, etc.

If you are tracking through the code, setupCrontab is called by postIinstallConfig() in util/modules/postinstall.sh

where setupCrontab is in util/utilfunc.sh

There isn't anything special going on there other than build the file in /tmp/crontab.zimbra and then doing something like this to install the entries.

Code: Select all

crontab -u zimbra /tmp/crontab.zimbra
I am at a disadvantage because I run the other variant based on RedHat and it has always worked for cron at least. I think I remember others reporting problems in the past on these forums but we never got enough information to dive into why cron entries were empty.

More curious why this was more difficult that it should have been. I can share with you some odd things with permissions that I learned on my practice runs... I once saw what appeared to be stuck on the mysql ... permissions. Another time it was on ssh, permissions again with the .ssh directory as sshd-keygen couldn't write and just stuck - I killed the sshd-keygen via another terminal window and the install.sh continued. That is why I put a lot of effort to figuring out how they created the initial uid/gid when you do that first install.sh -s on a new box. A install.sh -u doesn't remove zimbra from /etc/passwd or /etc/group and leaves a few files in /opt/zimbra. Given that, I decided to create those entries manually for passwd/group myself first to get my uid/gid that I wanted. The other reason is that sometimes, one might want to import a BACKUP NG from a working host and zxsuite is just horrible when it encounters an error because of permissions. ;-) rsync provided there were no errors, should also work but once you are bitten by a permission problem, you tend to over do it. ;-) I do another thing it would appear from looking at my script given how much pain that bad permissions can cause. Here is a snippet... see the find chown/chgrp.

Code: Select all

# pull files
update_zimbra() {
#-- after install.sh -s
mountpoint -q /opt/backup
if [ $? -eq 0 ]; then

  # don't need /opt/zimbra anymore as it just the software
  mv /opt/zimbra /opt/zimbra-

  # copy actual installed version as /opt/zimbra (can be older OS or version)
 rsync --progress --archive --verbose --hard-links --exclude=zimbra/data/ldap/mdb/db/data\.mdb --exclude=zimbra/backup --exclude=zimbra/redolog /opt/backup/zimbra /opt/

  # %%% FIX 
  # note: old zimbra had a different uid
  pushd /opt/zimbra
  find . -uid $zimbra_uid -print0 | xargs -0 chown -h zimbra
  find . -gid $zimbra_gid -print0 | xargs -0 chgrp -h zimbra
  popd

  # put proper binaries in place and install just software again
  getcwd_zinstall_dir; cd $cwd
  install_sw_zimbra

  pushd /opt/zimbra/data/ldap/mdb/db
  # Shouldn't exist
  if [ -f data.mdb ]; then
     echo "This server has already been configured - be careful here if you proceed"
     yes_or_no "WARNING!!!! Should NOT exist - investigate why! Abort?" && exit
     /bin/rm -f data.mdb
  fi
  
  ...
  ...
  }
  
So my basic process is:
1) install.sh -s
2) mv /opt/zimbra /opt/zimbra-
3) mv /opt/backup/zimbra /opt/zimbra
4) install.sh -s
5) install.sh

install.sh will call libexec/zmsetup.pl and that requires that perl libraries, etc are in place. That is why when you change platforms (ie. rhel6 to rhel8) that you have done that install.sh -s again so that those c perl libraries are rhe8 and not the older rhel6 you had from step 3.

Sharing your problems should help others in the future as many are going through this process now. Any migration can be daunting and scary given no one wants to break a perfectly working system and all the moving parts that make up a Zimbra install. Fortunately, IMHO that install.sh is some of the best work Zimbra ever did as it can recover and fix much that is broken and makes these type of migrations possible from different architectures.

Jim
DennisT
Posts: 37
Joined: Fri May 19, 2017 11:07 pm

Re: Request for Advice - OS upgrade/migration

Post by DennisT »

I checked /opt/zimbra/log and there are no current zmsetup files (2019 was the latest). rsync would have removed the 1st install.sh -s log file though?

In your post you have install.sh in step 5. That wasn't in your prior post. Perhaps I need to run that again and that was why I didn't have a zimbra cron set up?
User avatar
vnngoanhtuan
Posts: 9
Joined: Wed Feb 20, 2019 8:44 am

Re: Request for Advice - OS upgrade/migration

Post by vnngoanhtuan »

Hi @DennisT,

If you are using zimbra FOSS, you can rebuild the new zimbra server and follow link: https://rants.tech/migrating-opensource ... -downtime/ to migrate data.

Thanks,
Tuan Ngo
DennisT
Posts: 37
Joined: Fri May 19, 2017 11:07 pm

Re: Request for Advice - OS upgrade/migration

Post by DennisT »

Migration was completed over a year ago.
testani
Posts: 4
Joined: Thu Sep 14, 2023 11:43 am

Re: Request for Advice - OS upgrade/migration

Post by testani »

I know this is an old thread but i'm ecountring a big issue using this tecnique for a migration. All is ok after the switch, services start without issues but this is what i obtain on webaccess.
Can someone help me?
Attachments
Screenshot 2023-09-13 at 22.13.19.png
Screenshot 2023-09-13 at 22.13.19.png (64.41 KiB) Viewed 1601 times
Screenshot 2023-09-14 at 13.42.00.png
Screenshot 2023-09-14 at 13.42.00.png (428.7 KiB) Viewed 1601 times
imanudin11
Outstanding Member
Outstanding Member
Posts: 304
Joined: Sat Sep 13, 2014 2:23 am
ZCS/ZD Version: Release 8.8.15.GA.3829.UBUNTU16.64
Contact:

Re: Request for Advice - OS upgrade/migration

Post by imanudin11 »

testani wrote: Thu Sep 14, 2023 11:49 am I know this is an old thread but i'm ecountring a big issue using this tecnique for a migration. All is ok after the switch, services start without issues but this is what i obtain on webaccess.
Can someone help me?
Hello,
You can reinstall zimbra-patch. I have similar issue and solved with reinstall zimbra-patch
**

Best Regards,
Ahmad Imanudin - Sharing is Beautiful !
Personal Blog [EN] :http://www.imanudin.net
Post Reply