Migrating Plesk Accounts from One Server to Another

Posted on Jul 12, 2010

Procedure

  1. Create a backup of the account that you want to migrate for testing purposes:
    1. Login to the server via ssh
    2. Get the user account that you want to backup, for example paulusworldadmin. 
    3. To backup a user account with all data:
      
      
              /usr/local/psa/bin/pleskbackup clients paulusworldadmin /path/to/backup
              
      
      clients – is telling the pleskbackup program to backup a client, which includes client account along with all limits, IPs, domains and settings, etc that are associated with the account.
      paulusworldadmin is the client we’re backing up.
      /path/to/backup where to write the backup file.
  2. Upload the backup file.
    1. Login via ssh on the server you want to import the backup to.
    2. Create a map file:
      
      
              /usr/local/psa/bin/pleskrestore --create-map backup.file -map backup.map
              
      
      You may need to modify the domain’s IP address in the backup.map
    3. To restore the account:
      
      
               /usr/local/psa/bin/pleskrestore --restore backup.file -level clients -map backup.map
               
      
      --restore is specifies the file that you created with pleskbackup
      -level clients level want to restore. In this case we wanted restore an entire client account.
      -map backup.map tells pleskrestore to use the backup.map, which was in step 2.6.
      Once you have successfully tested and performed and needed changes, change the A records TTL to 300s. If the TTL was set to 86400, then you will need to wait a day before you can change the A record.
    4. If possible put the site into offline mode. If the site does not have an offline mode, then create a .htaccess file and redirect all traffic, except yours to a page that tells users the site is down for maintenance.
    5. Perform Step 1 again.
    6. Change the DNS record.
    7. Wait 24 hours before shutting off the domain on first server.
    8. Shut off the domain.
    9. Copy the emails that still got delivered to the first server to the second server. Emails will be stored in /var/qmail/mailnames/domainname/
    10. Remove the client account from the server.

Issues

  • After updating the A record for the mail, providing the server handles emails, some smart phones will cache the old IP.
  • If the client exists on both servers, then you will need to backup the domain and restore it on the other server:
     
    1. Login to Plesk and find the domain you want to backup
    2. Perform the backup and download the file.
    3. Create the domain
    4. Upload the backed up file under the same client on the second server.
    5. Restore the domain.