
Sebastian Krebs
October 20, 2023
In recent months, we have migrated our entire application landscape from a self-operated, geo-redundant OpenStack platform to T Cloud Public (formerly Open Telekom Cloud). As a Circle Partner, we have since been relying on T Cloud Public for both our own applications and for our customers and the applications we operate for them.
In addition to the Cloud Container Engine, which offers the efficient provision of infrastructure resources, we use the Relational Database Service (RDS) the Relational Database Service (RDS) very intensively. Almost every application needs a database and RDS makes database management easier than ever to manage databases. Of course, this also applies to database backups.
In the T Cloud Public, database backups of RDS are created using Percona XtraBackup and qpress. The backup is therefore not an SQL dump, as one might expect, but an exact copy of the binary data of the actual MySQL data. This means that although you get an exact image of the database, it must be restored to an instance with the same MySQL version and all specific settings. RDS offers a simple and convenient way to restore the backup to a new RDS instance and thus obtain a copy of the database. This can be useful and necessary if you are interested in the data at a specific point in time, for example, if something was accidentally deleted in the past but new data has already been added. In this case, it is necessary to extract only part of the data in the backup and transfer it back to the productive database .
To achieve this, it would be possible to use a database copy as a new RDS instance in the T Cloud Public, but this would involve effort and costs. To access the data in the RDS backup more easily and at no cost, we have written the "OTC RDS Backup Extractor." This allows you to automatically provision an RDS backup as a Docker container and gives you the option of accessing the data locally. Furthermore, you can specify the MySQL version in the Dockerfile and make other specific settings (e.g., SqlMode, Lowercase Tablenames, etc.) to adapt it exactly to the instance from which the backup was taken.
It is very easy to use. First, a new image is created from the Dockerfile. The required packages for Percona XtraBackup and qpress are automatically downloaded from the corresponding repositories:
docker build -t otc-rds-extractor .
A new Docker container is then started with the previously created image, the RDS backup is automatically decompressed and made available as a local MySQL database:
docker run -v $(pwd)/backup.qp:/backup.qp -p 3306:3306 otc-rds-extractor
The database can then be accessed with the original access data under 127.0.0.1:
mysql -u <user> -p -h 127.0.0.1
We provide the "OTC RDS Backup Extractor" free of charge on GitHub. Here is a link to the corresponding repository: https://github.com/TWENTY-20/otc-rds-backup-extractor
twenty20 GmbH & Co. KG
Hausinger Straße 6
40764 Langenfeld
+49 (0) 2173 167 00 50