The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

permission denined transfering files from one sever to another

Discussion in 'General Discussion' started by Bloke2, Feb 24, 2015.

  1. Bloke2

    Bloke2 Active Member

    Joined:
    Feb 4, 2015
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    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 username@ipaddress:/home/user
    rsync -av /home/user/public_html username@ipaddress:/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 ***
     
  2. Bloke2

    Bloke2 Active Member

    Joined:
    Feb 4, 2015
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    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 root@your-remote-server's-IP:/home/where-ever/the-directory-is/above-public_html/
    ---------------------------------------------------
    Then:
    gunzip public_html.tar.gz
    tar xvf publc_html.tar
     
  3. Bloke2

    Bloke2 Active Member

    Joined:
    Feb 4, 2015
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    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/
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,696
    Likes Received:
    656
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

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

    Thank you.
     
  5. Bloke2

    Bloke2 Active Member

    Joined:
    Feb 4, 2015
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    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 new@000.00.00.00:/home/username
     
    #5 Bloke2, Feb 27, 2015
    Last edited: Feb 27, 2015
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,696
    Likes Received:
    656
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  7. Bloke2

    Bloke2 Active Member

    Joined:
    Feb 4, 2015
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    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.
     
    #7 Bloke2, Feb 27, 2015
    Last edited: Feb 27, 2015
  8. Bloke2

    Bloke2 Active Member

    Joined:
    Feb 4, 2015
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    tar -cf public_html.tar public_html
    gzip public_html.tar
    scp public_html.tar.gz username@000.00.00.00:/home/user/


    I got it zipped and now I get this when i try to transer it.
    stdin: is not a ttystdin: is not a tty
     
  9. Bloke2

    Bloke2 Active Member

    Joined:
    Feb 4, 2015
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    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
     
  10. Bloke2

    Bloke2 Active Member

    Joined:
    Feb 4, 2015
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    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
     
    #10 Bloke2, Mar 2, 2015
    Last edited: Mar 2, 2015
  11. Bloke2

    Bloke2 Active Member

    Joined:
    Feb 4, 2015
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    I was able to get it transferred over.
     
  12. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,696
    Likes Received:
    656
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    I am happy to see you were able to complete the transfer. Would you mind sharing which steps you ultimately utilized?

    Thank you.
     
Loading...

Share This Page