Migrate a knowledge base using export-import

Migration is the process of creating a new knowledge base from an existing knowledge base. You may do this for several reasons:

  • backup and restore process
  • CI/CD pipeline
  • move regions

Migrating a knowledge base requires exporting from an existing knowledge base, then importing into another.


Follow the below instructions to migrate your existing knowledge base to a new QnA Maker managed (Preview).


Migrate a knowledge base from QnA Maker

  1. Sign in to QnA Maker portal.

  2. Select the origin knowledge base you want to migrate.

  3. On the Settings page, select Export knowledge base to download a .tsv file that contains the content of your origin knowledge base - questions, answers, metadata, follow-up prompts, and the data source names from which they were extracted. The QnA IDs that are exported with the questions and answers may be used to update a specific QnA pair using the update API. The QnA ID for a specific QnA pair remains unchanged across multiple export operations.

  4. Select Create a knowledge base from the top menu then create an empty knowledge base. It is empty because when you create it, you are not going to add any URLs or files. Those are added during the import step, after creation.

    Configure the knowledge base. Set the new knowledge base name only. Duplicate names are supported and special characters are supported as well.

    Do not select anything from Step 4 because those values will be overwritten when you import the file.

  5. In Step 5, select Create.

  6. In this new knowledge base, open the Settings tab and select Import knowledge base. This imports the questions, answers, metadata, follow-up prompts, and retains the data source names from which they were extracted. The QnA pairs created in the new knowledge base shall have the same QnA ID as present in the exported file. This helps you create an exact replica of the knowledge base.

    Import knowledge base

  7. Test the new knowledge base using the Test panel. Learn how to test your knowledge base.

  8. Publish the knowledge base and create a chat bot. Learn how to publish your knowledge base.

Programmatically migrate a knowledge base from QnA Maker

The migration process is programmatically available using the following REST APIs:



Chat logs and alterations

Case-insensitive alterations (synonyms) are not imported automatically. Use the V4 APIs to move the alterations in the new knowledge base.

There is no way to migrate chat logs, since the new knowledge base uses Application Insights for storing chat logs.

Next steps