Aug
2008
Renaming a domain in Plesk running on Linux
A tip for those who work with Plesk on a Linux platform:
Ever add a domain to Plesk and accidentally mis-spelled it? Or just want to change the domain altogether to something different (such as .com to a .net)? There are two ways to do this – within Plesk (the easy way) and within the command line (for advanced users).
In Plesk – Login as the client or admin (doesn”t matter) and go to your domain. Under the Domains section, click the button that says Domain Administrator. You will see a text box where you can manipulate the domain.
In the command line – Log into your server via SSH as root and change your present working directory to /usr/local/psa/admin/sbin. You should see a file in there named domainmng. If so, run the following to output the help section:
[root@yourserver sbin]# ./domainmng --help
Usage: domainmng [OPTIONS]...
(--turn-on | --turn-off) --domain-name=(domain_name) turn on/off domain
--rename-domain --old-domain-name=(old_domain_name) --new-domain-name=(new_domain_name) rename (old_domain_name) to (new_domain_name)
-h, --help display this help and exit
The –rename-domain flag is what we are looking for. So, to execute, run the following:
[root@yourserver sbin]# ./domainmng –rename-domain –old-domain-name=(your old domain here) –new-domain-name=(your new domain here)
The above is equivalent to the change you make in Plesk. Please note that these changes will not update your site’’s code, so if you have any hardcoded links, you”ll need to update them so that the new domain is being used.