I want to backup my WP flies but the FTP is really slow. Is there a better solution ? (assume CRON and SSH in a managed VPS)
Leave a Reply
You must be logged in to post a comment.
I want to backup my WP flies but the FTP is really slow. Is there a better solution ? (assume CRON and SSH in a managed VPS)
You must be logged in to post a comment.
(assuming that FTP is slow due to amount of files) I use SSH to remotely give command to compress WP directory in single archive and then fetch that file.
On Windows this is relatively easily scriptable with WinSCP ( scripting documentation ).
This method greatly speeds up transfer, makes it secure, requires no plugins server-side, timestamps backups and is easy to schedule or launch with single click.
(assuming FTP is slow in general) I would suggest to research backup plugins that can email backups (although size can get restrictive) or upload them to file storage service.
I recommend rsync. It only transfers what has changed since your last rsync so subsequent updates are very fast, and it works over SSH. Sample usage in crontab:
The
-a
flag preserves many aspects of the original file (ie. symlink vs file) and-z
compresses the transfer. There are some potentially confusing rules about trailing slashes on directory names, but the above example would put everything insidehtdocs/
on the server intoexample.com/
on the local machine.If your local machine is a Windows box, you can install rsync via Cygwin.
As you probably know, there could be a number of reasons your FTP connection is slow. For the purpose of answering this question I am going to assume that you either have a huge amount of files, or either you or your web host has a very slow internet connection.
Personally, when I am dealing with a large number of files I tend to compress the files (tar/zip) and then initiate the transfer. It however could be that your web host has restricted this capability in which case you most likely have a web based control panel provided by your web host. In the majority of cases I have found these control panels allow you to initiate a backup and download this compressed file which hopefully you can extract and use. It’s also possible (yet less likely) that you can upload and uncompress an archive file this way.
The is the only broad suggestion I can provide you given the information available.
If your question was aimed as finding a solution for continuous/routine backups I would suggest exploring rsync (incremental backups) which we utilize on 20 servers. If you are not familiar with rsync or it seems to much to involve yourself with at this time I can highly recommend jungledisk (the server edition) which essentially preforms the same thing and backs up all data to the cloud. Both of these tools however most likely require you to have root access to your VPS.
For more basic routine backup solutions I would search on wordpress.org as I remember seeing some plugins in there including ones that autobackup mysql.
Good luck 🙂