cd /var/discourse
./launcher stop app
cd /var/discourse/shared/standalone
mv uploads /mnt/volume-sfo2-01/backups # script'd need to find this
ln -s /mnt/volume-sfo2-01/backups .
cd -
./launcher start app
Given that I didn’t miss a typo in the above, it should work fine. I tested having symlinks on my development machine and did a backup and restore with no problems. The slower speed of the block storage shouldn’t matter for backups.
I’d like to integrate this into discourse-setup, but it hasn’t happened yet.
We don’t have any magic, secret knowledge about how Digital Ocean block storage works, and we don’t use it at all for our own infrastructure. You’d be better off trying it out yourself, determining if it meets your needs, and then reporting back for others in a similar position.
I’d gladly do, but I’m afraid to break something as I’m not knowledgeable enough in *nix to play with stuff like this and, more importantly, measure the outcomes.
Having backups on DO block storage is much less risky than having your images there. Has that been working for you? If so, it’d be helpful to know, as you may be the person with the most experience.
But wait! Now it looks like there’s a better solution for backups developed and tested by a Discourse @team member:
What I had in mind is a specific use case where the problem was: I have a dirty cheap vps provider, and I’m afraid of losing all my data. If things go south, I need a fresh backup to start over elsewhere.
Oh. I totally overlooked that. I’m already paying for dropbox, so for me it’s “free,” but $100/year is < than the $10/month for the DO space. I haven’t looked at the plugin, but I imagine that there’s a way to contrive having dropbox keep old copies (e.g., it keeps deleted files for a month or something like that).
But my instructions for moving backups to DO’s Block storage should work just fine, and since it’s backups (which you can, for example, store a couple offsite while you do the initial move), it’s pretty low-risk.
Hi,
what is the logic behind moving the uploads? I’m just looking for a way to keep backups on a different place and your method seems perfect except I don’t understand the need to move uploads and turning it into backup destination…
Maybe I’m just going crazy
Doing it your way results in:
ln: failed to create symbolic link ‘./backups’: File exists
I looked through the contents of /var/discourse and I began to wonder. Would there be any disadvantage to having the entire /var/discourse on block storage. It has uploads, backups, image, logs, and config but not the docker image itself. Basically it has all the things I need if I want to move to a new server or if the Droplet goes away I can quickly reattach the volume and I’m up and running again.
Oh, I’m running a web only instance so it would be everything except the DB.
Is DO Block Storage much slower than AWS EBS? I thought it was a common practice to use EBS for databases.
I have a MySQL DB running SMF and the files are on Block Storage with no issues. In fact, when I split the DB from the frontend, everything went faster.