Advance

Move backup from Cpanel to the DirectAdmin

Move backup from Cpanel to the DirectAdmin

Move backup from Cpanel to the DirectAdmin; Many webmasters these days are planning to move their sites from Cpanel to DirectAdmin, due to the change in licensing by Cpanel. If you have made the decision to move to the DirectAdmin, read this tutorial to the end so you can easily move all your files without problems.

Things to Know Before You Can Transfer Backups from Cpanel to the DirectAdmin:

  • The format of the backup files you create in CPanel must be in the form of “cpmove-user.tar.gz
  • Your DirectAdmin version should be above 1/57/4
  • Check that the latest version of Roundcube is installed on your server

Note that the contents of the Mailing list section in CPanel do not transfer to the DirectAdmin.

The format used by the DirectAdmin for the database name and database username is always: “username_database” and “username_user“. CPanel also uses the same format, but often due to the limitation that exists between the database name and the database user, CPanel usually shortens the username field.

Recommended Article: How to access Safe Mode in Windows 10

 

However, the DirectAdmin always puts the username section completely at the beginning of the string. This is also true when converting CPanel backups to the DirectAdmin, so after moving you need to change the “wp-config.php” file and similar files that are stored in other database scripts.

If your CPanel backups are provided by the “Jetbackup” plugin, please note that the output files of this plugin are not “cpmove-user” and need to be converted. Here’s how to do it.

Note:

We recommend that you keep CPanel core backup files named “cpmove-user.tar.gz” after transferring and restoring backups to the DirectAdmin on your server, in case there is a problem or error on the sites backing file Still at your disposal.

DirectAdmin has features not available in CPanel such as direct support for nginx / openlitespeed, mysql8, rspamd, etc. There are also things that are not supported in the DirectAdmin, such as rubby and postgresql.

So if you have a site that uses both of these you need to manually transfer.

The maximum length of the system usernames string is in the DirectAdmin is 10 characters and in MySQL is 16 characters, which you can increase by the method described below.

If you have a number of CPanel backups whose format is called user.tar.gz, you can generally convert them to the correct cpmove-user format before attempting to restore the backup.

If you have many CPanel backups whose format is backup-… ._user.tar.gz, you can generally convert them back in the correct cpmove-user format before attempting to restore the backup.

After the transfer, you may not see a list of some of the transferred users in the “Move users between resellers” section, and the method for fixing this problem will be discussed below.

Jetpack Backup Converter:

Since the Jetpack plugin does not generate backups in cpmove-user format, you need to convert the backups of this plugin to the DirectAdmin to restore it. To do this, run the following command after transferring the files to the DirectAdmin server on ssh.

jetbackup=yes /usr/local/directadmin/scripts/cpanel_to_da/cpanel_to_da.sh /home/admin/user_backups/cpmove-USERNAME.tar.gz /home/admin/converted_user_backup

chown -R admin. /home/admin/converted_user_backup

Increase the string length of System and MySQL usernames in the DirectAdmin:

The DirectAdmin supports up to 10 characters in naming system users and 16 characters in the naming database and database users.  You can maximize this number by executing the following command on your ssh DirectAdmin server.

/usr/local/directadmin/directadmin set max_username_length 16 restart

Convert Cpanel backups to the correct format for transfer to the DirectAdmin:

If you have backups in your CPanel that are in the form of user.tar.gz or backup-… -user.tar.gz you must convert them to cpmove.tar.gz before attempting to restore them to the DirectAdmin. You can simply perform this conversion by following the instructions below. If your backup is in the form of user.tar.gz, run the following command:

for i in `ls *.tar.gz | grep ‘^[A-Za-z0-9]*.tar.gz’`; do { mv -vf ${i} cpmove-${i}; }; done

If your backup is in the form of backup-… -user.tar.gz, run the following command:

for i in `ls backup-[0-9]*.*.tar.gz`; do { USERNAME=`echo $i | cut -d_ -f3 | cut -d’.’ -f1`; mv -v $i cpmove-${USERNAME}.tar.gz; }; done

Note to run the above commands in the same directory as the backups.

Recommended Article: Htaccess Tricks on Cpanel Linux Host

 

Fixed the problem of not displaying the user in the “Move users between resellers” section of the DirectAdmin:

If you did not see all users or some users after the backups were restored in the DirectAdmin and refer to the Move users between resellers section of the DirectAdmin, run the following command on your ssh DirectAdmin server.

#!/bin/sh

cd /usr/local/directadmin/data/users

for r in `ls */reseller.conf | cut -d/ -f1`; do

{

echo “fixing Reseller $r …”;

echo -n ” > $r/users.list

for u in `grep “^creator=$r$” */user.conf | cut -d/ -f1`; do

{

ISUSER=`grep -c usertype=user $u/user.conf`

if [ “$ISUSER” = “1” ]; then

echo $u >> $r/users.list

fi

};

done;

};

done;

Fix the problem of not having users in the correct representative subset:

If you did not return delegates first when backing up the DirectAdmin, users will be created as admin subsets. To fix this problem, run the following command in the directory where the backups are located.

for i in `ls user*.tar.gz`; do { RESELLER=`echo $i | cut -d. -f2`; USER=`echo $i | cut -d’.’ -f3`; /usr/local/directadmin/scripts/move_user_to_reseller.sh $USER admin $RESELLER; }; done

echo “action=cache&value=showallusers” >> /usr/local/directadmin/data/task.queue

/usr/local/directadmin/dataskq d

Start the process of transferring backups from CPanel to Directadmin:

“Move backup from Cpanel to the DirectAdmin”:

To start the transfer, first, log into your ssh in the CPanel server and do the following two steps carefully.

1. First, create a backup of all your CPanel accounts by executing the following command.

mkdir -p /home/all_backups

for user in `ls /var/cpanel/users/`; do { /scripts/pkgacct ${user} /home/all_backups; }; done

2. After the backup process is completed on the server, transfer the created backup files to the DirectAdmin with the following command:

rsync -avt –delete /home/all_backups/ root@your_directadmin_server.com:/home/admin/all_backups/

After transferring backup files to the new server, Connect to the ssh server of your DirectAdmin server and execute the following commands:

cd /usr/local/directadmin/custombuild

./build update

./build cpanel_to_da

chown -R admin. /home/admin/all_backups

After completing the above steps, you can easily restore the backups in the /home/admin/all_backups by entering the DirectAdmin and going to the backup & restore section.

“Move backup from Cpanel to the DirectAdmin”.

Goodluck.

We Are Waiting for your valuable comments and you can be sure that it will be answered in the shortest possible time.

Leave a Reply

Your email address will not be published. Required fields are marked *

We are by your side every step of the way

Think about developing your online business; We will protect it compassionately

We are by your side every step of the way

+8595670151

7 days a week, 24 hours a day