How to: Change a SiteWorx Account’s Primary Domain

InterWorx provides a command line tool for changing the primary domain of a SiteWorx account. This is done by “promoting” a secondary or pointer domain on the account to the primary domain. Only a secondary or pointer domain that already exists on the account may be eligible for promotion.

Note

It is recommended to use a secondary domain vs a pointer, as secondary domains in InterWorx already have their own html directories and vhosts.

To Change the Primary Domain:

Warning

It is strongly recommended to do a full backup of the SiteWorx account before proceeding.

  1. Log in to the server at the CLI as root, either via SSH or from the terminal

  2. At the command line, enter the following:

    • ~iworx/bin/domain-promoter.pex --help - This provides a list of options and syntax for the domain promotion tool.

    • Primarily used options include:

      • --pointer-to-primary Promotes a pointer domain to the primary domain

      • --secondary-to-primary Promotes a secondary domain to the primary domain

      • --primary-domain <string> Denotes the current primary domain

      • --pointer-domain <string> Denotes the pointer domain to promote (only use if promoting a pointer domain)

      • --secondary-domain <string> Denotes the secondary domain to promote (only use if promoting a secondary domain)

      • --restart-http Restart web server (including cluster nodes)

      • --non-interactive Prevent warnings from pausing script

    • Examples:

      • Promoting a secondary domain:

        ~iworx/bin/domain-promoter.pex --secondary-to-primary --primary-domain primarydomain.com --secondary-domain secondarydomain.com
        
      • Promoting a pointer domain:

        ~iworx/bin/domain-promoter.pex --pointer-to-primary --primary-domain primarydomain.com --pointer-domain pointerdomain.com
        
  3. Press Enter to acknowledge the warning and continue

    WARNING: This script changes directory names in the /home/<unixuser>
    directory. This can cause problems for some live websites depending on how
    they are built, so great care should be taken before running the domain
    promoter script.
    
    We strongly recommend doing a full backup of the SiteWorx account this script
    is being run on before proceeding.
    
    Press enter to continue
    
  4. Wait for the script to complete the promotion process. Progress notifications will show in the console

    [root@server ~]# ~iworx/bin/domain-promoter.pex --secondary-to-primary --primary-domain domain.com --secondary-domain newdomain.com
    WARNING: This script changes directory names in the /home/<unixuser>
    directory. This can cause problems for some live websites depending on how
    they are built, so great care should be taken before running the domain
    promoter script.
    
    We strongly recommend doing a full backup of the SiteWorx account this script
    is being run on before proceeding.
    
    Press enter to continue
    Updating InterWorx Domains Table
    Changing secondary domain type
    Changing primary domain type
    Updating parent ids of other child domains
    Updating domain quota information
    Updating dovecot sni hosts
    [root@server ~]#