Whatever strategy you use, make sure you test the process of recreating the server from a backup to make sure you will actually be able to recover. You'll also have an idea how long it will take, and you can create scripts to automate the entire flow so you don't have to figure it all out while you're frantic. I use tarsnap, as many others in this thread have shared. I also have the Digital Ocean backups option enabl…
Is there any reason to not trust DigitalOcean's back up system?
Ask HN: How do you back up your site hosted on a VPS such as Digital Ocean?
51–60 of 94 posts
Re: Ask HN: How do you back up your site hosted on a VPS such as Digital Ocean?
#52Earlier quoted context omitted.
I imagine DO has some contingency plan to prevent both your server and the backup being down at the same time.
Unless bug in their system, hack attack or human error deletes all droplets from your account. And yes, I have heard of stories like that from other hosting companies where a human error caused the account to be deleted and data removed.
Re: Ask HN: How do you back up your site hosted on a VPS such as Digital Ocean?
#53Use pg_dump and tar then just s3cp
Re: Ask HN: How do you back up your site hosted on a VPS such as Digital Ocean?
#54Earlier quoted context omitted.
It's always good to have your backup off-site. If something happens to DigitalOcean servers, your backups will be gone too.
I imagine DO has some contingency plan to prevent both your server and the backup being down at the same time.
Re: Ask HN: How do you back up your site hosted on a VPS such as Digital Ocean?
#55Earlier quoted context omitted.
Careful! If someone hacks your server, they now get your Dropbox account. One alternative is to put these backups into S3 using pre-signed requests rather than Dropbox. An S3 pre-signed request gives permission only to upload files, perhaps only to a certain location in a certain bucket. It's a bit harder to set up, but the shell script will look almost the same.
You can actually set up app folders in Dropbox so that a particular API key effectively chroots you to that folder. The attacker would only get the backups.
Re: Ask HN: How do you back up your site hosted on a VPS such as Digital Ocean?
#56Then the script sends it to s3 using aws s3 sync. If versioning is enabled you get versioning applied for free and can ship your actual data and webdocs type stuff up extremely fast and it's browsable via the console or tools. Set a retention policy how you desire. Industry's best durability, nearly the cheapest too.
Re: Ask HN: How do you back up your site hosted on a VPS such as Digital Ocean?
#57Re: Ask HN: How do you back up your site hosted on a VPS such as Digital Ocean?
#58www.tarsnap.com - it's pay as you go, encrypted and super simple to use and script using cron
Re: Ask HN: How do you back up your site hosted on a VPS such as Digital Ocean?
#59Write a little program in your favorite shell or scripting language that * rsyncs the directories containing the files you want to back up * mysqldumps/pg_dumps your databases * zips/gzips everything up into a dated archive file * deletes the oldest backup (the one with X days ago's date) Put this program on a VPS at a different provider, on a spare computer in your house, or both. Create a cron job that runs it ever…
Or put this program on the same VPS but instead of doing the gzipping and versioning yourself, incorporate Tarsnap[1] into the script. With Tarsnap you can also create a read/write-only key so that if someone hacks your server, a real threat mentioned downthread, they won't be able to delete your backups. And whatever you do, check that you can actually recover from these backups every once in a while. [1] https://ww…
That is the _only_ reason I have for looking at something else.