Skip to content

Commit

Permalink
Merge pull request #88 from skysqlinc/DEV-1520-logical-dump-gtid-stat…
Browse files Browse the repository at this point in the history
…e-clarification

Fix markdown linting issues and add GTID clarification for logical dumps
  • Loading branch information
NedPK authored Jan 17, 2025
2 parents d8176a2 + 65a5bff commit 7237bf3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
16 changes: 13 additions & 3 deletions docs/Backup and Restore/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ Binlogs record database changes (data modifications, table structure changes) in

## Restores

**WARNING**
> Restoring from a backup will erase all data in your target DB service. If you are uncertain, it is advisable to first create a backup of the DB service before initiating the restore process. Consider restoring to a new database instance as a preferred approach. The database being restored will be temporarily stopped during the restoration.
### Warning
> Restoring from a backup will, by default, erase all data in your target DB service. If you are uncertain, it is advisable to first create a backup of the DB service before initiating the restore process. Consider restoring to a new database instance as a preferred approach. For restores other than logical dumps, the database being restored will be temporarily stopped during the restoration.
Users can instruct the restore of their SkySQL Database from their own SkySQL storage or from an external storage they own. The restore API provides options for listing, adding, and deleting a scheduled restore operation.

Expand Down Expand Up @@ -213,7 +213,17 @@ SkySQL Users can delete their already defined database restore schedules with th

- [Examples](Restore Delete Examples.md)

## Limitations
### **GTID Considerations for Logical Dumps**

When restoring from a logical dump in MariaDB:

- The GTID state is not preserved by default in logical dumps
- If you're using replication, you'll need to:
1. Either reset the GTID state after restore
2. Or use `mysqldump --dump-slave` to include GTID information in the backup
- Consider using physical backups (mariabackup) instead, as they preserve GTID state

## Limitations

- Currently, SkySQL services deployed in Azure can only be backed up and restored using [SkySQL Snapshots](Snapshot Backup Examples.md).
- SkySQL Managed backups can only be restored within the same cloud provider. If you need to restore to a SkySQL service hosted on a different cloud provider, you must export your backup to S3 or GCS storage and follow the steps described [here](Restore From Your Own Bucket.md).
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@ MariaDB SkySQL customers can configure inbound replication from both **MySQL** a
For additional information about the stored procedures used to configure replication with Replicated Transactions services, see [SkySQL Replication Helper Procedures for Replicated Transactions](https://mariadb.com/docs/skysql-previous-release/ref/replication-procedures/replicated-transactions/).

## Requirements
1. **For MySQL**:
1. **For MySQL** :
- Replication must be configured using the binary log file and position (GTID is not supported).
2. **For MariaDB**:

2. **For MariaDB**:
- GTID-based replication can be used instead of binary log for complex replication setups.

Ensure that the external primary server is compatible with the version of MariaDB used in SkySQL.

## Step 1: Obtain the Log File and Position

### MySQL:
### MySQL:
If using MySQL, obtain the binary log file and position from which to start replication. This can be retrieved from a logical dump or `xtrabackup_binlog_info` file.
If the source database is idle, use the `SHOW MASTER STATUS` statement to get the current binary log file and position:

```sql
SHOW MASTER STATUS;
```

### MariaDB:
### MariaDB:
For MariaDB, replication can be done using GTID. Obtain the GTID position using the `@@current_gtid_pos` variable:

```sql
Expand Down Expand Up @@ -51,7 +51,6 @@ GRANT REPLICATION SLAVE ON *.* TO 'skysql_replication'@'%' IDENTIFIED BY '<passw

For MariaDB (GTID Based) if preferred refer to [sky.change_external_primary_gtid()](https://mariadb.com/docs/skysql-previous-release/ref/replication-procedures/replicated-transactions/#change_external_primary_gtid)


## Step 3: Start Replication

Once the configuration is complete, start replication on the SkySQL service using the following command:
Expand Down

0 comments on commit 7237bf3

Please sign in to comment.