permission denined transfering files from one sever to another

Bloke2

Well-Known Member
Feb 4, 2015
81
4
58
cPanel Access Level
Root Administrator
I accidentally deleted my public_html folder. We just moved from an old server so I still have it. I am trying to transfer the folder "public_html" from one server to another and getting errors. Many more permission errors after what I posted. These were working but some files had permission errors so I deleted everything thinking this would solve it. Not it won't transfer anything.

I tried both of these:
rsync -rltzuv /home/user/public_html [email protected]:/home/user
rsync -av /home/user/public_html [email protected]:/home/user


stdin: is not a tty
building file list ... done
public_html/
rsync: failed to set times on "/home/user/public_html": Operation not permitted (1)
public_html/.htaccess
public_html/_vti_inf.html
public_html/favicon.ico
public_html/index.php
public_html/postinfo.html
public_html/robots.txt
public_html/_private/
rsync: recv_generator: mkdir "/home/user/public_html/_private" failed: Permission denied (13)
*** Skipping any contents from this failed directory ***
 

Bloke2

Well-Known Member
Feb 4, 2015
81
4
58
cPanel Access Level
Root Administrator
Or is someone can give me the steps to tar it, send it to the new server and unzip it. All the instructions I have read are not clear.
I have seen this but don't want to make anymore mistakes. Not sure what they mean by "above public html" :
---------------------------------------------
cd ..
tar -crf public_html.tar public_html
gzip public_html.tar
scp public_html.tar.gz [email protected]'s-IP:/home/where-ever/the-directory-is/above-public_html/
---------------------------------------------------
Then:
gunzip public_html.tar.gz
tar xvf publc_html.tar
 

Bloke2

Well-Known Member
Feb 4, 2015
81
4
58
cPanel Access Level
Root Administrator
I tried this to zip the folder and I get no file or directory. After I log in to SSH do I need to type something first?

tar -pczf backup.tar.gz home/username/public_html/
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
I have seen this but don't want to make anymore mistakes. Not sure what they mean by "above public html" :
Hello :)

It's referring to /home/$username/.

Thank you.
 

Bloke2

Well-Known Member
Feb 4, 2015
81
4
58
cPanel Access Level
Root Administrator
I have so many instructions on how to transfer the files I am confused. At first I thought it was working just transferring but many of the files failed due to permissions. Then I deleted everything in the public_html folder assuming this would help. Can anyone give me instructions on the best way to do it? Some say it needs to be zipped, moved , and then unzipped.

Shouldn't this work? Do I need to makse sure the public_html folder is on the new server? I have a backup but can't find it doing LS.

rsync -rltzuv /home/username/public_html [email protected]:/home/username
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
The instructions in your second post to this thread should work. Just ensure the ownership of your files are correct after the extraction, and the permissions/ownership on the public_html directory matches the format of your other accounts.

Thank you.
 

Bloke2

Well-Known Member
Feb 4, 2015
81
4
58
cPanel Access Level
Root Administrator
After I log in, I have to cd to the /home/username/public_html before I run
tar -crf public_html.tar public_html
gzip public_html.tar

And are these two run one at a time?

And I login on the other server do I have to be in the directory to run these?
gunzip public_html.tar.gz
tar xvf publc_html.tar


Tried:
tar -crf public_html.tar public_html
Got this:
tar: You may not specify more than one `-Acdtrux' option
Try `tar --help' or `tar --usage' for more information.
 
Last edited:

Bloke2

Well-Known Member
Feb 4, 2015
81
4
58
cPanel Access Level
Root Administrator
I transferred it and did a ls on the home directory and can see it listed there.
Then I did gunzip public_html.tar.gz

gzip: public_html.tar.gz: No such file or directory
 

Bloke2

Well-Known Member
Feb 4, 2015
81
4
58
cPanel Access Level
Root Administrator
I am signed into the new server in /home/user/ directory and tried gunzip public_html.tar.gz and it says no such file or directory. Any idea why this is not working? I can see it there when I run "ls" its in red and the file is called public_html.tar. I can list the files inside the public_html.tar
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
I was able to get it transferred over.
I am happy to see you were able to complete the transfer. Would you mind sharing which steps you ultimately utilized?

Thank you.