1

Topic: how to change mysql database to remote server

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

Hi,

I would like to migrate the MySql/MariaDB on my iRedMail server to a remote server.  I only want to move the database, so that all mail data is on the remote, keeping all other iRedMail services running on the current one. 

I understand how to export and import the databases using mysqldump, and transfer them to the other server.

What settings/configs do I need to change to tell iRedMail to connect to the new remote server for all database queries?

This guide discusses the installation process on a remote server, but not how to change an existing instance's database location:
https://docs.iredmail.org/install.iredm … erver.html

Thank you!

----

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

2

Re: how to change mysql database to remote server

Have a look here:
https://docs.iredmail.org/install.iredm … erver.html

3 (edited by blacksteel1288 2020-06-25 00:58:27)

Re: how to change mysql database to remote server

That doesn't work.  The link is the same one in my original post which describes how to install to a remote database.

I don't want to reinstall a new system.  I'm trying to find what settings to change to connect to a remote DB.

4

Re: how to change mysql database to remote server

@ZhangHuangbin any tips on how to find all the database connection configurations to point them to another server?

5

Re: how to change mysql database to remote server

Create required databases on remote DB server, grant required privileges, then update config files on iRedMail server to use remote SQL server. that's it. smile

6

Re: how to change mysql database to remote server

Closing this topic out -- I was able to complete the migration successfully.  There were a few gotchas in finding all of the config files for all services, as it was easy to miss some of them. 

Also, the database user privileges had to be done manually by doing a 'show privileges' on the source DB, to set the correct ones on the target.