Restore a project backup
POST/project-backups/ {projectBackupId}/ restore/
v2
POST
backup-request-project-backup-restore-v2-experimental
Request
Responses
Usage examples
- cURL
- JavaScript SDK
- PHP SDK
$ curl \
--fail \
--location \
-X POST \
-d '{"databaseRestores":[{"databaseBackupDump":"dbdump-mysql-123456","targetDatabaseId":"f0f86186-0a5a-45b2-aa33-502777496347"}],"pathRestore":{"clearTargetPath":true,"sourcePaths":["/html/mainApp/config/","/html/assets/"],"targetRestorePath":"/html/mainApp"}}' \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
-H 'Content-Type: application/json' \
https://api.mittwald.de/v2/project-backups/string/restore
import { MittwaldAPIV2Client } from "@mittwald/api-client";
import { assertStatus } from "@mittwald/api-client-commons";
const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN);
const response = await client.backup.requestProjectBackupRestoreV2Experimental({
"projectBackupId": "string",
"data": {
"databaseRestores": [
{
"databaseBackupDump": "dbdump-mysql-123456",
"targetDatabaseId": "f0f86186-0a5a-45b2-aa33-502777496347"
}
],
"pathRestore": {
"clearTargetPath": true,
"sourcePaths": [
"/html/mainApp/config/",
"/html/assets/"
],
"targetRestorePath": "/html/mainApp"
}
}
});
assertStatus(response, 204);
use \Mittwald\ApiClient\Generated\V2\Clients\Backup\RequestProjectBackupRestoreV2Experimental\RequestProjectBackupRestoreV2ExperimentalRequest;
use \Mittwald\ApiClient\Generated\V2\Clients\Backup\RequestProjectBackupRestoreV2Experimental\RequestProjectBackupRestoreV2ExperimentalRequestBody;
$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));
// TODO: Please consult the properties and constructor signature of
// RequestProjectBackupRestoreV2ExperimentalRequestBody to learn how to construct a valid instance
$body = new RequestProjectBackupRestoreV2ExperimentalRequestBody(/* TODO: ... */);
$request = (new RequestProjectBackupRestoreV2ExperimentalRequest(
projectBackupId: "string",
body: $body
));
$response = $client->backup()->requestProjectBackupRestoreV2Experimental($request);
var_dump($response->getBody();