Backup & Restore Gone Wrong

Questions and answers about how to do stuff
Post Reply
mcit
Posts: 27
Joined: 23 May 2014 01:24

Backup & Restore Gone Wrong

Post by mcit »

Hi Everyone,

I appear to be at the limits of my ability on this one. I need to restore a backup of my efa 4.0.4 to a new instance. I have provisioned the new machine, hardware and storage all the same. I have gone for an AlmaLinux 8.7 install, whereas the old system was CentOS7.

All goes well, until the data is restored from the backup. I have now tried this 3 times, each time I get the same result.

Once the restore is complete, I can no longer log into the Mailwatch GUI, as I just get the red
---
Error: Database connection failed

It is possible that the database is overloaded or otherwise not running properly

Contact the system administrator if the problem persists
---

MariaDB is running, but I cannot login to it no matter which password I use. I have tried root, sqlgrey, and mailwatch passwords from their respective files in /etc/eFa/

Below is the log from the restore process. Can someone see a specific issue here that may help get my restore to work. I can see there are some errors in this, but I do not have enough understanding to know what needs to be addressed here.


--------------------------------------------------------------
--- Welcome to the eFa Configuration program ---
--- https://www.efa-project.org ---
--------------------------------------------------------------


System Restore

!!!WARNING!!!
System Restore is intended to be used in disaster recovery
situations only as a last resort! Rolling back the system
to a recent backup can have consequences, such as the need to
clean up MySQL databases and loss of recent configuration changes.

[eFa] Are you sure you want to continue? (y/N):y
--------------------------------------------------------------
--- Welcome to the eFa Configuration program ---
--- https://www.efa-project.org ---
--------------------------------------------------------------

Backup Listing

1) /var/eFa/backup/backup-20221204-150610.tar.gz
2) /var/eFa/backup/backup-20221128-061549.tar.gz
3) /var/eFa/backup/backup-20221129-081626.tar.gz
4) /var/eFa/backup/backup-20221130-052429.tar.gz
5) /var/eFa/backup/backup-20221201-035145.tar.gz
6) /var/eFa/backup/backup-20221202-084449.tar.gz
7) /var/eFa/backup/backup-20221203-055937.tar.gz

Choose a backup or press (e) to exit:4
You have chosen 4

4) /var/eFa/backup/backup-20221130-052429.tar.gz

Proceed with restore? (y/N)
y
Beginning Restore of /var/eFa/backup/backup-20221130-052429.tar.gz...

