Mobile app version of vmapp.org
Login or Join
Radia820

: What's the canonical process for backing up a website? This is going to sound terrible, but bear with me. I currently have a cron job that does a mysql dump, a git add all and commit, and

@Radia820

Posted in: #Administration #Backups #Git #WebDevelopment #WebHosting

This is going to sound terrible, but bear with me. I currently have a cron job that does a mysql dump, a git add all and commit, and a git push to bitbucket. I set this up almost a year ago, when I didn't know much about git, backups, and general web development and administration. I haven't had the time to fix this and do it properly, but the repo has now grown quite big from accumulating large temporary files from my forum, so now I have to do something and I want to do it properly this time around.

What processes do semi-large websites and personal site admins use for backing up server content?

Based on what I've learned since I set this up, what I'm currently think of doing is:


Making changes on a development domain and committing the code frequently
Archiving the entire site after a successful deployment from the development domain
Having automatic daily database and user-content backups.


I still like the idea of backing up sqldumps with git, though. I know git isn't a backup tool and that this is beyond its purpose, but the textual queries that are exported would be easily managed by git and would save a lot of space in archives.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Radia820

2 Comments

Sorted by latest first Latest Oldest Best

 

@Yeniel560

I think most sites use a simple cron job to copy the files to a backup server. However, git is becoming the norm as it allows you to easily branch development and revert to earlier versions. I think what you are doing is fine.

Regarding the database, why not back it up directly? At least, if it's MySQL you can simply back up the folder containing the database (e.g. /var/lib/mysql/database). This way you don't need to explicitly run mysqldump all the time, and you get some more granular versioning (each table is stored in separate files).

10% popularity Vote Up Vote Down


 

@Kristi941

There isn't a canonical backup process any more than there's a canonical web structure/organization.

But you mention that the repo's gotten bloated due to temporary files. Add the files/directories involved to .gitignore and they should no longer be a factor. There's obviously no reason to save them.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme