Migrate from ESVA to EFA

Questions and answers about how to do stuff
Post Reply
User avatar
shawniverson
Posts: 3644
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Migrate from ESVA to EFA

Post by shawniverson »

Here's a basic howto to migrate from ESVA to EFA.

1) Export users and lists from ESVA.

SSH into your ESVA installation as root and run the following (without <>):

Code: Select all

mysqldump -u<yourmysqluser> -p<yourmysqlpassword> mailscanner users > /root/users.sql 

Code: Select all

mysqldump -u<yourmysqluser> -p<yourmysqlpassword> mailscanner userfilters > /root/userfilters.sql 

Code: Select all

mysqldump -u<yourmysqluser> -p<yourmysqlpassword> mailscanner whitelist >/root/whitelist.sql 

Code: Select all

mysqldump -u<yourmysqluser> -p<yourmysqlpassword> mailscanner blacklist >/root/blacklist.sql 
2) Transfer these sql files to your EFA system using WinSCP or similar

3) Backup your mailscanner on EFA, just in case

Look in /etc/EFA-Config for the root mysql password and copy it for the next commands

Code: Select all

sudo mysqldump -uroot -p<yourmysqlpassword> mailscanner > /root/mybackup.sql
3) Import users and lists into EFA as root

Stop mailscanner

Code: Select all

sudo service MailScanner stop

Code: Select all

sudo mysql -uroot -p<yourmysqlpassword> mailscanner < /path/to/users.sql 

Code: Select all

sudo mysql -uroot -p<yourmysqlpassword> mailscanner < /path/to/userfilters.sql 

Code: Select all

sudo mysql -uroot -p<yourmysqlpassword> mailscanner < /path/to/whitelist.sql 

Code: Select all

sudo mysql -uroot -p<yourmysqlpassword> mailscanner < /path/to/blacklist.sql 

4) Start MailScanner

Code: Select all

sudo service MailScanner start
Log in and check your work. Note that you will need to log in with the admin that originally existed in your ESVA installation.
Rob.M.P
Posts: 26
Joined: 28 Jan 2014 23:01

Re: Migrate from ESVA to EFA

Post by Rob.M.P »

Great guide...Had EFA configured and ready to go. Now I've migrated the data from ESVA (this was the final step) EFA will go into the production enviroment!

Many Thanks.
microcore
Posts: 7
Joined: 10 Mar 2014 20:51

Re: Migrate from ESVA to EFA

Post by microcore »

When I import I get the following error: mysqldump: Got error: 1045: Access denied for user 'root' @ 'localhost' (using password: YES) When trying to connect.
What is the username and password of mysql?
Rob.M.P
Posts: 26
Joined: 28 Jan 2014 23:01

Re: Migrate from ESVA to EFA

Post by Rob.M.P »

Have a look in /etc/EFA-Config for your MySQL Password...
microcore
Posts: 7
Joined: 10 Mar 2014 20:51

Re: Migrate from ESVA to EFA

Post by microcore »

I found him there ...
Thank you :D
Mr. Happy
Posts: 51
Joined: 03 Jan 2014 17:07

Re: Migrate from ESVA to EFA

Post by Mr. Happy »

It's also possible to import old mail into EFA.
Zip the quarantine folder and scp it to the new host.
Export the maillog to a sql file and scp this also to the new host.
Extract the quarantine file in the existing quarantine folder.
Import the sql file and run the following sql query:

Code: Select all

SELECT DISTINCT hostname FROM maillog;
This will return two records -- the new name and the old name -- run the
following SQL:

Code: Select all

UPDATE maillog SET hostname='<new hostname>', timestamp=timestamp WHERE hostname <> '<new hostname>';
User avatar
shawniverson
Posts: 3644
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Migrate from ESVA to EFA

Post by shawniverson »

:text-bravo:
bradleytompkins
Posts: 1
Joined: 26 Aug 2015 04:23

Re: Migrate from ESVA to EFA

Post by bradleytompkins »

Will these instructions work for an EFA to EFA migration? I need to migrate a well tuned EFA system from Hyper-V to VMware. Ideally without having to retrain the bayes filter.
User avatar
shawniverson
Posts: 3644
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Migrate from ESVA to EFA

Post by shawniverson »

Yes. Extra steps may be needed to transfer the Bayes DB, though.
User avatar
pdwalker
Posts: 1553
Joined: 18 Mar 2015 09:16

Re: Migrate from ESVA to EFA

Post by pdwalker »

Has anyone done an EFA to EFA migration? If so, were you successful? What extra steps did you take?

The reason I ask is that I've made a number of changes to my efa box and I'm worried that the next update will fail, or do something weird. I think I'd rather start off with an uncustomized installation and then re-add back any necessary changes (and document my changes this time).

Thoughts?
User avatar
shawniverson
Posts: 3644
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Migrate from ESVA to EFA

Post by shawniverson »

Perhaps we could team up on this, if you are willing.

I need to write a migration utility for the next EFA update.

Basically like backup except that it exports and imports between EFA appliances.

This is needed for v4 in the future anyway.
User avatar
pdwalker
Posts: 1553
Joined: 18 Mar 2015 09:16

Re: Migrate from ESVA to EFA

Post by pdwalker »

I'm game.

i run efa in kvm/qemu on a zfs file system so snapshotting is easy. it's an installation installed as 3.0.0.7, customized, upgraded to 3.0.0.8 and customized some more.

it'll be interesting to see how much that complicates things.

what do you need me to do?
User avatar
pdwalker
Posts: 1553
Joined: 18 Mar 2015 09:16

Re: Migrate from ESVA to EFA

Post by pdwalker »

Just to let you know. I've a snapshot of my 3.0.0.8 vm that I can use for migration testing.
Post Reply