how to restore full backup from direct admin to cpanel with ssh

 At first i must say that I don't know how to do it 

but as I work in a hosting company as a junior 

I had an accident with this problem 

How to restore full backup from direct admin to cpanel with SSH

if both were cpanel so I did it with two simple commands but since they were different I didn't work 

that true that I'm trying to tech "how to restore full backup from direct admin to cpanel with ssh"

but to the script was this and the 

First in whmcs we must terminate the destination host and go to ssh 

With wget command, we must download the link of the full backup

after that in have a script by cpanel in SSH 

/scripts/restorepkg [filename ]

to restore that 

after restoring complete 

in whmcs we must change the username by the name of the full backup username 

click change package and change password key and make status active  and finish but 

read in tech below  because 



My calik helped me to do this 

but don't tell me more about I didn't ask him because in lovely linux we have a command to show all command history 

Command history to start 

 1000  2023-08-30 22:57:12 wget https://www.ehia-law.ir/backup-ehialawi_ehia-law                                                                                        _ir_2023-08-30-18-26-01.tar.gz

 1001  2023-08-30 22:57:18 ls

 1002  2023-08-30 22:58:34 /scripts/restorepkg backup-ehialawi_ehia-law_ir_2023-                                                                                        08-30-18-26-01.tar.gz

 1003  2023-08-30 23:02:27 /scripts/restorepkg backup-ehialawi_ehia-law_ir_2023-                                                                                        08-30-18-26-01.tar.gz

 1004  2023-08-30 23:03:27 cd ~ehialaw2/public_html/

 1005  2023-08-30 23:03:39 mkdir back

 1006  2023-08-30 23:03:56 mv /root/backup-ehialawi_ehia-law_ir_2023-08-30-18-26                                                                                        -01.tar.gz back/

 1007  2023-08-30 23:03:59 cd back/

 1008  2023-08-30 23:04:00 ll

 1009  2023-08-30 23:04:09 tar -xzvf backup-ehialawi_ehia-law_ir_2023-08-30-18-2                                                                                        6-01.tar.gz

 1010  2023-08-30 23:04:49 cp -R domains/ehia-law.ir/public_html/* ~ehialaw2/pub                                                                                        lic_html/

 1011  2023-08-30 23:05:15 cp domains/ehia-law.ir/public_html/.htaccess ~ehialaw                                                                                        2/public_html/

 1012  2023-08-30 23:05:44 ll

 1013  2023-08-30 23:05:48 cd backup/

 1014  2023-08-30 23:05:49 ll

 1015  2023-08-30 23:06:42 cp ehialawi_currency.sql ehialawi_main.sql ~ehialaw2/                                                                                        public_html/

 1016  2023-08-30 23:06:48 cd ../..

 1017  2023-08-30 23:06:59 chown -R ehialaw2:ehialaw2 back/

 1018  2023-08-30 23:08:32 mysql ehialaw2_main < ehialawi_main.sql

 1019  2023-08-30 23:22:08 history

he was created a username for the user and after that 

go to ssh and move the compressed download file to public_html/(for example backuphahaha)/

and with  tar -xzvf  command extract the file 

so copy all in the public HTML  of direct admin structure to cpanel structure  cp -R domains/ehia-law.ir/public_html/* ~ehialaw2/public_html/               

all in public directory must change user my colick make wrong and just change back up directory 

that was his command chown -R ehialaw2:ehialaw2 back/

but I have another colick that is more professional                

and this command is so better for example 

fix ed
[root@sabalan ]# cd iranlock
[root@sabalan iranlock]# chown -R iranlock:iranlock public_html
[root@sabalan iranlock]# chown iranlock:nobody public_html
[root@sabalan iranlock]# chmod -R 755 public_html
[root@sabalan iranlock]# chmod 750 public_html

[root@sabalan iranlock]# find public_html -type f -exec chmod 644 '{}' \;

💥👍👍

so continue the checking that command 

by the user name of in whmcs 

make a database and user and password in MySQL with PHPmyadmin 

and sync parameter in wp-config,php and after that again with ssh 

 mysql ehialaw2_main < ehialawi_main.sql       

and that was finish                                        


that was so simple move compredss downloaded file to 

Comments

Popular posts from this blog

how to install and use v2ray on termux android

how to install Live Kali Linux that is persistence on a USB