How to Migrate from one Domain Name to Another Domain Name on Linux Plesk 11

Introduction

We somtimes have customers who would like to keep the current website available for users but have another website prepared on a different server and using different technology. These customers usually don’t want to purchase another domain name for the period of transition. What we do at Octopus Computer Solutions, is offer them to build the new website on a different subdomain. For example, they have www.example.com we then create newsite.example.com for the transition and development period.

 

When we finished work and the customer has approved us to migrate the new system onto the www domain we have the following command to help us. Plesk doesn’t give you the ability to change the domain name you’ve configured unless you delete and create a new one.

 

Procedure

For this, i’ve found on linux machine that it’s possible to ‘migrate’ (changing the domain name of) a website with 1 easy step.

 

Following is the command:

 

newsite.example.com – the new website we’ve developed on plesk

example.com – the old website’s address we’re moving to.

 

# /opt/psa/bin/domain -u newsite.example.com -new_name example.com

 

Now, it’s not over yet. If you have different servers, you need to update your DNS configuration to withstand the new IP of the new server.

Also, there’s a workaround to be made for PHP websites running on plesk.

 

You need to update your open_basedir configuration since the domain command doesn’t.

 

Edit the following file:

# vi /var/www/vhosts/example.com/etc/php.ini 

 

From:

open_basedir = “/var/www/vhosts/newsite.example.com/:/tmp/”

 

To:

open_basedir = “/var/www/vhosts/example.com/:/tmp/”

 

You can restart your apache server if you’d like.

 

Enjoy.