Author Topic: rebuild vhosts  (Read 107 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
rebuild vhosts
« on: October 23, 2025, 07:05:56 AM »
Hello,

Do you know if there is any way to rebuld all apache vhosts from cli ?

Thanks

Offline
*****
Re: rebuild vhosts
« Reply #1 on: October 23, 2025, 01:24:29 PM »

Offline
*****
Re: rebuild vhosts
« Reply #2 on: October 23, 2025, 05:14:07 PM »
Why do you need to rebuild the vhosts?

Only time you usually do this is if you create a template and assign it to some of the sites.

Offline
*
Re: rebuild vhosts
« Reply #3 on: Today at 08:22:36 AM »
I´m creating a bash script to automate my new servers installations.
Thanks, I assume that's only possible in cwp panel.

One more thing, see if you can help me.

As in AL9 cwp migration tool not working.

What steps do you follow to migrate?
Do you create accounts manually in the new server and copy everything files, db and mails manually?.

Offline
*****
Re: rebuild vhosts
« Reply #4 on: Today at 12:10:16 PM »
CWP's EL9 support is in beta, so one of the known bugs is that CWP Migration does not work on EL9 distributions. (You would need to use an EL8 distribution for full support.)
You should be able to manually migrate, no problem. I just had to manually migrate my last CentOS 7 server to AlmaLinux 8 because I was continually encountering a bug with CWP Migration (even though it's worked just fine for me for other servers). You dump all DB to a single SQL file, on the new server create the user accounts you are replicating, load the DB SQL on the new server and rsync in all your files -- /home and /var/vmail. (Also move any conf you want to carry over -- CSF firewall, Roundcube, nginx vhosts, DNS zone files, etc.).

https://wiki.centos-webpanel.com/how-to-manually-import-emails

But the postfix DB, particularly the mailbox table has all the end user PW hashes stored. So recreating that DB on the new server will get you all the user PW you need. No need to recreate any mail user accounts or aliases. Also bring over the roundcube DB for a seamless mail experience. Just make sure their /var/vmail IMAP storage is in place and all the references will point appropriately. Voila!