KoBoToolbox form and data backup/restore

Hi
I am trying to gt backups of my kobo forms and data. and I want to restore it, if a need arises

I am using breifcase for this.

I have successfully pulled forms and submissions.

If I only delete submissions (data) from a from, I am able to restore data.
If I delete form, I can not restore form and submissions (data). Logs are the following

How can I correctly backup/restore my forms and data…

–Java user interface logs are the following

Preparing for upload of form definition with 0 media attachments
Uploading form definition with no media attachments
UPLOAD FAILED: Form definition upload failed. Detailed error: INTERNAL SERVER ERROR (500) while accessing: https://kc.humanitarianresponse.info/YYY/formUpload
Please verify that the URL, your user credentials and your permissions are all correct.
retrieving next chunk of instanceIds from server…
retrieving next chunk of instanceIds from server…
Preparing for upload of submission (1 of 1) with 0 media attachments
Uploading submission (1 of 1) with no media attachments
UPLOAD FAILED: Submission upload failed. Detailed error: NOT FOUND (404) while accessing: https://kc.humanitarianresponse.info/YYY/submission
Please verify that the URL, your user credentials and your permissions are all correct.
Partially successful upload…

–briefcase logs are the following:

2019-02-25 10:08:57,880 [AWT-EventQueue-0] INFO XFormParser - Creating FormDef from parsed XML finished in 8.919 ms
2019-02-25 10:09:45,777 [pool-2-thread-3] INFO o.o.briefcase.util.AggregateUtils - Parsing URL https://kc.humanitarianresponse.info/YYY/formUpload
2019-02-25 10:09:45,778 [pool-2-thread-3] INFO o.o.briefcase.util.AggregateUtils - added form_def_file: Registration_Form.xml
2019-02-25 10:09:45,835 [pool-2-thread-3] INFO o.o.briefcase.util.AggregateUtils - Attempting URI https://kc.humanitarianresponse.info/YYY/formUpload
2019-02-25 10:09:47,136 [pool-2-thread-3] ERROR o.o.briefcase.util.AggregateUtils - upload failed
org.opendatakit.briefcase.model.XmlDocumentFetchException: Form definition upload failed. Detailed error: INTERNAL SERVER ERROR (500) while accessing: https://kc.humanitarianresponse.info/YYY/formUpload
Please verify that the URL, your user credentials and your permissions are all correct.
at org.opendatakit.briefcase.util.AggregateUtils.httpRetrieveXmlDocument(AggregateUtils.java:251)
at org.opendatakit.briefcase.util.AggregateUtils.uploadFilesToServer(AggregateUtils.java:515)
at org.opendatakit.briefcase.util.ServerUploader.uploadForm(ServerUploader.java:341)
at org.opendatakit.briefcase.util.ServerUploader.uploadFormAndSubmissionFiles(ServerUploader.java:217)
at org.opendatakit.briefcase.util.TransferToServer.doAction(TransferToServer.java:49)
at org.opendatakit.briefcase.util.TransferAction$UploadTransferRunnable.run(TransferAction.java:83)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
2019-02-25 10:09:47,137 [pool-2-thread-3] INFO o.o.briefcase.util.AggregateUtils - Parsing URL https://kc.humanitarianresponse.info/YYY/submission
2019-02-25 10:09:47,139 [pool-2-thread-3] INFO o.o.briefcase.util.AggregateUtils - Parsing URL https://kc.humanitarianresponse.info/YYY/view/submissionList?formId=aHSfucutsEtgGvVwavquum&cursor=&numEntries=100
2019-02-25 10:09:47,188 [pool-2-thread-3] INFO o.o.briefcase.util.AggregateUtils - Attempting URI https://kc.humanitarianresponse.info/YYY/view/submissionList?formId=aHSfucutsEtgGvVwavquum&cursor=&numEntries=100
2019-02-25 10:09:47,322 [pool-2-thread-3] INFO o.o.briefcase.util.AggregateUtils - added xml_submission_file: submission.xml
2019-02-25 10:09:47,380 [pool-2-thread-3] INFO o.o.briefcase.util.AggregateUtils - Attempting URI https://kc.humanitarianresponse.info/YYY/submission
2019-02-25 10:09:47,513 [pool-2-thread-3] ERROR o.o.briefcase.util.AggregateUtils - upload failed
org.opendatakit.briefcase.model.XmlDocumentFetchException: Submission upload failed. Detailed error: NOT FOUND (404) while accessing: https://kc.humanitarianresponse.info/YYY/submission
Please verify that the URL, your user credentials and your permissions are all correct.
at org.opendatakit.briefcase.util.AggregateUtils.httpRetrieveXmlDocument(AggregateUtils.java:251)
at org.opendatakit.briefcase.util.AggregateUtils.uploadFilesToServer(AggregateUtils.java:515)
at org.opendatakit.briefcase.util.ServerUploader.uploadSubmission(ServerUploader.java:408)
at org.opendatakit.briefcase.util.ServerUploader.uploadFormAndSubmissionFiles(ServerUploader.java:245)
at org.opendatakit.briefcase.util.TransferToServer.doAction(TransferToServer.java:49)
at org.opendatakit.briefcase.util.TransferAction$UploadTransferRunnable.run(TransferAction.java:83)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Hi
I have found a cumbersome workaround for this. If you have any other idea please help

workaround:

  1. rename old form’s directory in briefcase with _old suffix
  2. upload same form as xlsform
  3. add an entry
  4. pull form
  5. here in the forms/FORM_NAME/instances, you will see an XML file (submission) and inside it, you will see id field. lets say NEW_ID. This is the form’s id I think.
  6. copy/paste all instances in the _old suffix directory to new forms directory
  7. rename all XML id field with the NEW_ID.
  8. now push data

I have a problem here too

when I want to edit submission, it says

  • Error trying to parse XML record. Different root nodes

any help…

I have even tried briefcase CLI. but still I get Internal server error.

Please help me to solve…

java -jar ODK-Briefcase-v1.14.0.jar --push_aggregate --form_id a3yMSypF7fiXqtEMeo3hhP --storage_directory briefcase --aggregate_url https://kc.humanitarianresponse.info/YYY --odk_username YYY --odk_password XXX
Preparing for upload of form definition with 2 media attachments
Uploading form definition and 2 media attachments
UPLOAD FAILED: Form definition upload failed. Detailed error: INTERNAL SERVER ERROR (500) while accessing: https://kc.humanitarianresponse.info/YYY/formUpload
Please verify that the URL, your user credentials and your permissions are all correct.
Error: Failure pushing forms to server. FormIds: a3yMSypF7fiXqtEMeo3hhP