EL7 to EL 8 or 9 and Software and Infrastructure: Difference between pages

From QmailToaster
(Difference between pages)
Jump to navigation Jump to search
No edit summary
 
No edit summary
 
Line 1: Line 1:
  '''On destination host'''
  '''Create RPM build environment EL'''
Install Rocky [[Rocky,_Alma,_Springdale_8_QT_Install|8]] or [[Rocky,_Alma,_Springdale_9_QT_Install|9]]
  # yum -y groupinstall "Development Tools"
qmailctl stop && systemctl stop dovecot
  # yum install epel-release rpmdevtools mock
 
  # useradd build
'''On source host''' <span style="color:red">Source host most likely EL7</span>
  # passwd build
  # dhost=192.168.1.3 <span style="color:red">Change IP address for your needs</span>
  # visudo
  # ssh-keygen
  Under
  # ssh-copy-id $dhost
        root   ALL=(ALL) ALL
  # ssh $dhost<br>
  Add  
'''''First rsync email db'''''
        build  ALL=(ALL)      ALL
  # rsync --progress -zv -are ssh /home/vpopmail/domains/ root@$dhost:/home/vpopmail/domains<br>
  $ su - build
'''''Stop services for 2nd rsync'''''
  $ rpmdev-setuptree<br>
# qmailctl stop && systemctl stop dovecot<br>
  Command: mkdir
'''''Second rsync subsequent changes to email db'''''
  # mkdir options <dir>
# rsync --progress -zv -are ssh /home/vpopmail/domains/ root@$dhost:/home/vpopmail/domains<br>
  Examples:
  '''''Bring over the rest of the data'''''
  # mkdir myProject
# rsync --progress -zv -are ssh /var/qmail/control/ root@$dhost:/var/qmail/control
  # mkdir -p myProject/{src,doc,tools,db}
# rsync --progress -zv -are ssh /var/qmail/users/ root@$dhost:/var/qmail/users
  # mkdir -p myProject/{src,doc/{api,system},tools,db}
# rsync --progress -zv -are ssh /etc/tcprules.d/ root@$dhost:/etc/tcprules.d
# rsync --progress -zv -are ssh /usr/share/toaster/include/admin.pass  root@$dhost:/usr/share/toaster/include
# rsync --progress -zv -are ssh /usr/share/toaster/include/admin.htpasswd  root@$dhost:/usr/share/toaster/include
# [ ! -d /etc/mail/spamassassin ] && sqadj= || sqadj=mail/
  # rsync --progress -zv -are ssh /etc/${sqadj}spamassassin/.spamassassin/ root@$dhost:/etc/mail/spamassassin/.spamassassin
# rsync --progress -zv -are ssh /etc/${sqadj}spamassassin/*.cf root@$dhost:/etc/mail/spamassassin
  # rsync --progress -zv -are ssh /usr/share/squirrelmail/plugins/ root@$dhost:/usr/share/squirrelmail/plugins
# rsync --progress -zv -are ssh /var/lib/squirrelmail/prefs/  root@$dhost:/var/lib/squirrelmail/prefs<br>
  '''''Dovecot files are not necessary for EL 8/9 they are only for reference'''''
# rsync --progress -zv -are ssh /etc/dovecot/toaster.conf root@$dhost:/etc/dovecot
  # rsync --progress -zv -are ssh /etc/dovecot/local.conf root@$dhost:/etc/dovecot<br>
  '''''Bring over MySQL DBs'''''
  # mysqldump -u root -p dspam > dspam.sql
  # mysqldump -u root -p spamassassin > spamassassin.sql
  # mysqldump -u root -p roundcube > roundcube.sql
# mysqldump -u root -p vpopmail > vpopmail.sql
# scp *.sql root@$dhost:/root<br>
'''On destination host'''
'''''Create credentials'''''
# credfile=~/sql.cnf
# echo -e "[client]\nuser=root\npassword=mysqlpass\nhost=localhost" > $credfile <span style="color: red">Edit credentials file and update password setting</span>
'''''Load vpopmail'''''
# mysqladmin --defaults-extra-file=$credfile vpopmail < vpopmail.sql
'''''Load DSpam'''''
# mysqladmin --defaults-extra-file=$credfile create dspam
# mysql --defaults-extra-file=$credfile -e "CREATE USER dspam@localhost IDENTIFIED BY 'p4ssw3rd'"
# mysql --defaults-extra-file=$credfile -e "GRANT ALL PRIVILEGES ON dspam.* TO dspam@localhost"
# mysql --defaults-extra-file=$credfile dspam < dspamdb.sql
'''''Load Roundcube'''''
# mysql --defaults-extra-file=$credfile -e "create database roundcube character set utf8 collate utf8_bin"
# mysql --defaults-extra-file=$credfile -e "CREATE USER roundcube@localhost IDENTIFIED BY 'p4ssw3rd'"
# mysql --defaults-extra-file=$credfile -e "GRANT ALL PRIVILEGES ON roundcube.* TO roundcube@localhost"
# mysql --defaults-extra-file=$credfile roundcube < roundcube.sql
'''''Load Spamassassin'''''
# mysqladmin --defaults-extra-file=$credfile create spamassassin
# mysql --defaults-extra-file=$credfile -e "CREATE USER spamassassin@localhost IDENTIFIED BY 'p4ssw3rd'"
# mysql --defaults-extra-file=$credfile -e "GRANT ALL PRIVILEGES ON spamassassin.* TO spamassassin@localhost"
# mysql --defaults-extra-file=$credfile spamassassin < spamassassin.sql
 
''If you're migrating from a Many-Domain to Many-Domain backend nothing more is required''
''If you're migrating from a Domain-Table backend to a Many-Domain backend you'll need to run [[Many-Domain_script|this]] script''
''If you're migrating from a Domain-Table to Domain-Table backend and want to convert to [[Many-Domain_conversion|Many-Domain]]''
# qmailctl cdb && qmailctl start && sleep 2s && systemctl start dovecot && toaststat
 
Questions, comments, suggestions, corrections...contact Eric on the QMT list

Revision as of 01:35, 30 March 2024

Create RPM build environment EL
# yum -y groupinstall "Development Tools"
# yum install epel-release rpmdevtools mock
# useradd build
# passwd build
# visudo 
  Under 
       root   ALL=(ALL)	ALL
  Add	 
       build   ALL=(ALL)       ALL
$ su - build
$ rpmdev-setuptree
Command: mkdir # mkdir options <dir> Examples: # mkdir myProject # mkdir -p myProject/{src,doc,tools,db} # mkdir -p myProject/{src,doc/{api,system},tools,db}