V-import-cpanel v2

Hi all

First sorry for my bad english

Im working in new versión of cpanel script ( and need some beta testers before push to oficial repo )

I make this script some years a go, and see a lot people working on it with new functions,
I am very impressed and glad that the script has helped people migrate their sites to a free panel

So this days I test script again, found some bugs and working in some new things

Latest changes until 1/22/2024

  • Add progress when restoring mails
  • Add progress when unzip archive, good to know if script do something
  • Fix EA-PHP paths in cron job / replace by hestiacp paths or default if not exists
  • Fix Bug when restore addon domains
  • Fix Bug when restore databases
  • Added option to change cpanel user ( beta script also try fix PHP configuration files, database prefix, script search for most common configuration files settings.php. wp-config.php and fix DB_PREFIX_)
  • Added options to restore if user alredy exist ( beta we try not overwrite existing data need more test )
  • Added Option to restore only databases, Only emails or Only domains
  • Now we can restore parked domains and parked domain mails.
  • Improve output, change all ECHOs for printf
  • Change VARS to UPERCASE ( 95% completed )
  • Added option to restore SSL ( need more tests )
  • Fix Bug, continue restoring either if php version not exists, just asign default.
  • Added now quota for mail account asigned as in cpanel account
  • By default disabled option to search and unzip compressed mails , in script change FIND_GZIPED_MAILS=no to yes to activate search for compressed mails, this function is too slowin big emails accounts
  • Added option to detect disk space, we not want unzip 30 GB to get insufficient storage, Check 2.5x space more than backup size to restore, maybe to much, you can change it

TODO:

  • Check if mails are in maildir format or mdbox
  • Restore DKIM really need restore it ? if local mail we can generate new one.
  • Need check MX restore optión again.

Feel free to test and report / improve any option

I need some help to make batter the case function, this week if have time I will change something more and make new documentation

You can download from here:

3 Likes

Ok, I’d used the V2 version and find some things:
First and the first many many thanks to help us to move to a more freedom world with the improves of your script.

  • When import an account with aliases (Parked domains), the script not creates the dns entries for this aliases.
  • The disk space used that shows on Hestia panel by the account is not updated on the import (you must wait for the afternoon Hestia scripts).
  • When import emails First Line of the messages of script is an Error
  • The CPanel Certificate contains aliases to CPanel entries on DNS, it’s best to remove and re-issue the certificate under Let’s Encrypt.
  • If the script not updates DKIM, best would be delete the old entry on DNS.
  • Could be a good idea that imports analog statistics if old are present.
  • some frontend software installations require an update of the BASE path of the account on the config files, because its not the same on Hestia that on CPanel.

Hi

Thanks for test and you comments

My big problem is than I not have access to different cpanel backups with webs run in production

I will test that.

I know the SSL issue, id easiest just issue new SSL, or skip restore if is let’s encrypt, but in some cases is better restore and then if user want can reissue the SSL

I will check mail error, maybe some backups not have mailbox format defined, easy to fix.

Analog or awstats can be restored but as I say I not get any backup with that enabled :confused:

I not care about space count, I will add some line at the end to rebuild all user account statistics :+1:

Few CMS define base path, but we can try fix, other panels, like plesk in this case make symbolic links from /home to /var/www but in this case all is in home, I will think how solve that.

About DNS, script don’t import DNS :thinking:

Thanks for report, this week I try to solve some bugs.

1 Like

Hi, thankyou for your interest. I find another serious problem with emails: passwords and permissions:

  • The passwords imported from email accounts don’t work on Hestia, but the password for Hestia User panel works without changes.

  • The User Folders can’t be recreated on the Dovecot mailbox account, most probably must be a permissions issue.

  • The new mails received (post-import) are queued by Exim and not delivered to the mailbox. I actually don’t know if it’s a permissions issue or indexes (imported account does not have dovecot indexes) or anything else. Ok I’ve investigated and the accounts need to refresh the password via the Web admin then it works and make unfreeze the queue. If you change the password via the CLI (v-change-mail-account-password) it’s not sufficient because Roundcube show then Imap connect error when login, altought you can use the CLI command after change once a password via Web admin if you need to change the password again and it works. :upside_down_face: The index on mailboxes can be recreated using the dovecot’s command for repair: dovecot force-resync -u mail_account INBOX

  • On imported Cron jobs could be replaced the base url of CPanel on public_html to reflect Hestia base url. (suggest: find for a string that contains CPanel common base url and change for Hestia common base url).

Hi,

In my last tests password mail passwords works,

Can you provide cpanel version ?

Can you provide also a cpanel backup for testing, just a testing account from that cpanel version?

I will check mail permissions management today.

Thanks for report

I test email problem and cant reproduce this

Need a cpanel version
can you provide ls output of mail folders ?

In may case after restore can login to webmail and send emails

Dovecot.* files inside cpanel backup are deleted by script, so this not be an issue, this file was created from 0 in hestia in first login

After restore backup can you check this file:

/usr/local/hestia/data/users/USER/mail/DOMAIN.conf

There you can find “MD5='{SHA512-CRYPT}$6$C4y” check if MD5= isnt empty or start with another hash

After restore the backup the MD5 on conf is {SHA512-CRYPT} and new messages are queued, BUT after recreated the password with Hestia is MD5='{BLF-CRYPT}, and it works normally, so I think if must be a conversion of the hash for crypt algorithm.
Another important thing is that the mail user folders (inside inbox) wasn’t recreated. the log indicates permissions error.

I attach a link to a fresh test CPanel backup with one mailbox and one message into. The CPanel version is [110.0.20]
backup-1.29.2024_15-37-19_amiledadada.tar.gz

I will download it later, can you provide the password of account for test ? Send me pm

Hestia support both md5 and sha512

Thanks for sharing

HI, thanks for send a backup, user and password

Try restore it in hestia with debian 11, debian 12, and ubuntu 20.04, cant reproduce the issue with mails passwords

Still investigate what happen there.

Hi again, I notice that every mail accounts with a pre-defined disk quota are set to 0 on Hestia, and because of this It can’t login, It tested with Outlook for Windows client, set to unlimited enable the login. I suggest that add it to the script. I still don’t find that issue for IOS IMAP to avoid account re-creation step.

Hi

But this happen also for new created accounts or only in accounts imported with script ?

By default last version of script take quota from cpanel backup, so if is unlimited set it to 0

Thanks for feed back

Hi. No, the account has a numeric quota before on CPanel and the script set this to 0 when imports to Hestia.
…And Hestia takes 0 as “0” -not as unlimited, so the mail client auth fails until I manually set it to “unlimited”.

Oh ok, my bad, may I set 0 as unlimited and not -1 :confused: tomorrow I fix that.