Why it is Important to Run a Backup on Ubuntu?
You will never feel the importance of the backup on Ubuntu unless you lose important content. Do you know that before developing our exclusive method to create a robust backup on Ubuntu, we lost an important data by mistake! Therefore, we learned a lesson not to miss a real-time backup for anything important on your server. We developed a robust automated methods to backup data as a result of that sudden loss. In addition, the method we expose here is 100% guaranteed to protect your data from being lost.
What Will We Cover?
In this section, we will make a robust backup environment. Then, we will show you our best practice sync backup folders in real-time.
Backup Infrastructure
In the first place, we will create a backup infrastructure. That is to say, to make it easy to have a separate backup for every instance on your server. For example, you can run a backup for website A, website B or even the mail server files.
Generate Backup on Ubuntu
Once the backup infrastructure is ready, we can generate the backup zip files for the site files, mail server files and the database.
Real-time Syncing
Before staring real-time syncing with a destination, we should get and prepare the destination backup server. Once the backup server is ready, we will start the real-time sync process between the source and destination. For this purpose, we will use Rsync utility.
Sync Backup Directories with Remote Server
Real time syncing between two servers can be done when using Rsync on Linux and iNotifyWait utilities together. We will show you how it’s easy to sync website folders and emails. Also, we will sync the master backup folder.
Sync Backup Directories with Local Computer
It’s very important to keep a copy of your files on your local machine. For this purpose, we will download the WinSCP. Then, we will create a Rsync Linux user. After that, we will show you the sync settings and start the sync process.
Real-time Database Syncing
The previous two sync methods can keep a copy of all your important files on two destinations but this is not enough. We will implement a full MySQL master slave replication system in order to keep the database synced in real-time. Before starting the sync process, we will configure the master and slave. Then, we will secure the connection via SSL. After that, will export the databases from the master to slave. Finally, we will start the sync process.
Detailed Table of content
- Backup Infrastructure Setup
- Manual Creation (9 steps)
- Automatic Creation (4 steps)
- Backup MySQL and Site Files on Source Server (7 steps)
- Real Time Sync for Master Backup Directory Between Servers via Rsync and iNotifyWait
- Linux Backup Server Setup (4 steps)
- Rsync Linux User Creation and Test (7 steps)
- Real Time Sync via iNotifyWait (8 steps)
- Restore MySQL on Destination Server from Backup (8 steps)
- Real Time Sync for Master Backup Directory with Local Computer
- Real Time Sync for Database via MySQL Replication
- MySQL Master Slave Replication Setup
- Configure Master (8 steps)
- Configure Slave (5 steps)
- Secure Connection with SSL (3 steps)
- Test SSL Connection (3 steps)
- Export All Databases from Master and Import Into Slave (4 steps)
- Connect Slave to Master (5 steps)
- Add New Database to Replication
- Update the Backup Environment for the New Website (3 steps)
- Create New Database and User on Master (3 steps)
- Create New Database and User on Slave (1 steps)
- Add the New Database to Replication in 50-server.cn File (2 steps)
- Export New Database to Slave (3 steps)
- Import New Database into Slave (5 steps)
- Resume Replication (2 steps)
- MySQL Master Slave Replication Setup