Search K
Appearance
Appearance
WARNING! us_wordpress cannot be owned by user, renaming database user to user_wordpress/usr/local/directadmin/conf/directadmin.conf. You can find max length of your username in cPanel easily:ls /var/cpanel/users | awk '{print length, $0}' | sort -nr | head -n1pkgacct forms cpmove-users.tar.gz. If you have a list of user.tar.gz files, and want to rename them all in current directory:for i in `ls *.tar.gz | grep '^[A-Za-z0-9]*.tar.gz'`; do { mv -vf ${i} cpmove-${i}; }; donebackup-...._user.tar.gz instead of cpmove-user.tar.gz, it will not work! pkgacct forms cpmove-users.tar.gz. If you have a list of backup-...._user.tar.gz files, and want to rename them all in current directory: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; }; donecd /home/admin/all_backups
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/home/all_backups (make sure you have enough of space for them, if not, please read the suggestions at the end of the article):mkdir -p /home/all_backups
for user in `ls /var/cpanel/users/`; do { /scripts/pkgacct ${user} /home/all_backups; }; done/home/all_backups to DirectAdmin server:rsync -avt --delete /home/all_backups/ root@[B]your_directadmin_server.com[/B]:/home/admin/all_backups/We're done with cPanel server now. Let's connect to DirectAdmin server now.
/home/admin/all_backups are owned by "admin".chown -R admin. /home/admin/all_backups/home/admin/all_backups 😃 Now we can simply go to DirectAdmin "Admin Backup/Transfer" section, check "Backup/Restore Settings" (defaults should be fine) in Admin level and restore all backups from /home/admin/all_backups directory.That's it!
If you have enough of space, I'd suggest leaving /home/admin/all_backups still there on DA server for a couple of weeks/months, if there is something missing in DA - you'd always have it in that backup.
If your cPanel server doesn't have enough of space - it's easy transfer accounts one-by one directly to the home folder on a new server. The most convenient way to do this is to generate SSH keys on cPanel server using:
ssh-keygenThen you'll have your public key placed in /root/.ssh/id_rsa.pub. Just copy the content of it to your DirectAdmin server, file /root/.ssh/authorized_keys (if /root/.ssh directory does not exist, create it). This will make it possible to connect to DA server without any password (from your cPanel server). Now instead of steps 1) and 2) on cPanel server, just do this:
for user in `ls /var/cpanel/users/`; do { /scripts/pkgacct ${user} /home/all_backups; rsync -avt /home/all_backups/cpmove-${user}.tar.gz root@your_directadmin_server.com:/home/admin/all_backups/cpmove-${user}.tar.gz; rm -f /home/all_backups/cpmove-${user}.tar.gz ; }; done/home/user_backups (replace "USERNAME" with a real username) using "pkgacct" cPanel tool/script:/scripts/pkgacct USERNAME /home/user_backups;/home/user_backups/cpmove-USERNAME.tar.gz to DirectAdmin server:rsync -avt /home/user_backups/cpmove-USERNAME.tar.gz root@your_directadmin_server.com:/home/admin/Done. Now we need to connect to the DirectAdmin server.
/usr/local/directadmin/shared/cpanel_to_da/cpanel_to_da.sh /home/admin/cpmove-USERNAME.tar.gz /home/admin/converted_user_backup/chown -R admin:admin /home/admin/converted_user_backup/home/admin/converted_user_backup, otherwise you won't see the backup).That's it!