Point-in-Time Restore
Authentication
-
Go to the SkySQL API Key management page and generate an API key
-
Export the value from the token field to an environment variable $API_KEY
export API_KEY='... key data ...'
-
Use it on subsequent request, e.g:
curl --request GET 'https://api.skysql.com/skybackup/v1/backups/schedules' --header "X-API-Key: ${API_KEY}"
export API_KEY='... key data ...'
curl --request GET 'https://api.skysql.com/skybackup/v1/backups/schedules' --header "X-API-Key: ${API_KEY}"
Important Note
For Point-in-Time Restore to work, you must have a pre-configured backup schedule that ensures:
- Your backup schedule creates snapshot backups with a time gap shorter than your
expire_logs_days
database configuration setting (required for binary log availability) - Your selected restore point must be between two consecutive snapshot backups from this schedule
- By default, SkySQL sets
expire_logs_days
to 4 days, but you can configure this value to match your backup schedule requirements
Usage Examples
API Example
curl --location 'https://api.skysql.com/skybackup/v1/restores' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header "X-API-Key: ${API_KEY}" \
--data '{
"service_id": "<SERVICE_ID>",
"id":"<BACKUP_SOURCE_SERVICE_ID>",
"point_in_time":"<RESTORE_POINT_IN_TIME, UTC, FORMAT: YYYY-MM-DD HH:MM:SS>"
}'
- API_KEY : SKYSQL API KEY, see SkySQL API Keys
- SERVICE_ID : SkySQL service identifier, format dbtxxxxxx. This is your restore target service
- BACKUP_SOURCE_SERVICE_ID: SkySQL service identifier, format dbtxxxxxx. This is your backup source service id
- You can fetch the SkySQL service identifier from the Fully Qualified Domain Name (FQDN) of your service. For example: in dbpgf17106534.sysp0000.db2.skysql.com, 'dbpgf17106534' is the service ID. You will find the FQDN in the Connect window
SkySQL Portal Example
To perform a Point-in-Time Restore through the SkySQL Portal:
- Navigate to Backups→Restores
- Click the "Point-in-Time Restore" Button
- In the restore form, provide:
- Database restore target service
- Backup source service
- Selected restoration point in time
- Click the "Restore" button to start the restore process
Limitations
- Cross-cloud restore is not supported. Your restore target service must be in the same cloud provider as your backup source service.
- Only SkySQL native snapshots can be used as restore source. External backups are not supported for Point-in-Time Restore.
- Point-in-Time Restore requires MariaDB 10.8 or later, which introduced the binary log search functionality needed for this feature.
- Support for Serverless databases as Point-in-Time Restore sources is coming soon.