./
./backup/
./backup/sql/
./backup/sql/backup.sql
./backup/etc/
./backup/etc/postfix/
./backup/etc/postfix/ssl/
./backup/etc/postfix/ssl/dhparam.pem
./backup/etc/postfix/ssl/smtpd.pem
./backup/etc/postfix/dynamicmaps.cf
./backup/etc/postfix/main.cf
./backup/etc/postfix/master.cf
./backup/etc/postfix/access
./backup/etc/postfix/helo_access
./backup/etc/postfix/recipient_access
./backup/etc/postfix/sender_access
./backup/etc/postfix/transport
./backup/etc/postfix/virtual
./backup/etc/postfix/sasl_passwd
./backup/etc/postfix/relocated
./backup/etc/postfix/canonical
./backup/etc/postfix/generic
./backup/etc/postfix/header_checks
./backup/etc/eFa/
./backup/etc/eFa/eFa-Config
./backup/etc/eFa/MailWatch-Config
./backup/etc/eFa/MySQL-Config
./backup/etc/eFa/openDMARC-Config
./backup/etc/eFa/SA-Config
./backup/etc/eFa/SQLGrey-Config
./backup/etc/sysconfig/
./backup/etc/sysconfig/anaconda
./backup/etc/sysconfig/atd
./backup/etc/sysconfig/cbq/
./backup/etc/sysconfig/cbq/avpkt
./backup/etc/sysconfig/cbq/cbq-0000.example
./backup/etc/sysconfig/certbot
./backup/etc/sysconfig/chronyd
./backup/etc/sysconfig/console/
./backup/etc/sysconfig/cpupower
./backup/etc/sysconfig/crond
./backup/etc/sysconfig/daemons/
./backup/etc/sysconfig/daemons/webmin
./backup/etc/sysconfig/ebtables-config
./backup/etc/sysconfig/firewalld
./backup/etc/sysconfig/freshclam
./backup/etc/sysconfig/grub
./backup/etc/sysconfig/htcacheclean
./backup/etc/sysconfig/httpd
./backup/etc/sysconfig/init
./backup/etc/sysconfig/ip6tables-config
./backup/etc/sysconfig/iptables-config
./backup/etc/sysconfig/irqbalance
./backup/etc/sysconfig/kdump
./backup/etc/sysconfig/kernel
./backup/etc/sysconfig/man-db
./backup/etc/sysconfig/modules/
./backup/etc/sysconfig/netconsole
./backup/etc/sysconfig/network
./backup/etc/sysconfig/network-scripts/
./backup/etc/sysconfig/network-scripts/ifcfg-lo
./backup/etc/sysconfig/network-scripts/ifdown-bnep
./backup/etc/sysconfig/network-scripts/ifdown-eth
./backup/etc/sysconfig/network-scripts/ifdown-ippp
./backup/etc/sysconfig/network-scripts/ifdown-ipv6
./backup/etc/sysconfig/network-scripts/ifdown-post
./backup/etc/sysconfig/network-scripts/ifdown-ppp
./backup/etc/sysconfig/network-scripts/ifdown-routes
./backup/etc/sysconfig/network-scripts/ifdown-sit
./backup/etc/sysconfig/network-scripts/ifdown-tunnel
./backup/etc/sysconfig/network-scripts/ifup-aliases
./backup/etc/sysconfig/network-scripts/ifup-bnep
./backup/etc/sysconfig/network-scripts/ifup-eth
./backup/etc/sysconfig/network-scripts/ifup-ippp
./backup/etc/sysconfig/network-scripts/ifup-ipv6
./backup/etc/sysconfig/network-scripts/ifup-plip
./backup/etc/sysconfig/network-scripts/ifup-plusb
./backup/etc/sysconfig/network-scripts/ifup-post
./backup/etc/sysconfig/network-scripts/ifup-ppp
./backup/etc/sysconfig/network-scripts/ifup-routes
./backup/etc/sysconfig/network-scripts/ifup-sit
./backup/etc/sysconfig/network-scripts/ifup-tunnel
./backup/etc/sysconfig/network-scripts/ifup-wireless
./backup/etc/sysconfig/network-scripts/init.ipv6-global
./backup/etc/sysconfig/network-scripts/network-functions
./backup/etc/sysconfig/network-scripts/network-functions-ipv6
./backup/etc/sysconfig/network-scripts/ifdown-Team
./backup/etc/sysconfig/network-scripts/ifdown-TeamPort
./backup/etc/sysconfig/network-scripts/ifup-Team
./backup/etc/sysconfig/network-scripts/ifup-TeamPort
./backup/etc/sysconfig/network-scripts/ifcfg-eth0
./backup/etc/sysconfig/network-scripts/ifdown-isdn
./backup/etc/sysconfig/network-scripts/ifup-isdn
./backup/etc/sysconfig/network-scripts/ifup
./backup/etc/sysconfig/network-scripts/ifdown
./backup/etc/sysconfig/network-scripts.bak/
./backup/etc/sysconfig/network-scripts.bak/ifcfg-eth0.bak
./backup/etc/sysconfig/ntpdate
./backup/etc/sysconfig/opendkim
./backup/etc/sysconfig/opendmarc
./backup/etc/sysconfig/qemu-ga
./backup/etc/sysconfig/raid-check
./backup/etc/sysconfig/rdisc
./backup/etc/sysconfig/readonly-root
./backup/etc/sysconfig/rpcbind
./backup/etc/sysconfig/rpc-rquotad
./backup/etc/sysconfig/rsyncd
./backup/etc/sysconfig/rsyslog
./backup/etc/sysconfig/run-parts
./backup/etc/sysconfig/saslauthd
./backup/etc/sysconfig/selinux
./backup/etc/sysconfig/smartmontools
./backup/etc/sysconfig/sshd
./backup/etc/sysconfig/sysstat
./backup/etc/sysconfig/sysstat.ioconf
./backup/etc/sysconfig/unbound
./backup/etc/sysconfig/wpa_supplicant
./backup/etc/passwd
./backup/etc/fstab
./backup/etc/shadow
./backup/etc/clamd.d/
./backup/etc/clamd.d/scan.conf
./backup/etc/hosts
./backup/etc/hosts.allow
./backup/etc/hosts.bak
./backup/etc/hosts.deny
./backup/etc/networks
./backup/etc/my.cnf
./backup/etc/my.cnf.d/
./backup/etc/my.cnf.d/client.cnf
./backup/etc/my.cnf.d/enable_encryption.preset
./backup/etc/my.cnf.d/mariadb-server.cnf
./backup/etc/my.cnf.d/mariadb-server.cnf.rpmnew
./backup/etc/my.cnf.d/mysql-clients.cnf
./backup/etc/php.ini
./backup/etc/php-fpm.conf
./backup/etc/php-fpm.d/
./backup/etc/php-fpm.d/www.conf
./backup/etc/resolv.conf
./backup/etc/sudo.conf
./backup/etc/sudoers.d/
./backup/etc/sudoers.d/eFa-Services
./backup/etc/sudoers.d/eFa-users
./backup/etc/sudoers.d/mailwatch
./backup/etc/MailScanner/
./backup/etc/MailScanner/archives.filename.rules
./backup/etc/MailScanner/archives.filename.rules.allowall.conf
./backup/etc/MailScanner/archives.filename.rules.conf
./backup/etc/MailScanner/archives.filetype.rules
./backup/etc/MailScanner/archives.filetype.rules.allowall.conf
./backup/etc/MailScanner/archives.filetype.rules.conf
./backup/etc/MailScanner/conf.d/
./backup/etc/MailScanner/conf.d/README
./backup/etc/MailScanner/country.domains.conf
./backup/etc/MailScanner/custom
./backup/etc/MailScanner/defaults
./backup/etc/MailScanner/filename.rules
./backup/etc/MailScanner/filename.rules.allowall.conf
./backup/etc/MailScanner/filename.rules.conf
./backup/etc/MailScanner/filetype.rules
./backup/etc/MailScanner/filetype.rules.allowall.conf
./backup/etc/MailScanner/filetype.rules.conf
./backup/etc/MailScanner/MailScanner.conf
./backup/etc/MailScanner/mcp/
./backup/etc/MailScanner/mcp/10_example.cf
./backup/etc/MailScanner/mcp/mcp.spamassassin.conf
./backup/etc/MailScanner/mcp/v342.pre
./backup/etc/MailScanner/mcp/v341.pre
./backup/etc/MailScanner/mcp/v340.pre
./backup/etc/MailScanner/mcp/v330.pre
./backup/etc/MailScanner/mcp/v320.pre
./backup/etc/MailScanner/mcp/v312.pre
./backup/etc/MailScanner/mcp/v310.pre
./backup/etc/MailScanner/mcp/init.pre
./backup/etc/MailScanner/numeric.phishing.rules
./backup/etc/MailScanner/phishing.bad.sites.conf
./backup/etc/MailScanner/phishing.bad.sites.conf.master
./backup/etc/MailScanner/phishing.bad.sites.conf.master.backup
./backup/etc/MailScanner/phishing.bad.sites.custom
./backup/etc/MailScanner/phishing.safe.sites.conf
./backup/etc/MailScanner/phishing.safe.sites.conf.master
./backup/etc/MailScanner/phishing.safe.sites.conf.master.backup
./backup/etc/MailScanner/phishing.safe.sites.custom
./backup/etc/MailScanner/reports
./backup/etc/MailScanner/rules/
./backup/etc/MailScanner/rules/EXAMPLES
./backup/etc/MailScanner/rules/README
./backup/etc/MailScanner/rules/bounce.rules
./backup/etc/MailScanner/rules/external.message.rules
./backup/etc/MailScanner/rules/max.message.size.rules
./backup/etc/MailScanner/rules/spam.whitelist.rules
./backup/etc/MailScanner/rules/spam.blacklist.rules
./backup/etc/MailScanner/rules/sig.html.rules
./backup/etc/MailScanner/rules/sig.text.rules
./backup/etc/MailScanner/rules/content.scanning.rules
./backup/etc/MailScanner/rules/password.rules
./backup/etc/MailScanner/spamassassin.conf
./backup/etc/MailScanner/spamassassin.conf.bak
./backup/etc/MailScanner/spam.lists.conf
./backup/etc/MailScanner/virus.scanners.conf
./backup/etc/cron.d/
./backup/etc/cron.d/0hourly
./backup/etc/cron.d/sysstat
./backup/etc/cron.d/raid-check
./backup/etc/cron.d/clamav-update
./backup/etc/cron.d/msre_reload
./backup/etc/cron.d/checkreboot
./backup/etc/cron.d/eFa-Monitor.cron
./backup/etc/cron.daily/
./backup/etc/cron.daily/logrotate
./backup/etc/cron.daily/mlocate
./backup/etc/cron.daily/man-db.cron
./backup/etc/cron.daily/mailscanner
./backup/etc/cron.daily/0yum-daily.cron
./backup/etc/cron.daily/mailwatch
./backup/etc/cron.daily/eFa-Backup.cron
./backup/etc/cron.daily/trim-txrep
./backup/etc/cron.daily/eFa-SAClean
./backup/etc/cron.daily/eFa-Tokens.cron
./backup/etc/cron.daily/eFa-Daily-DMARC
./backup/etc/cron.daily/cron-dccd
./backup/etc/cron.deny
./backup/etc/cron.hourly/
./backup/etc/cron.hourly/0anacron
./backup/etc/cron.hourly/mailscanner
./backup/etc/cron.hourly/0yum-hourly.cron
./backup/etc/cron.monthly/
./backup/etc/cron.monthly/mailwatch
./backup/etc/crontab
./backup/etc/cron.weekly/
./backup/etc/cron.weekly/eFa-Weekly-DMARC
./backup/etc/sqlgrey/
./backup/etc/sqlgrey/clients_fqdn_whitelist
./backup/etc/sqlgrey/clients_fqdn_whitelist.local
./backup/etc/sqlgrey/clients_ip_whitelist
./backup/etc/sqlgrey/clients_ip_whitelist.local
./backup/etc/sqlgrey/discrimination.regexp
./backup/etc/sqlgrey/dyn_fqdn.regexp
./backup/etc/sqlgrey/README
./backup/etc/sqlgrey/smtp_server.regexp
./backup/etc/sqlgrey/sqlgrey.conf
./backup/etc/ssh/
./backup/etc/ssh/moduli
./backup/etc/ssh/ssh_config
./backup/etc/ssh/sshd_config
./backup/etc/ssh/ssh_host_dsa_key
./backup/etc/ssh/ssh_host_dsa_key.pub
./backup/etc/ssh/ssh_host_ecdsa_key
./backup/etc/ssh/ssh_host_ecdsa_key.pub
./backup/etc/ssh/ssh_host_ed25519_key
./backup/etc/ssh/ssh_host_ed25519_key.pub
./backup/etc/ssh/ssh_host_rsa_key
./backup/etc/ssh/ssh_host_rsa_key.pub
./backup/etc/pki/
./backup/etc/pki/CA/
./backup/etc/pki/CA/certs/
./backup/etc/pki/CA/crl/
./backup/etc/pki/CA/newcerts/
./backup/etc/pki/CA/private/
./backup/etc/pki/ca-trust/
./backup/etc/pki/ca-trust/README
./backup/etc/pki/ca-trust/ca-legacy.conf
./backup/etc/pki/ca-trust/extracted/
./backup/etc/pki/ca-trust/extracted/README
./backup/etc/pki/ca-trust/extracted/java/
./backup/etc/pki/ca-trust/extracted/java/README
./backup/etc/pki/ca-trust/extracted/java/cacerts
./backup/etc/pki/ca-trust/extracted/openssl/
./backup/etc/pki/ca-trust/extracted/openssl/README
./backup/etc/pki/ca-trust/extracted/openssl/ca-bundle.trust.crt
./backup/etc/pki/ca-trust/extracted/pem/
./backup/etc/pki/ca-trust/extracted/pem/README
./backup/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
./backup/etc/pki/ca-trust/extracted/pem/email-ca-bundle.pem
./backup/etc/pki/ca-trust/extracted/pem/objsign-ca-bundle.pem
./backup/etc/pki/ca-trust/source/
./backup/etc/pki/ca-trust/source/README
./backup/etc/pki/ca-trust/source/anchors/
./backup/etc/pki/ca-trust/source/blacklist/
./backup/etc/pki/ca-trust/source/ca-bundle.legacy.crt
./backup/etc/pki/dovecot/
./backup/etc/pki/dovecot/certs/
./backup/etc/pki/dovecot/certs/dovecot.pem
./backup/etc/pki/dovecot/dovecot-openssl.cnf
./backup/etc/pki/dovecot/private/
./backup/etc/pki/dovecot/private/dovecot.pem
./backup/etc/pki/java/
./backup/etc/pki/java/cacerts
./backup/etc/pki/nssdb/
./backup/etc/pki/nssdb/cert8.db
./backup/etc/pki/nssdb/cert9.db
./backup/etc/pki/nssdb/key3.db
./backup/etc/pki/nssdb/key4.db
./backup/etc/pki/nssdb/pkcs11.txt
./backup/etc/pki/nssdb/secmod.db
./backup/etc/pki/nss-legacy/
./backup/etc/pki/nss-legacy/nss-rhel7.config
./backup/etc/pki/rpm-gpg/
./backup/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
./backup/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Debug-7
./backup/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Testing-7
./backup/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
./backup/etc/pki/rpm-gpg/RPM-GPG-KEY-IUS-7
./backup/etc/pki/rsyslog/
./backup/etc/pki/tls/
./backup/etc/pki/tls/certs/
./backup/etc/pki/tls/certs/Makefile
./backup/etc/pki/tls/certs/make-dummy-cert
./backup/etc/pki/tls/certs/renew-dummy-cert
./backup/etc/pki/tls/certs/localhost.crt
./backup/etc/pki/tls/certs/ca-bundle.trust.crt
./backup/etc/pki/tls/certs/ca-bundle.crt
./backup/etc/pki/tls/misc/
./backup/etc/pki/tls/misc/CA
./backup/etc/pki/tls/misc/c_hash
./backup/etc/pki/tls/misc/c_info
./backup/etc/pki/tls/misc/c_issuer
./backup/etc/pki/tls/misc/c_name
./backup/etc/pki/tls/openssl.cnf
./backup/etc/pki/tls/private/
./backup/etc/pki/tls/private/localhost.key
./backup/etc/pki/tls/cert.pem
./backup/etc/httpd/
./backup/etc/httpd/conf/
./backup/etc/httpd/conf/httpd.conf
./backup/etc/httpd/conf/magic
./backup/etc/httpd/conf.d/
./backup/etc/httpd/conf.d/README
./backup/etc/httpd/conf.d/userdir.conf
./backup/etc/httpd/conf.d/php.conf
./backup/etc/httpd/conf.d/ssl.conf
./backup/etc/httpd/conf.d/autoindex.conf.orig
./backup/etc/httpd/conf.d/redirectssl.conf
./backup/etc/httpd/conf.d/fpm.conf
./backup/etc/httpd/conf.d/autoindex.conf
./backup/etc/httpd/conf.d/welcome.conf
./backup/etc/httpd/conf.modules.d/
./backup/etc/httpd/conf.modules.d/00-base.conf
./backup/etc/httpd/conf.modules.d/00-dav.conf
./backup/etc/httpd/conf.modules.d/00-lua.conf
./backup/etc/httpd/conf.modules.d/00-mpm.conf
./backup/etc/httpd/conf.modules.d/00-optional.conf
./backup/etc/httpd/conf.modules.d/00-proxy.conf
./backup/etc/httpd/conf.modules.d/00-systemd.conf
./backup/etc/httpd/conf.modules.d/01-cgi.conf
./backup/etc/httpd/conf.modules.d/README
./backup/etc/httpd/conf.modules.d/15-php.conf
./backup/etc/httpd/conf.modules.d/00-ssl.conf
./backup/etc/httpd/logs
./backup/etc/httpd/modules
./backup/etc/httpd/run
./backup/etc/unbound/
./backup/etc/unbound/conf.d/
./backup/etc/unbound/conf.d/example.com.conf
./backup/etc/unbound/conf.d/forwarders.conf
./backup/etc/unbound/icannbundle.pem
./backup/etc/unbound/keys.d/
./backup/etc/unbound/keys.d/example.com.key
./backup/etc/unbound/local.d/
./backup/etc/unbound/local.d/block-example.com.conf
./backup/etc/unbound/root.key
./backup/etc/unbound/unbound.conf
./backup/etc/unbound/unbound.conf.rpmnew
./backup/etc/unbound/unbound_control.key
./backup/etc/unbound/unbound_control.pem
./backup/etc/unbound/unbound_server.key
./backup/etc/unbound/unbound_server.pem
./backup/etc/mail/
./backup/etc/mail/spamassassin/
./backup/etc/mail/spamassassin/local.cf
./backup/etc/opendkim/
./backup/etc/opendkim/keys/
./backup/etc/opendkim/KeyTable
./backup/etc/opendkim/SigningTable
./backup/etc/opendkim/TrustedHosts
./backup/var/
./backup/var/www/
./backup/var/www/html/
./backup/var/www/html/mailscanner/
./backup/var/www/html/mailscanner/conf.php
Foreign backup detected, performing import...
postmap: warning: /etc/postfix/dynamicmaps.cf: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf.d/cdb: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf.d/ldap: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf.d/mysql: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf.d/pcre: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf.d/pgsql: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf.d/sqlite: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf.d/cdb: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf.d/ldap: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf.d/mysql: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf.d/pcre: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf.d/pgsql: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf.d/sqlite: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf.d/cdb: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf.d/ldap: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf.d/mysql: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf.d/pcre: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf.d/pgsql: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf.d/sqlite: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf.d/cdb: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf.d/ldap: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf.d/mysql: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf.d/pcre: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf.d/pgsql: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf.d/sqlite: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf.d/cdb: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf.d/ldap: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf.d/mysql: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf.d/pcre: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf.d/pgsql: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf.d/sqlite: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf.d/cdb: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf.d/ldap: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf.d/mysql: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf.d/pcre: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf.d/pgsql: file is owned or writable by non-root users -- skipping this file
postmap: warning: /etc/postfix/dynamicmaps.cf.d/sqlite: file is owned or writable by non-root users -- skipping this file
Added new: Lockfile Dir = /var/spool/MailScanner/incoming/Locks
Added new: include /etc/MailScanner/conf.d/*

Summary
-------
Read 390 settings from old /etc/MailScanner/MailScanner.conf.original
Used 389 settings from old /etc/MailScanner/MailScanner.conf.original
Used 3 default settings from new /etc/MailScanner/MailScanner.conf.restore


ERROR 1105 (HY000) at line 1: Unknown error
Error: Database connection failed: it is possible that the database is overloaded or otherwise not running properly; contact the system administrator if the problem persists
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Phase 1/7: Checking and upgrading mysql database
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Processing databases
mysql
mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
mysql.global_priv OK
mysql.gtid_slave_pos OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.index_stats OK
mysql.innodb_index_stats OK
mysql.innodb_table_stats OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.roles_mapping OK
mysql.servers OK
mysql.table_stats OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.transaction_registry OK
mysql.user OK
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Phase 2/7: Installing used storage engines... Skipped
Phase 3/7: Fixing views
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Phase 4/7: Running 'mysql_fix_privilege_tables'
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Phase 5/7: Fixing table and database names
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Phase 6/7: Checking and upgrading tables
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Processing databases
efa
efa.tokens OK
information_schema
mailscanner
mailscanner.audit_log OK
mailscanner.autorelease OK
mailscanner.blacklist OK
mailscanner.inq OK
mailscanner.maillog OK
mailscanner.mcp_rules OK
mailscanner.mtalog OK
mailscanner.mtalog_ids OK
mailscanner.outq OK
mailscanner.sa_rules OK
mailscanner.saved_filters OK
mailscanner.user_filters OK
mailscanner.users OK
mailscanner.whitelist OK
opendmarc
opendmarc.arcauthresults OK
opendmarc.arcseals OK
opendmarc.domains OK
opendmarc.ipaddr OK
opendmarc.messages OK
opendmarc.reporters OK
opendmarc.requests OK
opendmarc.selectors OK
opendmarc.signatures OK
performance_schema
sa_bayes
sa_bayes.bayes_expire OK
sa_bayes.bayes_global_vars OK
sa_bayes.bayes_seen OK
sa_bayes.bayes_token OK
sa_bayes.bayes_vars OK
sa_bayes.txrep OK
sqlgrey
sqlgrey.config OK
sqlgrey.connect OK
sqlgrey.domain_awl OK
sqlgrey.from_awl OK
sqlgrey.optin_domain OK
sqlgrey.optin_email OK
sqlgrey.optout_domain OK
sqlgrey.optout_email OK
temp
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Phase 7/7: Running 'FLUSH PRIVILEGES'
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
OK
Restore Complete!

A restart is needed to complete restore. Press enter to reboot.
Press [Enter] key to continue...
User avatar
shawniverson
Posts: 3607
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Backup & Restore Gone Wrong

Post by shawniverson »

Just out of curiosity, did you set up the replacement with eFa Init before restoring the backup?

It appears either the database isn't running or wasn't initialized, which means you may need to run through setting up the appliance, then run the restore over it so that the database is in a ready state.
mcit
Posts: 27
Joined: 23 May 2014 01:24

Re: Backup & Restore Gone Wrong

Post by mcit »

Yes, I had been through the eFa-Init process prior to the restore.

I was able to log in to Mailwatch via the Web, it was a clean slate.
User avatar
shawniverson
Posts: 3607
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Backup & Restore Gone Wrong

Post by shawniverson »

I'm not exactly sure why this is failing.

To troubleshoot, what I would do is manually carry out the restore tasks that can be found in /var/eFa/lib/eFa-Configure/func_systemrestore

So, starting on line 60 when a backup is chosen it starts by cd in to /var/eFa/backup and then expands the tarball.

Then on line 66 it grabs the root mysql password and stores in the MYSQLROOTPWD variable.

Code: Select all

 grep MYSQLROOTPWD /etc/eFa/MySQL-Config | sed 's/.*://'`
Then it jumps to line 186, grabs the former password in the backup, and checks to see if they are different (which they are).

More variables get populated and files get copied around etc.

At line 230 the password should be reset to the one found in the backup

Code: Select all

/usr/bin/mysqladmin -u root -p$MYSQLROOTPWD password "$RESTOREMYSQLROOTPWD"
MYSQLROOTPWD=$RESTOREMYSQLROOTPWD
This is a possible failure point if for some reason the password is not getting reset here.

Then on line 254 the backup of the databases is restored

Code: Select all

/usr/bin/mysql --user=root --password=$MYSQLROOTPWD < backup.sql
It is here I wonder if something is going wrong. I do see a mistake at line 252 but it shouldn't cause your failure. (it is what is causing all the getcwd messages in your restore log)
mcit
Posts: 27
Joined: 23 May 2014 01:24

Re: Backup & Restore Gone Wrong

Post by mcit »

Thank you, I will setup a fresh install later today and go through these steps.

I will let you know what happens.

Matthew
mcit
Posts: 27
Joined: 23 May 2014 01:24

Re: Backup & Restore Gone Wrong

Post by mcit »

Ok, so I was not able to get this over the line.

My belief is that my backup contains a damaged database. Even when I try to restore manually step by step, I always hose the system after the restore of the database.

But I did learn a great deal about mariadb / mysql in this process.

In the end, I was able to export all tables with the exception of the maillog from the backup database, and import them into a fresh install.

It means I could not keep my quarantine which I had been aiming for, but that is not the end of the world. I have improved ym backup strategy in order to take full server snapshots now, rather than just rely on the automatic backups.

There is something did catch me out with the auto backup, if this is documented I must have missed it, but if not it might warrant a mention.

When a new EFA is spun up, if you do not use CentOS, [which I didn't], the default name of the LVM will differ. This is fine in itself, but the restore process also restores the /etc/fstab configuration of the old server, so one needs to make a copy of this before, otherwise the system does not boot after the restore.

Thank you to Shawn for your help with the func_systemrestore info, this is what got me everything I needed to get up and running again.

Matthew
Post Reply