backup websites through scp, how to fix permissions?

Discussion in 'General' started by larsvansante, May 22, 2015.

  1. larsvansante

    larsvansante New Member


    I am looking to backup my sites from one server to another using scp, because going through ftp with my internet connection takes 2-3 days for those sites to finish... I am concerned about the permissions, if they are set as root I won't be able to edit them through ftp. will resync websites resolve that problem? or what is the best way to do it?

    Also if you know of a gui tool to help me through the scp process for windows or debian, that would ease things a lot for me.

  2. till

    till Super Moderator Staff Member ISPConfig Developer

    I would use rsync over ssh instead of ftp or scp:

    rsync -avz -e ssh --delete /var/www/ [email protected]:/my/backup/directory/

    The rsync command on your server has to be run as root. It will only sync new or changed files when you run it a second time, so the first backup will take quite long but the next backup will be fast. The --delete switch just means to delete files in the backup that have been deleted on your server, if you dont want that, remove --delete from the command.

    You can do the same for /var/vmail if you want to backup emails as well.
  3. larsvansante

    larsvansante New Member

    Thanks Till! I dont need to worry about permissions?
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    As long as you run this command as root, it will preserve all permissions. I use the same command for server migrations.

Share This Page