Well the thing is, I didn’t run setup again. I only stopped the daemons, copied a half dozen mail files over (the mail dir) and restarted. It was specifically limited to the mail dir.
Running setup.sh didn’t identify any errors… See below for a suggestion on where it should have.
After pounding on it for a long time, I decided to rebuild it all. I agree about the table, but I looked in the users.sqlite on both machines and they matched - and the table complained about didn’t seem to be there. However, I could get into mail fine, so the users were there. BUT, I might have a bunch of clues for you!!
Was the MFA table added between v27 and v68?
I moved everything out of user-data, copied over ONLY the mail and www dirs (I had some things in www), then re-ran setup.sh. Interesting results that
maybe useful for some fixes
First time, it didn’t see a version file and flashed a message before coloring the screen. What was it? I cancelled it and looked - it didn’t see the version file and was going to install as new.
- What would that do to the data I copied? Would install as new have picked up the mail dirs/files/users?
I copied the version file over and re-ran. I got:
Running migration to Mail-in-a-Box #11…
Running migration to Mail-in-a-Box #12…
Running migration to Mail-in-a-Box #13…
Running migration to Mail-in-a-Box #14…
BTW, what’s with these versions vs 27-69?
It then built as usual, created the DH and self-signed files. BUT, starting nginx failed and the script stopped. Looking at the logs, the nginx local.conf file (didn’t touch the ssl.conf file - future problem perhaps?) still referenced the old certs (and didn’t like it).
I got this error though. Is it critical?
Installing nsd (DNS server)…
Generating DNSSEC signing keys…
Installing Postfix (SMTP server)…
mv: cannot stat ‘/var/lib/postgrey/*’: No such file or directory
Installing Dovecot (IMAP server)…
Installing OpenDKIM/OpenDMARC…
Installing SpamAssassin…
expired old bayes database entries in 10 seconds
159528 entries kept, 272110 deleted
I deleted local.conf and re-ran.
Nginx started and things continued.
This happened:
Installing Roundcube (webmail)…
Updating database schema (2018021600)… [OK]
Updating database schema (2018122300)… [OK]
Updating database schema (2019092900)… [OK]
Updating database schema (2020020100)… [OK]
Updating database schema (2020020101)… [OK]
Updating database schema (2020091000)… [OK]
Updating database schema (2020122900)… [OK]
Updating database schema (2021081000)… [OK]
Updating database schema (2021100300)… [OK]
Updating database schema (2022081200)… [OK]
Could it be the case that a table (MFA) was added somewhere along the line and it’s used for admin but not for roundcube? I could still get into mail, just not admin…
If so, does that sound like an explanation? Copying the mail folder also copied the older sqlite file, and thus it missed that table.
Admin then allowed login with an IP address. I then hit the Provision button in admin/TLS and it all happened according to plan. It’s now up and at the point I left it before. Yeah!
Now, that modifies the ideas and assumptions we’ve postulated above for moving to a new machine. For instance:
-
Some /etc/nginx files need to be removed if MiaB has ever been on the box.
-
The mail dir can’t be rsync’d over entirely if the user db structure has changed (maybe make those changes very clear in any changelog). The question is, in future, if just the mail files are sync’d, will there be a problem? ie, does the sqlite file track mail files?
-
Since owncloud couldn’t come over, I didn’t copy it at any time. Last install created a user for me in the new owncloud. The re-install also started with no owncloud folders but didn’t create me as a user this time. Neither was ever used…
-
Are there other configs or files that should be rebuilt but aren’t in this migration case, like nginx/conf.d/local.conf? I didn’t dig deep into /usr/local/lib/mailinabox or /etc or any other place.
-
Is it possible for setup.sh to look at the db and update the format if it isn’t the right one for the version? It isn’t triggered now if not identified by overall version level it seems. Perhaps check the db and update the schema as needed each tie setup is run.
-
In future, if the mail dir gets refreshed from the old box (as in another day goes by here), how can I trigger the db to be updated but not touch the ssl certs?
Question: setup.sh didn’t want to touch the cert lines in local.conf. If using the proposed method to get new certs - delete the ssl dir and run setup.sh - local.conf has to be deleted it seems. Once the certs are gone but still referenced in local.conf, admin page access may be broken and thus can’t reach the Provision button for new ones, unless setup can be written to remove the entries if they don’t actually exist.
Would
‘delete local.conf’=>‘run setup.sh’=>‘Provision button in Admin’
be a complete process then?
Does the theory about the missing table fit? Is it complete?
Is anything else affected in the ‘get-all-new-certs-by-deleting’ process?
Are there any other files affected in a migration between machines that should be removed first?
Thanks. This should be becoming a pretty good reference for these things…