Skip to main content

Restore a Blank AIQ Database Safely

Date:Last 2020-09-03reviewed: September 22, 2026

ProcedureUse this page only when an environment owner has approved restoring a blank AIQ database for a non-production or reset workflow.

  • Treat database restore as destructive; confirm target environment and backup status first.
  • Use current database backup/restore procedures for the AIQ version.
  • Validate AIQ services after the restore before handing the environment back.

Validation workflow

  1. Confirm written approval, target host, database name, and downtime window.
  2. Back up the current database and configuration before making changes.
  3. Stop affected AIQ services according to restorethe previous executions

    ​Create a procedure to restore allrunbook.

  4. Restore the old (previous) data and the ability of AIQ to handle.
    1. Create a backup for current and active aiq (need to be performed having aiq offline) as below.

    ​$ mysqldump -u root -p aiq > <path>\currentaiq.sql

    2. Drop aiq schema and creation of a new aiqapproved blank schema,database this needs to be addressedartifact using MysqlWorkbench and connected as root.

    drop schema aiq;

    create schema if not exists `aiq` default character set utf8 collate

    utf8_general_ci;

    3. Restore the database ofowner’s previousprocedure.

    Restart executionsAIQ toservices pointand ofvalidate failure,sign-in, performingprojects, asscenarios, below.
    $and mysql -u root -p aiq < <path>\aiqbq.sql
    integrations.

    4.Note: ExecuteDo asnot rootrun a blank restore on production unless explicitly approved through the attachedproduction sqlchange script renameWindows.sql, it'll perform the following.process.


    a. create the aiq_old schema

    b. grant permissions to aiq user for aiq_old schema

    b. rename aiq's tables to aiq_old schema

    c. create views, functions, stored procedures for aiq_old schema

    5. Drop aiq schema and creation of a new aiq blank schema, this needs to be addressed using MysqlWorkbench and connected as root.

    drop schema aiq;

    create schema if not exists `aiq` default character set utf8 collate

    utf8_general_ci;

    6. Restore current aiq schema again using the backup created in the first step.
    $ mysql -u root -p aiq < <path>\currentaiq.sql


    Last updated: JulySeptember 03,22, 20232026

    If you have any feedback on this topic, please contact us at documentation@appvance.ai.