Skip to main content

Restore "blank" DB

Date: 2020-09-03

Procedure to restore previous executions

​Create a procedure to restore all the old (previous) data and the ability of AIQ to handle.

    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 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;

    3. Restore the database of previous executions to point of failure, performing as below.
    $ mysql -u root -p aiq < <path>\aiqbq.sql

    4. Execute as root the attached sql script renameWindows.sql, it'll perform the following.


    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: July 03, 2023

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