Manually restoring a backup

February 10, 2021

Download the repo


Check out the right commit

cd /data/codeguard/shared/data/repos/website-xxxx
git checkout xxxx

Use LFTP to restore the files

lftp -e "set ftp:ssl-allow no; mirror --parallel=4 --use-pget-n=2 --verbose -R local/directory/to/restore /remote/directory/to/restore/to" -u user,'pass' -p port hostname

For sites with a key:

lftp -e "set sftp:connect-program 'ssh -a -x -i /data/key'; mirror --parallel=4 --use-pget-n=2 --verbose -R local/directory/to/restore /remote/directory/to/restore/to" -u user,placeholder sftp://hostname

If you see errors about the number of connections, decrease the –use-pget-n and –parallel values.