• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved Renaming domain root directories

Sefu

New Pleskian
Hello,

I've recently 'inherited' the job of managing a server that is using the Plesk (latest Onyx) interface.

Unfortunately, their 'webspaces' are a mess: containing several domains each, some of these point to 'httpdocs' folders, others to 'htdocs' folders (and other 'default' names probably inherited from other installations), and some have subdomains that point to sub-directories within these, and some have web applications installed (that impedes changing a (sub-)domain's root directory through the Plesk control panel).

I would like to rename each domain's root directory to its proper domain name ('httpdocs' => '(example.)domain.com) as per Plesk's vhosts method), but as I am unfamiliar with Plesk's inner workings, I am wondering if this would 'break' Plesk's management of these domains (for example: if I re-name the domain's root directory and 're-point' the domain to it through the panel).

I would also like to know if it is possible to remove a domain through the Plesk panel without removing its root directory and/or data.

According to you most likely more experienced Plesk users, what would be the 'safest' way to go about this? Thanks for any insight.
 
Last edited:
Sounds like your server has had an interesting history.

I recommend setting up a test customer / subscription with test domains and subdomains, recreating some of the more messed up conditions, in order to test your procedures. You might hit some border cases, have backups, that goes without saying...

That being said, I don't really expect renaming root directories of domains or subdomains in Plesk to cause issues in Plesk itself. You could stumble on a badly designed web application or a web page with hard coded paths in its own configuration files or databases, though, but that's another matter...

As for your question regarding the domain removal, I'm not aware of any way that a domain can be removed in Plesk without removing the associated data.

You could rename a domain to a bogus one (e.g. from example.com to example-bogus.com) and leave it there, then the original example.com domain could be recreated for a fresh start with an empty default data structure. Or, if we are talking about an add-on domain and not the main one (!), you could point its root to an empty directory and then delete it, leaving the original root with its contents intact.

BTW, beware of any domains or subdomains with nested root directories. Removing the top one could delete all the contents of the nested ones. Similarly, beware of any domains or subdomains with the same root as another domain or subdomain, as removing one will also remove all the contents shared between them.

Good luck...
 
I would like to rename ... I am wondering if this would 'break' Plesk's management of these domains (for example: if I re-name the domain's roodt directory and 're-point' the domain to it through the panel).
It will not break things unless the owner or group of the directory is changed. You can move (rename) a directory and change the document root path of the webhosting in Plesk to the new path afterwards. After that change the webserver needs to reload or restart, so that the new configuration comes into effect. This can take a while according to what is defined as the webserver restart interval.

I would also like to know if it is possible to remove a domain through the Plesk panel without removing its root directory and/or data.
No, when you remove the domain, its content can automatically be removed by Plesk. If you want to keep the content, copy it to a directory that is not managed as a webserver document root directory before removing the domain.
 
Thank you for your replies - Ales, it's the last bit I was most wary of.

As the server is getting close to antiquated (it's been in production since around five years now), I think it's a good opportunity to switch to a new machine (also running Plesk) and do a site import to a new, cleaner directory root schema.
 
Inheriting an unknown server with a turbulent history can be a pain. Consolidating the customer configuration and performing a migration to a fresh Plesk server sounds like a good idea.
 
Back
Top