How to completely backup all mysql databases?

What are typical MySQL backup and restore solutions for >1TB databases?

  • And how long should a typical backup and restore take?

  • Answer:

    First, you should never keep 1TB data size within a single MySQL node/server; which is a overkill and not optimal for performance and day to day operations. Second, Xtrabackup with incremental backup is a good approach; so that you can avoid extensive time in the backups on day to day over secondary NIC card to avoid any production traffic (+ ionice) For restore; it will be nice if you can keep a rolling restore server; so that as the backup finishes; you also roll-forward the incremental changes to this rolling restore server; and keep it ready at any given instance of time with latest backup copy. The rolling restore server is needed to avoid extensive time in the restore process and also to avoid any major down-times in case of disasters. Also; in case if you define a slave and if it can keep up with master; this also a good approach for HA and running backups on top of slave. Either case; you need to seriously think how to distribute the 1TB+ data within a single node to multiple nodes (preferably you should always keep < 350G/node)

Venu Anuganti at Quora Visit the source

Was this solution helpful to you?

Other answers

If you need to take a full backup of a large database you should consider a solution along the following lines: Create a slave server (replica) that you will use to make the backups. You can do this once with a raw copy of the database but you have to consider some downtime. Use a tool like http://www.lenzg.net/mylvmbackup/. This is, AFAIK, the most cost effective way you will find in space and time. Play with the different options this tool supports to find out which ones makes sense to you (e.g., you might not want to use compression to speed up backup and restore times). Now, let me share with you some of my experience with http://www.lenzg.net/mylvmbackup/. First, experiment the tool with a smaller database. Once you feel comfortable, move to the larger one. This will save you lots of time.Plan your hardware. For a large database you want to have lots of disks (with lots of space). And fast! Separate system from data. Use hardware RAID. For data use RAID10 or if you need more space RAID6 might also be ok. xfs is a good choice for the filesystem. If possible, separate the live data, logs and backups in different arrays.Finally, make a good plan of your disk layout: you need to leave some space free on the volume group for the snapshot. How much space? Well, it depends on your data dynamics. You can also stop the replication, take the backup on the slave and resume when finished but I would not recommend this because you might end up with a huge replication lag.And don't forget: backups are only good if you can restore them. So, always try to restore your backups regularly.Final disclaimer: I'm not a DBA myself, but I've learned a few tricks from a real one.

Jorge Morgado

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.