Topic: iRedMail Migration Ubuntu 18.04 -> 22.04
==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release):
1.6.3 on both servers
- Deployed with iRedMail Easy or the downloadable installer?
Downloadable Installer
- Linux/BSD distribution name and version:
Migration from Ubuntu 18.04 to 22.04 - (new server - not upgraded)
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
PGSQL
- 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 There,
As an iRedMail user for many years and completing this task historically between Ubuntu versions I am looking for some specific guidance on migrating the databases from my old IRedMail server running Ubuntu 18.04, (PostgresSQL 10), to a new fresh install of IRedmail on a new server running Ubuntu 22.04, (PostgresSQL 14).
Is it really just a case of taking the backed up database files:
-rw-rw-r-- 1 postgres postgres 406459 Jul 5 09:28 amavisd-2023-07-05-03-01-01.sql
-rw-rw-r-- 1 postgres postgres 379402 Jul 5 09:28 iredadmin-2023-07-05-03-01-01.sql
-rw-rw-r-- 1 postgres postgres 325962 Jul 5 09:28 iredapd-2023-07-05-03-01-01.sql
-rw-rw-r-- 1 postgres postgres 378437 Jul 5 09:28 roundcubemail-2023-07-05-03-01-01.sql
-rw-rw-r-- 1 postgres postgres 25925695 Jul 5 09:28 sogo-2023-07-05-03-01-01.sql
-rw-rw-r-- 1 postgres postgres 69803 Jul 5 09:28 vmail-2023-07-05-03-01-01.sql
And running the following:
su postgres
psql -U postgres vmail < vmail-2023-07-05-03-01-01.sql
repeating for each database?
When I do this I get lots of verbose output including errors like this:
ERROR: relation "idx_recipient_bcc_domain_active" already exists
ERROR: relation "idx_recipient_bcc_domain_bcc_address" already exists
ERROR: relation "idx_recipient_bcc_domain_expired" already exists
ERROR: relation "idx_recipient_bcc_user_active" already exists
ERROR: relation "idx_recipient_bcc_user_bcc_address" already exists
ERROR: relation "idx_recipient_bcc_user_expired" already exists
ERROR: relation "idx_sender_bcc_domain_active" already exists
ERROR: relation "idx_sender_bcc_domain_bcc_address" already exists
ERROR: relation "idx_sender_bcc_domain_expired" already exists
ERROR: relation "idx_sender_bcc_user_active" already exists
ERROR: relation "idx_sender_bcc_user_bcc_address" already exists
ERROR: relation "idx_sender_bcc_user_domain" already exists
ERROR: relation "idx_sender_bcc_user_expired" already exists
ERROR: relation "idx_sender_relayhost_account" already exists
ERROR: relation "idx_share_folder_from_user" already exists
ERROR: relation "idx_share_folder_to_user" already exists
ERROR: relation "idx_used_quota_domain" already exists
ERROR: trigger "mergequota" for relation "used_quota" already exists
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
GRANT
etc..
Is there a bulletproof guide on the best way to export/import PGSQL databases - I've done this in the past.... but it was a while ago now and don't seem to be able to find the detail I used in the past to ensure the databases are migrated correctly.
Thanks In advance.
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.