Backup & Restore Database via API
AnsweredHi,
There is a method in api document.
/api/backupDatabase
I think this sends a signal to system in order to take a snapshot of the database. I have two questions.
1- Is it possible to download the backup file?
2- Is it possible to send a signal to restore backup of database(In order to do that we need to know which backup should be chosen)?
-
Official comment
Hello Baris,
1. Yes.
2. Yes.
There is a pair of methods.
/ec2/dumpDatabase
/ec2/restoreDatabase
Here is a curl example how to use them:
curl -v "http://admin:password@localhost:7001/ec2/dumpDatabase?format=json" > file.db
curl -v -X POST http://admin:password@localhost:7001/ec2/restoreDatabase -H "Content-Type: application/json" -d @file.dbSo, backup file has to be passed as data parameter.
-
Thank you Andrey. I could not find these methods in the API document. Where could I find documents of these methods (and more) .
0 -
These are not documented, yet.
For now, if you can't find any API you need, you could ask in Developer forum. We'll try to resolve case by case and reveal if necessary additional methods.
0 -
Hi,
If I want to Restore Nx Witness after a clean install, do I need to configure New Server first?
If so, is it possible to configure New Server via API?0 -
Hi Daiki,
Yes, you need to configure New Server first.
Yes, it's possible to configure New Server via API.
Default credentials are admin/admin
curl -s -X POST --digest "http://admin:admin@localhost:7001/api/setupLocalSystem" -H "Content-Type: application/json" --data-binary @system_settings.json
Here is the system_settings.json
{
"password":"<new password>",
"systemName":"<your system name>"
}For more details see built in documentation on /api/setupLocalSystem and /api/systemSettings API functions.
0 -
Hi Andrey,
Thank you very much. It worked fine.
PS: The last "," in system_settings.json is unnecessary, so I deleted it.
0 -
Hi Daiki,
Thanks, I fixed the comma in my post.
0
Please sign in to leave a comment.
Comments
7 comments