Skip to content

Transfer KoboToolbox submissions, including attachments and validation statuses, from one server to another.

Notifications You must be signed in to change notification settings

DRC-UA/kobo-migration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kobo-migration

Transfer KoboToolbox submissions, including attachments and validation statuses, from one server to another. This process assumes the form already exists on the destination server. Note that attachments will be renamed using the pattern {form_id}_{submission_id}-{question_name}-{i} to ensure they are properly recognized by Kobo.

This script uses the kobo-sdk, which abstracts the complexities of interacting with the Kobo API. Feel free to use it to create your own custom scripts.

console-ss.png

Usage

Prerequies

  • Having Node v16+ installer.
  • Having an IDEA like VSCode installed.

Instructions

1. Download the repository in your local machine and Unzip it

🔗 LINK

Alternatively, you can clone it using git if you're familiar with the process.

2. Open the project with VSCode.

3. Install project dependencies

Open VSCode terminal (menu Terminal > New Terminal) and type.

npm install

4. Update settings

Open src/index.ts and update parameters.

  • dryRun (optional): When set to true, this option simulates the migration without making any changes, allowing you to verify that everything will work as intended before applying the actual migration.
  • filters (optional):
    • submissionDateStart: Filters submissions with _submitted_at later than the specified date.
    • submissionDateEnd: Filters submissions with _submitted_at earlier than the specified date.
    • formIds: Specify form IDs to migrate. If empty, the script migrates all forms on the server.
    • offset: The starting point for pagination. Use this to resume from where the script left off if it failed.
    • take: The max number of items to retrieve.
  • source|destination (required):
    • token: Your private token, available in your account settings on the Kobo website.
    • urlv1: also named kc url.
    • urlv2: also named kf url.

ide.png

5. Run the script

From the terminal:

npm start

console-ss.png

Kobo Servers Index

Server V1 (kc) V2 (kf)
EU https://kc-eu.kobotoolbox.org https://eu.kobotoolbox.org
Global https://kc.kobotoolbox.org https://kf.kobotoolbox.org
DRC https://kc-kobo.drc.ngo https://kobo.drc.ngo/

About

Transfer KoboToolbox submissions, including attachments and validation statuses, from one server to another.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published