1

Topic: Install 1.3.1 and get old data from 0.9.9

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

Iredmail 0.9.9 is working fine in my Ubuntu 18.04 server with 60 active users. Now, instead of upgrading iredmail from one version to another, what i need to do is install ubuntu 20.04 and install Iredmail 1.3.1.

My Question is:
    a. Can i just copy the old vmail1 and paste it to Iredmail 1.3.1
    b. How about the mysql database? can i import and export?
   
Can somebody provide me steps or procedure on how can i execute this scenario.

Thanks.
JunG

----

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

2

Re: Install 1.3.1 and get old data from 0.9.9

FYI: https://docs.iredmail.org/migrate.to.ne … erver.html

3

Re: Install 1.3.1 and get old data from 0.9.9

Hi Zhang,

I just need some clarifications about migration. since my running iredmail is 0.9.9 and i want to install iredmail 1.3.1 into a new server using ubuntu 20.0 and migrate needed data from old iredmail 0.9.9

a. As per the instruction, "apply SQL structure related changes to make sure old server has same SQL structure"  then Export and import vmail database.
     a.1 What are the related structure changes?
           
b. How about the databases of the ff: Do i need to do something to the old iredmail 0.9.9 before exporting to new iredmail 1.3.1?
      b.1 iredapd
      b.2 amavisd
      b.3 iredadmin
      b.4 roundcubemail
     
Sorry for the noob question. I just don't want to messed up with the active iredmail server by doing the migration without clear knowledge of the steps.

note: Reason for the migration is running out of hard disk space.

Thanks,
JunG

4

Re: Install 1.3.1 and get old data from 0.9.9

Hi Zhang,

What if i will re-create all email address. then, just copy the /var/vmail/vmail1/mydomain does it will work?

Thanks,
JunG

5

Re: Install 1.3.1 and get old data from 0.9.9

jung wrote:

What if i will re-create all email address. then, just copy the /var/vmail/vmail1/mydomain does it will work?

Yes it will work -- if you coped the user mailbox to the correct maildir path after recreated the user account.

I suggest you do some practice to make sure everything works after migration.

6

Re: Install 1.3.1 and get old data from 0.9.9

hi,
I want to sure that all users can login with old password after restore mysql backup from last mail server (on new installation ired ).

ZhangHuangbin wrote:
jung wrote:

What if i will re-create all email address. then, just copy the /var/vmail/vmail1/mydomain does it will work?

Yes it will work -- if you coped the user mailbox to the correct maildir path after recreated the user account.

I suggest you do some practice to make sure everything works after migration.

7

Re: Install 1.3.1 and get old data from 0.9.9

ired_mania wrote:

hi,
I want to sure that all users can login with old password after restore mysql backup from last mail server (on new installation ired ).

If you look at some other posts in the forum, Ubuntu 20.04 may have problems as it is not yet tested. Probably you should consider moving to Ubuntu 18.* first?

Also, instead of moving from 0.9.9 straight to 1.3.1, maybe you can either a) install 0.9.9 on the new server + upgrade through all the versions one by one or b) upgrade 0.9.9 on the old server to 1.3.1 (one by one each version) and then move to the new server.

I don't know if the database password hashing function has changed between 0.9.9 and 1.3.1, but IF it has NOT changed, it should be possible to create the users in the new installation with a random password, then copy just the password hashes from the old database into the new one in the appropriate column.

8

Re: Install 1.3.1 and get old data from 0.9.9

ZhangHuangbin wrote:
jung wrote:

What if i will re-create all email address. then, just copy the /var/vmail/vmail1/mydomain does it will work?

Yes it will work -- if you coped the user mailbox to the correct maildir path after recreated the user account.

I suggest you do some practice to make sure everything works after migration.


Hi Zhang,

Thanks for the assurance.

Yes, i will install ubuntu 20.04 VM on my Desktop, then re-create all email addresses and copy /var/vmail/vmail1/our.domain.com from old server into the new server.

