Page 1 of 1

SQL error during restore

Posted: 14 Feb 2015 22:25
by stefan
Hi,

I want to restore the backup file I created on another EFA virtal machine, and during the restore process I see this error message:

./backup/sql/backup.sql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

Both machines (source and target) were built from EFA 3.0.0.5 and have latest updates applied.

Has anybody an idea how to solve this?

Thanks,
Stefan

Re: SQL error during restore

Posted: 15 Feb 2015 13:13
by shawniverson
Usually means you are using the wrong password on the target appliance...

Re: SQL error during restore

Posted: 15 Feb 2015 20:31
by stefan
I have used the same password during the setup dialog.
I also checked /etc/EFA-Config on both machines, I can see the same passwords there.

Thanks,
Stefan

Re: SQL error during restore

Posted: 16 Feb 2015 21:48
by shawniverson
No two EFA Appliances should have the same password...also note that the SQL root password is not the same as the console root password.

Re: SQL error during restore

Posted: 18 Feb 2015 06:02
by stefan
Hi,

thanks for your help and sorry for not expressing myself clearly enough.
This is what I want to achieve:

- Copy all settings and historical data from one EFA to another.

This is what I have done:

- Take a backup of the old one
- Newly installed a second EFA VM
- After finishing the initial setup dialog I copied the backup file to the disk of the new EFA
- Used EFA Menu via SSH to restore the backup (option 13)
- then I received that error message

Is this the correct process? I'm never asked for any password during the restore.

Thanks,
Stefan

Re: SQL error during restore

Posted: 18 Feb 2015 11:51
by shawniverson
Oh, I follow you now :D

I've never had anyone try this as a migration tool before....

I intended it as a recovery mechanism for an single existing EFA...but now you have my gears turning.

The backup process does the following:

0) Perform a SQL dump
1) backup postfix configs
2) backup EFA-Config
3) Backup sysconfig
4) Backup parts of /etc
5) Backup Mailscanner config
6) Backup Cron jobs
7) Backup SQLGrey config
8) Backup SSH config
9) Backup PKI config/keys
10) Backup MailWatch config
11) Backup Apache config

The problem is that most of these backup items contain information specific and unique to the source EFA. If you run a restore on the same EFA, you are golden. Transferring this to another EFA results in a mess. In your case, the /etc/EFA-Config is overwritten on the destination appliance, and the wrong SQL password is automatically attempted.

So, I either need to as an enhancement 1) sanitize the backup for portability or 2) add a migration option that skips/merges configs with a destination appliance.

In the meantime, please take a look at this since it is applicable to your situation, instead of an ESVA to EFA it is an EFA to EFA...

viewtopic.php?f=14&t=513

Re: SQL error during restore

Posted: 22 Feb 2015 18:25
by stefan
Thanks, I will try that!
In my specific case I see strange disk errors, probaby because of a faulty disk in my ESX - that's why I need to migrate to another machine.

Re: SQL error during restore

Posted: 06 Mar 2016 14:32
by akl
Hi Shawn,

I understood, that a migration is not successful because the passwords in the backup EFA-Config dont match the passwords on the target machine. Every installation has its own randomly created passwords.

Is that correct?

Since data in EFA-Config seems to contain only machine individual parameters like ip settings a.s.o., what do you think about first insert the taget machine's EFA-Config into the backup-tarfile and then do the restore?

Cheers
akl