Error – Restore a Full Backup/cpmove File
Hi Guys, currently i’m migrating one of our client’s hosting server from INDIA (Dedicated Server) to USA (softlayer cloud server). While migrating the account, I had faced the below issue.
Error : Restore for rusac
The error message ,which i got while restoring the rusac account,
Restore Error :
Cannot restore. That user already exists on this system
I had faced that issues for few more accounts but i had follow the below steps to restore those accounts and now, I’m going to explain the details of rusac .
1) finding the “rusac” user name in server ?
Use the below command to find-out whether the user is available at user home directory or any other location or any configuration file.
[email protected] [~]# find / -name "rusac" /var/spool/cron/rusac /var/cagefs/16/rusac /home/virtfs/jeyaprak/var/spool/cron/rusac /home/virtfs/jeyaprak/var/cagefs/16/rusac /etc/proftpd/rusac
The username is available above location and i’m going to delete it manually using rm See the output.
[email protected] [~]# rm -Rf /var/spool/cron/rusac [email protected] [~]# rm -Rf /var/cagefs/16/rusac [email protected] [~]# rm -Rf /home/virtfs/jeyaprak/var/spool/cron/rusac [email protected] [~]# rm -Rf /home/virtfs/jeyaprak/var/cagefs/16/rusac [email protected] [~]# rm -Rf /etc/proftpd/rusac
Now, I’m going to try from cpanel, Again i’m getting the same error message.
2) I’m going to check /etc/passwd & /etc/group file ?
Use the below command to find-out whether the user is available at /etc/passwd & /etc/group file.
[email protected] [~]# grep rusac /etc/passwd rusac:x:616:617::/home/rusac:/sbin/nologin [email protected] [~]# grep rusac /etc/group rusac:x:617:
I could found that, the user is available from /etc/passwd & /etc/group file.
3) How to delete the user from /etc/passwd file ?
I’m going to delete the user from /etc/passwd file manually. See below.
anjayahf:x:609:610::/home1/anjayahf:/usr/local/cpanel/bin/noshell saplearn:x:611:612::/home1/saplearn:/usr/local/cpanel/bin/noshell edwin:x:613:614::/home1/edwin:/usr/local/cpanel/bin/noshell learnseo:x:614:615::/home/learnseo:/usr/local/cpanel/bin/noshell pfcpan:x:615:616::/home1/pfcpan:/usr/local/cpanel/bin/noshell rusac:x:616:617::/home/rusac:/sbin/nologin subhamso:x:617:618::/home1/subhamso:/usr/local/cpanel/bin/noshell adarsh:x:618:619::/home1/adarsh:/usr/local/cpanel/bin/noshell anbu:x:619:620::/home1/anbu:/usr/local/cpanel/bin/noshell berry:x:620:621::/home1/berry:/usr/local/cpanel/bin/noshell
Just open the /etc/passwd file and remove entire line of the user.
4) How to delete the user from /etc/group file ?
I’m going to delete the user from /etc/group file manually. See below.
acsgasca:x:609: anjayahf:x:610: saplearn:x:612: edwin:x:614: learnseo:x:615: pfcpan:x:616: rusac:x:617: subhamso:x:618: adarsh:x:619: anbu:x:620:
Just open the /etc/group file and remove entire line of the user.
5) Trying restoration from cPanel/WHM >> Backup >> Restore a Full Backup/cpmove File ?
Now, I’m going to try from cPanel/WHM >> Backup >> Restore a Full Backup/cpmove and got success. See the output.
Restore for rusac Searching /home.... Found cpmove-rusac.tar.gz ! Extracting tarball................... Done Extracting Domain....Done . . . Account Creation Status: ok (Account Creation Ok) Checking input data......Done . . Cleaning up extract directory Done . . . Restore Complete Account Restore Complete Unlocking password for user rusac.passwd: SuccessRunning postrestore script....Done . . checked 107 files.....
6) Restoring account, if you avoided STEP – 3 & 4 ?
If you are not familiar or you haven’t got any awareness about importance of those file.what you may suggest to do is, use STEP 6 and avoid STEP 3 & 4 and you don’t want to remove the user from /etc/passwd & /etc/group file, you will be definitely get the same error message (Avoiding STEP – 3 & 4). If you still getting the error message from cPanel/WHM interface, just feel free and try it from SSH, using below command to do it.
[email protected] [~]# /scripts/restorepkg --force learnseo cPanel restorepkg 2 Force Mode: yes Reseller Privs Restore: yes Searching /home.... Found cpmove-learnseo.tar.gz ! Extracting tarball................... DoneExtracting Domain....DoneGenerating Account.... groupadd: group 'learnseo' already exists useradd: user 'learnseo' already exists . . Account Creation Status: ok (Account Creation Ok)Checking input data......Done . . DoneRebuilding Apache ConfRestoring SSL vhost(s)Cleaning up extract directory DoneRestore CompleteAccount Restore Complete Unlocking password for user learnseo.passwd: SuccessRunning postrestore script....Donechecked 179 files.....