EFA unstable - export of settings possible?

Questions and answers about how to do stuff
Post Reply
Goppi
Posts: 4
Joined: 28 Jan 2014 21:31

EFA unstable - export of settings possible?

Post by Goppi »

I've had the original ESVA and thereafter the EFA, but recently it just became to unstable. Initially it started with the emails were not forwarded and after a restart it appeared that one of the databases was corrupt. I corrected that, but it happened two more times. A repair seems to have done the job. However recently it stopped again, though no database corruption, it doesn't even show incoming emails - just doesn't work anymore and doesn't show any errors.

I'm sure if I would spend hours after hours I will be able to get to the bottom, but I don't have time for this. I was thinking if it's possible to export all settings and reimport them reliably on a new vm?

Any suggestions much welcomed.

Thanks,
Goppi
User avatar
shawniverson
Posts: 3783
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: EFA unstable - export of settings possible?

Post by shawniverson »

This may work...

1) Back up your EFA settings (includes all major settings and the mysql database)

/usr/local/sbin/EFA-Backup -backup

2) Copy the backup off of EFA

Hint: look for the date and time of the backup in the tar.gz filename

/var/EFA/backup/

3) Copy /etc/EFA-Config off of EFA and keep it safe and secure

4) Copy /var/spool/MailScanner/quarantine/* if keeping your quarantine

5) Shutdown your EFA

6) Create a new EFA with same IP, name, etc.

7) Copy your EFA-Config up to the new EFA in a separate location, such as /root and then

Code: Select all

sudo chmod 400 /root/EFA-Config
8) Run this script as root (set the location of the EFA-Config from the old appliance first)

Code: Select all

#!/bin/bash
RESTORECONFIG="/root/EFA-Config"
RESTOREMYSQLROOTPWD=$(grep "^MYSQLROOTPWD" $RESTORECONFIG | awk -F':' '{print $2}' | tr -d [:space:])
RESTORESAUSERSQLPWD=$(grep "^SAUSERSQLPWD" $RESTORECONFIG | awk -F':' '{print $2}' | tr -d [:space:])
RESTOREMAILWATCHSQLPWD=$(grep "^MAILWATCHSQLPWD" $RESTORECONFIG | awk -F':' '{print $2}' | tr -d [:space:])
RESTORESQLGREYSQLPWD=$(grep "^SQLGREYSQLPWD" $RESTORECONFIG | awk -F':' '{print $2}' | tr -d [:space:])
RESTOREEFASQLPWD=$(grep "^EFASQLPWD" $RESTORECONFIG | awk -F':' '{print $2}' | tr -d [:space:])
RESTOREMUNINPWD=$(grep "^MUNINPWD" $RESTORECONFIG | awk -F':' '{print $2}' | tr -d [:space:])
MYSQLROOTPWD=$(grep "^MYSQLROOTPWD" /etc/EFA-Config | awk -F':' '{print $2}' | tr -d [:space:])

/usr/bin/mysql -u root -p"$MYSQLROOTPWD" -e "UPDATE mysql.user SET Password=PASSWORD('$RESTORESAUSERSQLPWD') WHERE User='sa_user';"
/usr/bin/mysql -u root -p"$MYSQLROOTPWD" -e "FLUSH PRIVILEGES;"
sed -i "/\usr\/bin\/mysql -usa_user / c\\/usr\/bin\/mysql -usa_user -p$RESTORESAUSERSQLPWD < \/etc\/trim-awl.sql" /usr/sbin/trim-awl

/usr/bin/mysql -u root -p"$MYSQLROOTPWD" -e "UPDATE mysql.user SET Password=PASSWORD('$RESTOREMAILWATCHSQLPWD') WHERE User='mailwatch';"
/usr/bin/mysql -u root -p"$MYSQLROOTPWD" -e "FLUSH PRIVILEGES;"

/usr/bin/mysql -u root -p"$MYSQLROOTPWD" -e "UPDATE mysql.user SET Password=PASSWORD('$RESTORESQLGREYSQLPWD') WHERE User='sqlgrey';"
/usr/bin/mysql -u root -p"$MYSQLROOTPWD" -e "FLUSH PRIVILEGES;"

/usr/bin/mysql -u root -p"$MYSQLROOTPWD" -e "UPDATE mysql.user SET Password=PASSWORD('$RESTOREEFASQLPWD') WHERE User='efa';"
/usr/bin/mysql -u root -p"$MYSQLROOTPWD" -e "FLUSH PRIVILEGES;"

/usr/bin/mysqladmin -u root -p$MYSQLROOTPWD password "$RESTOREMYSQLROOTPWD"

htpasswd -b /etc/munin/munin-htpasswd munin $RESTOREMUNINPWD

sed -i "/^SAUSERSQLPWD:/ c\SAUSERSQLPWD:$RESTORESAUSERSQLPWD" /etc/EFA-Config
sed -i "/^MAILWATCHSQLPWD:/ c\MAILWATCHSQLPWD:$RESTOREMAILWATCHSQLPWD" /etc/EFA-Config
sed -i "/^SQLGREYSQLPWD:/ c\SQLGREYSQLPWD:$RESTORESQLGREYSQLPWD" /etc/EFA-Config
sed -i "/^EFASQLPWD:/ c\EFASQLPWD:$RESTOREEFASQLPWD" /etc/EFA-Config
sed -i "/^MYSQLROOTPWD:/ c\MYSQLROOTPWD:$RESTOREMYSQLROOTPWD" /etc/EFA-Config
sed -i "/^MUNINPWD:/ c\MUNINPWD:$RESTOREMUNINPWD" /etc/EFA-Config

RESTOREMYSQLROOTPWD=""
RESTORESAUSERSQLPWD=""
RESTOREMAILWATCHSQLPWD=""
RESTORESQLGREYSQLPWD=""
RESTOREEFASQLPWD=""
RESTOREMUNINPWD=""
MYSQLROOTPWD=""
9) Copy your tar.gz backup file to /var/EFA/backup

10) Run a restore

Option 13) System Restore

11) Copy your quarantine back to /var/spool/MailScanner/quarantine

Code: Select all

chown -R postfix:apache /var/spool/MailScanner/quarantine
chmod -R o-rwx /var/spool/MailScanner/quarantine
Goppi
Posts: 4
Joined: 28 Jan 2014 21:31

Re: EFA unstable - export of settings possible?

Post by Goppi »

Strange - most of the links on the download page apart from hyper-v don't work.
Does anybody have a direct contact at efa that can have a look at this?

Goppi.
User avatar
shawniverson
Posts: 3783
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: EFA unstable - export of settings possible?

Post by shawniverson »

Yeah, same here. I'll reach out to darky83. He is in a very different timezone, so in the meantime, try this link:

https://dl5.efa-project.org/images/EFA- ... VMware.zip

Please be sure to upgrade asap to the latest update :)
ovizii
Posts: 463
Joined: 11 May 2016 08:08

Re: EFA unstable - export of settings possible?

Post by ovizii »

I jsut had the same issue with the download links, had to look at the source code to find them :-)
Goppi
Posts: 4
Joined: 28 Jan 2014 21:31

Re: EFA unstable - export of settings possible?

Post by Goppi »

Jfi - vmware links are working again.
Post Reply