Combing multiple instances of MiaB failure .. any suggestions?

I finally got around to combining two instances of MiaB into one as mentioned in this post:

However, this process has become a spectacular fail.

I merged the users.sqlite databases from each machine into one new combined file and then copied the email data directories over from the server being de-comissioned.

Semi-success! I was able to access both the old and new user mailboxes without any issues however the admin page no longer functioned properly. On most pages, I was getting the “Error - Something went wrong, sorry!” message, except the add mail users page. That page seemed to work fine as all the data of the mailboxes was showing. That was until I added a new user at which time I got a “Internal Server Error” message. However, despite that error upon refreshing the new mailbox was indeed added.

So, since the install was an older install (v 18 or 19?) I decided to simply attempt an upgrade to see if that solved the issues. Short answer, No. I suffered through all the various python issues and other issues people have been having in the last 3 versions, but FINALLY got it to install the current version. However, I am getting exactly the same results… a MiaB install that seems to work flawlessly as far as the users are concerned, but completely inaccessible Admin wise.

Anything I may have missed? Or any suggestions to get me back up and running completely? TIA.

Even if the input is to reformat the VPS and start over, I would really appreciate some input into this issue… is there any reason that this would not work? What issues could possibly be making the admin page fail?

My guess would be that your database is corrupted when you merged the two. But it’s very difficult to make any definitive statements.

Thanks Michael … yes, going in to this I knew that the database part was going to be the most difficult for us as I have no database experience and my tech works exclusively with MySQL.

We had discovered documentation on the web concerning merging sqlite databases but even that did not seem to be accurate.

So, maybe the thing to ask at this point - and I know it is off topic for this forum - is for guidance on merging the two databases.

I don’t believe that I have mentioned this but our only concern is mail. We do not use OwnCloud.

At this point, the mail is functioning well for the end users. The combined database that was created seems to work perfectly as far as users and passwords for the mail functions. The only issue is the inability to access the admin page as it shows a constant state of “Loading…”.

Ok … so I was unable to get anywhere with the database issue I decided to reinstall MiaB from scratch. I did so using a tar.gz backup of the user-data directory as I discovered that the MiaB backup was also not functioning.

I reinstalled MiaB and all seemed well until I restored the mail backup from the original VPS. When I did the restore and reran mailinabox from the command line I got the below errors. When I attempted to load the admin page, I was back to square 1.

list index out of range

500 Internal Server Error

Internal Server Error

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

Traceback (most recent call last): File "management/ssl_certificates.py", line 809, in provision_certificates_cmdline() File "management/ssl_certificates.py", line 452, in provision_certificates_cmdline status = provision_certificates(env, agree_to_tos_url=agree_to_tos_url, logger=my_logger, force_domains=force_domains, show_extended_problems=show_extended_problems) File "management/ssl_certificates.py", line 278, in provision_certificates domains, problems = get_certificates_to_provision(env, force_domains=force_domains, show_extended_problems=show_extended_problems) File "management/ssl_certificates.py", line 176, in get_certificates_to_provision for domain in get_web_domains(env): File "/root/mailinabox/management/web_update.py", line 19, in get_web_domains domains |= get_mail_domains(env) File "/root/mailinabox/management/mailconfig.py", line 262, in get_mail_domains + [get_domain(address, as_unicode=False) for address, *_ in get_mail_aliases(env) if filter_aliases(address) ] File "/root/mailinabox/management/mailconfig.py", line 262, in + [get_domain(address, as_unicode=False) for address, *_ in get_mail_aliases(env) if filter_aliases(address) ] File "/root/mailinabox/management/mailconfig.py", line 247, in get_domain ret = emailaddr.split('@', 1)[1] IndexError: list index out of range

Looks like the database contains an invalid email address.

Aha!

In the database dump I have one domain alias as:

INSERT INTO “aliases” VALUES(120,‘example.org’,‘@example.net’,NULL);

with another as:

INSERT INTO “aliases” VALUES(103,‘@example2.org’,‘@example2.info’,NULL);

So, I suspect that the missing ‘@’ in the first one is the issue … now, just to figure out how to get the database dump back into a database once I edit that error. Thank you!