Rename addon/alias domain
I need to rename multiple addon/alias domains so I'm writing a script to do that.
Idea is to delete them and recreate them with new names. If there is a better way to do that, please let me know.
First I would need to know what actually gets deleted when removing addon/alias so I can backup this data beforehand.
For aliases documentation states:
- alias
- vhost entries
- DNS entries
are removed: Aliases | cPanel & WHM Documentation
I see these things also get deleted:
/etc/valiases/$DOMAIN
/etc/vfilters/$DOMAIN
/var/cpanel/userdata/${USER}/${DOMAIN}
/var/cpanel/userdata/${USER}/${DOMAIN}_SSL
Is there anything else that gets deleted when removing addon/alias domain?
-
Why not use the API to add/remove them rather than modify the files directly which may or may not be recognized by cPanel fully? Create a parked/alias domain: Remove a parked/alias domain: 0 -
That is my plan. But I also need to copy and modify things that do get deleted if I don't want to loose this information: /var/named/${DOMAIN}.db /etc/valiases/${DOMAIN} /etc/vfilters/${DOMAIN} /var/cpanel/userdata/${USER}/${DOMAIN} /var/cpanel/userdata/${USER}/${DOMAIN}_SSL Does anything else get deleted when removing addon/parked domain? 0
Please sign in to leave a comment.
Comments
2 comments