1

Topic: Migrated Server, same version, Problems restoring from backup

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release):
- Deployed with iRedMail Easy or the downloadable installer?
- Linux/BSD distribution name and version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Web server (Apache or Nginx):
- Manage mail accounts with iRedAdmin-Pro?
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Running the newest version.

Tried migrating the sql from one server to the to the other using this command....

sudo mysqldump --all-databases | ssh *.*.*.* mysql -u root -p'**'

Boy o boy did that F it all up. Now im getting errors up the wazoo.

amavis[2075]: (02075-01) NOTICE: reconnecting in response to: err=2013, HY000, DBD::mysql::st execute failed: Lost connection to MySQL server during query at (eval 108) line 173.

Tried backing up the method mentioned in the support forum here from an sql file.

"Let's take SQL database iredapd for example. Assume the backup file is /var/vmail/backup/mysql/2021/11/19/iredapd-2021-11-19-23-02-01.sql.bz2.

The backup file was compressed with bzip2 (with .bz2 extension in file name), please decompress it with command bunzip2 first:

bunzip2 /var/vmail/backup/mysql/2021/11/19/iredapd-2021-11-19-23-02-01.sql.bz2

You should get decompressed file /var/vmail/backup/mysql/2021/11/19/iredapd-2021-11-19-23-02-01.sql

Login to MySQL / MariaDB server as the SQL root user.

Restore the decompressed SQL file:
USE iredapd;
SOURCE /var/vmail/backup/mysql/2021/11/19/iredapd-2021-11-19-23-02-01.sql;"

Got this

No connection. Trying to reconnect...
ERROR 2002 (HY000) at line 619 in file: '/var/vmail/backup/mysql/2023/01/21/mysql-2023-01-21-03-30-01.sql': Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)
ERROR at line 619 in file: '/var/vmail/backup/mysql/2023/01/21/mysql-2023-01-21-03-30-01.sql': Can't connect to the server


How f'ed am I? btw. restoring from a backup is NOT easy!

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2 (edited by Cthulhu 2023-01-24 00:40:36)

Re: Migrated Server, same version, Problems restoring from backup

CREATE USER 'sqladmin'@'%' IDENTIFIED BY 'password';

GRANT ALL PRIVILEGES ON * . * TO 'sqladmin'@'%';

FLUSH PRIVILEGES;

open port 3306 in firewall

/etc/mysql/mariadb.conf.d/50-server.cnf

bind-address            = 0.0.0.0

service mysql restart


https://www.heidisql.com/

Create a new connection, login


from there, you can import the dumpfiles via a windows gui

if all is done, and working, revert changes (bind address, firewall, delete created user/privilegues) and restart mysql/mariadb

OR

keep it and have a way to maintain your databases from a gui

3

Re: Migrated Server, same version, Problems restoring from backup

Hi

Any luck restoring db?

Thanks

4

Re: Migrated Server, same version, Problems restoring from backup

As mentioned in doc: Do not restore the database named "mysql".
https://docs.iredmail.org/backup.restor … -databases