Logo
Backup Recovery

Backup Recovery #

Cluster Eco Tools Backup Recovery #

Backup SphereEx-Boot #

No backup required.

Backup SphereEx-Console #

Only backups of the SphereEx-Console database are currently supported.

Use SphereEx-Boot to back up the MySQL database in the SphereEx-Console backend.

spex console backup -n 

Recovering SphereEx-Boot #

No recovery required.

Restoring SphereEx-Console #

Currently, it requires manual restoration of backed-up SphereEx-Console database SQL files

Cluster component backup recovery #

Using SphereEx-DBPlusEngine provides EXPORT/IMPORT for backing up and restoring cluster metadata. Currently, it supports the backup of the specified logic library, and the backup content includes two parts: data source and rule.

Backing up clusters #

Login to any compute node and execute DistSQL to back up the specified logical database metadata for the cluster.

Option 1: Export to a specified path on the machine where Proxy is located.

EXPORT METADATA (FROM databaseName) TO FILE '/test/export_metadata.json';

Option 2: Export and output the result (BASE64 encoded) to the client, allowing the client to save it as any file.

EXPORT METADATA (FROM databaseName);

Backup the Table Structure of a Logical Database #

Login to any computing node and execute DistSQL to back up the table structure of a specified logical database in the cluster.

Export to a specified path on the machine where Proxy is located.

EXPORT DATABASE STRUCTURE FROM sharding_db TO FILE '/test/sharding_db.sql';

Restore Cluster Metadata #

Login to any computing node and execute DistSQL to restore cluster logical database metadata.

It will throw an error if the logical database is not empty.

Option 1: Restore metadata from a file.

IMPORT METADATA FROM FILE ‘/test/configuration.json’;

Option 2: Restore metadata based on base64 text.

IMPORT METADATA ‘XXXXXXXXXXXX’;

Restore the Table Structure of a Logical Database #

CREATE DATABASE databaseName;

USE databaseName;

source '/test/sharding_db.sql';