Hello, I recently migrated a server using the migration tool and then days later I needed to move the updated DB over to the new host so I dumped all db's using mysqldump and then imported the dump on the new host. There were some issues (mainly needed to update passwords used by ispconfig) but I have since corrected them. The only problem that is lingering is that automated and manual db backups are failing. I've confirmed the correct credentials exist on /usr/local/ispconfig/server/lib/mysql_clientdb.conf. I have also done a force update using the update script. I've looked at any file I could find which contains a sql password and it doesnt seem to be the issue... running mysqldump via cli also works without issue... Does anyone have an idea as to why db backups might be failing? Thanks for your help!
It would have been better to let the migration tool take care of copying over the database, it can also resync data after migration has been done... For future migrations Do you have any errors in your log regarding the failure of the backups?
oh, I didn't realize it could resync! Thanks for letting me know, I actually plan on migrating a different instance as well. The only error shown in ispconfig log is Code: Failed to make backup of database dbname, because mysqldump failed I've looked for mysql logs in /var/log/mysql/ but there are none in there.
See https://www.howtoforge.com/tutorial...spconfig-31-single-server/#resync-your-target for more information on resyncing. What you can try is doing a forced ISPConfig upgrade and answering yes when it asks to reconfigure DB permissions. Code: ispconfig_update.sh --force
Just tried that and then tried to manually do the backup but I'm still getting the same error. Not sure if this helps, but web backup works fine, DB is the only one affected.
Can you check if you can login with the username and password in /usr/local/ispconfig/server/lib/config.inc.php?
Yup, I can log in using the credentials in the "//** Database" section. db dbispconfig user ispconfig
Please test if you can login to MySQL with the details from /usr/local/ispconfig/server/lib/mysql_clientdb.conf using localhost as well as 127.0.0.1. Maybe one of them fails: mysql -h localhost -u root -p and mysql -h 127.0.0.1 -u root -p with the password from /usr/local/ispconfig/server/lib/mysql_clientdb.conf should both work.
Hey Till, Just tested both of those and they both logged me in just fine (used password from /usr/local/ispconfig/server/lib/mysql_clientdb.conf)
Please edit the file /usr/local/ispconfig/server/lib/classes/backup.inc.php, before doing this, please make a backup copy. Replace line 1835: Code: $app->log('Failed to make backup of database ' . $rec['database_name'] . ', because mysqldump failed', LOGLEVEL_ERROR); with: Code: $app->log("mysqldump -h $clientdb_host -u $clientdb_user -p$clientdb_password -c --add-drop-table --create-options --quick --max_allowed_packet=512M " . $mysqldump_routines . " --result-file=".$db_backup_dir . '/' . $db_backup_file." $db_name", LOGLEVEL_ERROR); Then do a backup, you should get the whole command instead of the generic failed error message then in the log. Just to be aware, the log will contain the mysql root password then. The command that is run will be still a little bit different then because the parameters get correctly quoted in the real code.
Here's the output Code: mysqldump -h localhost -u root -pDBPASS -c --add-drop-table --create-options --quick --max_allowed_packet=512M --routines --result-file=/var/backup/web3/db_DBNAME_2023-11-01_12-39.sql DBNAME Should I try to run this in cli?
So the password contains ) and it appears it does not like this. Code: bash: syntax error near unexpected token `)' Odd because I didn't have this issue with the old server I'll change the password and will try again. Will report back, thank you for your help @till @Th0m !
This should not be a problem. As I mentioned, the parameters of the executed command are quoted, so the password gets put in single quotes. You can try to mimic it like this: Code: mysqldump -h localhost -u root -p'DBPASS' -c --add-drop-table --create-options --quick --max_allowed_packet=512M --routines --result-file=/var/backup/web3/db_DBNAME_2023-11-01_12-39.sql DBNAME
This is the exact output that I got though, password was not in single quotes. When I ran it as it was outputted, I received an error about the parenthesis
That's what I explained in post #10: "The command that is run will be still a little bit different then because the parameters get correctly quoted in the real code."
Apologies, I missed that line! OK I see the actual error is Code: Couldn't execute 'SHOW FUNCTION STATUS WHERE Db = 'DBNAME'': Cannot load from mysql.proc. The table is probably corrupted (1728) I will try to run Code: mysql_upgrade -u root -p later tonight to try and correct it
You probably restored mysql 'mysql' database of an older version. Try to upgrade it with: Code: mysql_upgrade -u root -p
I had to do Code: mysql_upgrade -u root -p --force since it mentioned "This installation of MariaDB is already upgraded to 10.6.12-MariaDB" but it worked after I forced, thank you guys so much for your help!