A year ago I upgraded ubuntu from 22 to 24 by mistake.
Since then, HestiaCP still works but doesn’t update anymore. Always the same well known error messages:
W: Unable to read /etc/apt/-/ - DirectoryExists (2: No such file or directory)
W: Unable to read /etc/apt/sources.list.d/hestia.list - RealFileExists (2: No such file or directory)
Now, if I reinstall my entire server, I have backups of the HestiaCP user folders, but what about all HestiaCP system configs? Meaning all the domains, emails, SPF, DKIM, DMARC, etc…
Do I have to reconfigure everything again?
After a clean install of HestiaCP on an empty server, will restoring the backup work right away without anything more? Any way to set 100% of its config back to the state it was before reformatting?
All users present, all mailboxes, all DBs, etc…?
Thanks for any help.
Yes, moving from 22.04 to 24.04 got everything screwed.
I have another 24.04 server on which I natively installed HestiaCP and everything’s fine, including auto-updates.
After that, run apt update. If you don’t see any errors, you can run apt full-upgrade. Before upgrading, however, I recommend creating a snapshot of the server (if snapshots are available for your server).
Thanks for your instructions. It looks like the apt sources are recreated.
But then, the apt update seems to work, but the full-upgrade screws everything up.
First, the hestiacp upgrade, the first one shows an error: [ - ] Now applying patches and updates for version v1.9.0... PHP Fatal error: Uncaught Error: Class "Symfony\Component\HtmlSanitizer\HtmlSanitizerConfig" not found in /usr/local/hestia/func/internal/sanitize_html.php:9 Stack trace: #0 {main}
For the full-upgrade, I ran it twice (after restoring the snapshot in between). First I said Y to all replacements, and the second time N to all replacements to keep the config files.
In both cases.
With Y, most of my websites don’t work at all. All certificates are lost.
With N, nothing works at all. No websites. several nginx restart errors during the full-upgrade.
So I’m back to my snapshot.
I did get an email after the full-upgrade telling me that hestia updated to 1.9.8
I’ve migrated systems frequently, and Hestia backup includes a full mail migration, including emails and mailboxes. You can also transfer templates (if any) and firewall settings. Restoring them on the new server is also easy.
Ok but what about all the firewall, certificate template configs, domains, etc.. Does everything follow?
Copying all templates is one thing, but re-attributing them to the correct domains, etc…
I’ll try later the above instructions. My wife currently works on emails, so I can’t shut down the server
Transfer the backup and run it on the new server — your email will be exactly as it was, and the certificates will also be transferred completely. After that, without shutting down the old server, transfer anything that might be missing, such as templates in /usr/local/hestia/data/templates/web/ if you created them, as well as the firewall configuration at /etc/iptables.rules, database settings at /etc/mysql/mariadb.cnf, and so on.