r/mysql • u/GamersPlane • May 01 '25
question Avoiding site shutdown while doing backup
I run a site which is run on a virtual server (PHP and MySQL on the same server). I do backups twice a day via a script run by cronjob, which just does the backup and tars it. The problem is the site goes down for the few minutes it takes for the backup to run. I'd love advice on if there's a way to avoid that happening.
The tables are all MyISAM, and my understanding is switching to InnoDB should help? Otherwise, the only things I've been able to come up with is to create a primary/replica, disconnect the replica for the duration of the backup, and then reconnect it.
View all comments
Show parent comment
1
u/feedmesomedata May 01 '25
There has been a lot of improvements but there are a lot of ways to tune the server based on workload. Generally a high enough buffer pool allowing your entire hot data in memory will be optimal.
You can have a staging db with the same set of data from your production db and run a separate app to test the performance. This way you will not have to guess how your app will behave after a migration in prod.