I'll let you know once done and working.

Thanks,
JunG

9

Re: Install 1.3.1 and get old data from 0.9.9

ee wrote:
ired_mania wrote:

hi,
I want to sure that all users can login with old password after restore mysql backup from last mail server (on new installation ired ).

If you look at some other posts in the forum, Ubuntu 20.04 may have problems as it is not yet tested. Probably you should consider moving to Ubuntu 18.* first?

Also, instead of moving from 0.9.9 straight to 1.3.1, maybe you can either a) install 0.9.9 on the new server + upgrade through all the versions one by one or b) upgrade 0.9.9 on the old server to 1.3.1 (one by one each version) and then move to the new server.

I don't know if the database password hashing function has changed between 0.9.9 and 1.3.1, but IF it has NOT changed, it should be possible to create the users in the new installation with a random password, then copy just the password hashes from the old database into the new one in the appropriate column.


Hi ee,

Thanks for the information. I will prefer to install new iredmail version on a new server then re-create users email and copy the /var/vmail/vmail1/our.domain.com into new server.

With the above scenario, i can save much time and effort and avoid errors after every upgrade from one version to another.

Thanks.
JunG

10

Re: Install 1.3.1 and get old data from 0.9.9

Here's what I did.

I have a backup on another machine of all the emails.
On the new server, I created each of the email addresses/passwords for the domains and users.  I then log in with Roundcube/SOGo - this creates the directory.

The directories will be different than the original machine because the directory just above Maildir has (basically) a timestamp in the directory name.

Then, copy all the emails in the backup from Maildir directory (essentially the end of the chain) into the Maildir directory of the new user.

Example ...../andrew-2020.07.16.15.33.23/Maildir is the new email and  .../andrew-2019.10.10.15.26.12/Maildir is the backup
copy all of .../andrew-2019.10.10.15.25.12/Maildir into Maildir below .../andrew-2020.07.16.15.33.23
then, delete all the dovecot.index* files at Maildir and below on the new machine

run


chown -R vmail:vmail /var/vmail/vmail1
chmod -R 0700 /var/vmail/vmail1

to get the ownership of the copied files correct and restart the various (dovecot) services.  The indexes will be recreated.

Andrew




jung wrote:
ee wrote:
ired_mania wrote:

hi,
I want to sure that all users can login with old password after restore mysql backup from last mail server (on new installation ired ).

If you look at some other posts in the forum, Ubuntu 20.04 may have problems as it is not yet tested. Probably you should consider moving to Ubuntu 18.* first?

Also, instead of moving from 0.9.9 straight to 1.3.1, maybe you can either a) install 0.9.9 on the new server + upgrade through all the versions one by one or b) upgrade 0.9.9 on the old server to 1.3.1 (one by one each version) and then move to the new server.

I don't know if the database password hashing function has changed between 0.9.9 and 1.3.1, but IF it has NOT changed, it should be possible to create the users in the new installation with a random password, then copy just the password hashes from the old database into the new one in the appropriate column.


Hi ee,

Thanks for the information. I will prefer to install new iredmail version on a new server then re-create users email and copy the /var/vmail/vmail1/our.domain.com into new server.

With the above scenario, i can save much time and effort and avoid errors after every upgrade from one version to another.

Thanks.
JunG

11

Re: Install 1.3.1 and get old data from 0.9.9

AndyInNYC wrote:

Here's what I did.

I have a backup on another machine of all the emails.
On the new server, I created each of the email addresses/passwords for the domains and users.  I then log in with Roundcube/SOGo - this creates the directory.

The directories will be different than the original machine because the directory just above Maildir has (basically) a timestamp in the directory name.

Then, copy all the emails in the backup from Maildir directory (essentially the end of the chain) into the Maildir directory of the new user.

Example ...../andrew-2020.07.16.15.33.23/Maildir is the new email and  .../andrew-2019.10.10.15.26.12/Maildir is the backup
copy all of .../andrew-2019.10.10.15.25.12/Maildir into Maildir below .../andrew-2020.07.16.15.33.23
then, delete all the dovecot.index* files at Maildir and below on the new machine

run


chown -R vmail:vmail /var/vmail/vmail1
chmod -R 0700 /var/vmail/vmail1

to get the ownership of the copied files correct and restart the various (dovecot) services.  The indexes will be recreated.

Andrew




jung wrote:
ee wrote:

If you look at some other posts in the forum, Ubuntu 20.04 may have problems as it is not yet tested. Probably you should consider moving to Ubuntu 18.* first?

Also, instead of moving from 0.9.9 straight to 1.3.1, maybe you can either a) install 0.9.9 on the new server + upgrade through all the versions one by one or b) upgrade 0.9.9 on the old server to 1.3.1 (one by one each version) and then move to the new server.

I don't know if the database password hashing function has changed between 0.9.9 and 1.3.1, but IF it has NOT changed, it should be possible to create the users in the new installation with a random password, then copy just the password hashes from the old database into the new one in the appropriate column.


Hi ee,

Thanks for the information. I will prefer to install new iredmail version on a new server then re-create users email and copy the /var/vmail/vmail1/our.domain.com into new server.

With the above scenario, i can save much time and effort and avoid errors after every upgrade from one version to another.

Thanks.
JunG


Hi AndyInNYC,

Thanks for the information.
In the old iredmail 0.9.9 i added the "MAILDIR_HASHED = False" and "MAILDIR_APPEND_TIMESTAMP = False" at the end of /opt/www/iredadmin/settings.py to make the email name as one name and i did the same setup in the new iredmail 1.3.1:

Here's what i did to the new iredmail 1.3.1 server:

a. I -recreated email
b. Login to that email.
c. Copied the profile from old iredmail /var/vmail/vmail1/our.domain.com to the same folder in the new iredmail 1.3.1

After login to email. I'm having this error "Server Error: STATUS: Internal error occurred. Refer to server log for more information. [2020-07-19 09:37:03] (0.007+0.000+1.006 secs)

Any help is highly appreciated.

Thanks.
JunG

12

Re: Install 1.3.1 and get old data from 0.9.9

Dear All,

Thanks for helping me troubleshoot my iredmail issue with regards to migrating iredmail 0.9.9 into iredmail 1.3.1 without doing upgrade from 1 version to another until i reached version 1.3.1.

Below is what i did:

a. Install ubuntu 18.04
b. Install Iredmail 1.3.1
c. re-create all email addresses
d. copy the /var/vmail/vmail1/our.domain.com into iredmail 1.3.1 server
e. change the ownership of each folder in /var/vmail/vmail1/our.domain.com/email.profile
     #chown -R /var/vmail/vmail1/our.domain.com/email.profile

That's it...Working perfectly.

Thanks Zhang and Thanks everyone.

JunG

13

Re: Install 1.3.1 and get old data from 0.9.9

jung wrote:

c. re-create all email addresses
d. copy the /var/vmail/vmail1/our.domain.com into iredmail 1.3.1 server

Are you sure all mailboxes are accessible after copied?
If you re-create all mail user accounts, the maildir path is different than the one on old server, so you can not simply copy the whole /var/vmail/vmail1/ to new server.

14

Re: Install 1.3.1 and get old data from 0.9.9

ZhangHuangbin wrote:
jung wrote:

c. re-create all email addresses
d. copy the /var/vmail/vmail1/our.domain.com into iredmail 1.3.1 server

Are you sure all mailboxes are accessible after copied?
If you re-create all mail user accounts, the maildir path is different than the one on old server, so you can not simply copy the whole /var/vmail/vmail1/ to new server.

Hi Zhang,

I re-created user email exactly the same as the old one. Because i have a list of all created emails which include the following: email address, display name, userid and mailbox quota and that is my reference during email re-creation in the new Ubuntu 20.04 with iredmail 1.3.1 server

Thanks,
JunG