Kiwi-tcms v8.0 database migration problem with test runs

大兔子大兔子 提交于 2020-07-10 08:56:51

问题


I just migrated Kiwi tcms from v7.1 on a server A to v8.0 on a server B (I virtualized our application server).

I use a pgsql container for the db.

For the migration I used the backup-restore method.

The db volume on server B is brand new and I created the schema using /Kiwi/manage.py migrate

Then I restored the .json. But I ran into schema problem because of the changes in v8.0 of the primary key. I just replaced in the json file the old names by the new one and the restoration passed.

The application runs fine except that I have now a problem with test runs when I go to the "search for test runs" page:

DataTables warning: table id=resultsTable - Requested unknown parameter 'run_id' for row 0, column 0. For more information about this error, please see http://datatables.net/tn/4

I am not sure if I made any mistake during the migration or if there is actually a bug in the migration process.

For info: I tried on my test container in v7.3 to migrate the database in v8.0. Everything went fine but I had the same problem at the end.

Thank you by advance for you support !

EDIT 1

I solved my problem following the advice of @Alexander Todorov and restarting from scratch the migration steps:

  1. I uploaded the image of kiwi 7.1 on my docker registry so I migrated to my server B with kiwi 7.1. Now I can focus on upgrade.

  2. I use pgsql container, so I didn't need to update mariadb container before migrating.

  3. I upgraded to kiwi 8.0 using the kiwitcms/kiwi:latest image.

I am not sure why the upgrade from the 7.3 version didn't work the first time but from the 7.1 to 8.0 everything went fine.

It is possible that I backed up from 7.1 and restored on a 7.3. Everything was fine using 7.3 at this moment but I had trouble with the migration to 8.0...

Anyway, thanks for your support !

EDIT 2

I don't know how it is possible but, I can't reproduce the exact same migration on another instance. I get the issue each time I try.

What I have now:

  • A preprod instance of kiwi working fine in v8.0

What I want:

  • A production instance in v8.0

What I tried:

  • Create a new instance in v8.0 and backup the preprod db to restore it on the prod => fails with the error I had before...

DataTables warning: table id=resultsTable - Requested unknown parameter 'run_id' for row 0, column 0. For more information about this error, please see http://datatables.net/tn/4

  • Create a new instance in v7.1 and migrate in the exact same way as I did on my preprod => fails with the same error...

I am really clueless on this :/


回答1:


I just migrated Kiwi tcms from v7.1 on a server A to v8.0 on a server B (I virtualized our application server).

That is what is causing your problems. You are trying to restore one version of DB schema + data onto another version (on the second server). In between the 2 versions there are quite a lot of DB migrations and what you are trying to do will always lead to failure.

You can use server A and upgrade in place to the latest version, then dump the data, move to server B (with the same version) and restore the data into the clean DB and decommission server A.

You may also setup server B to have the older version of Kiwi TCMS, migrate the data there and then upgrade server B to v8.0.




回答2:


No idea why it worked but I did the following, and everything seems to be fixed. My symptoms were exactly like those described here (7.3->8.0, mariaDB, pruned after 8.0, DataTables warning)

$ cd Kiwi
$ sudo docker exec -it kiwi_db bash
$ mysql -ukiwi -p -h 127.0.0.1 (pw kiwi from yml)

Then within mariaDB

use kiwi;
show tables;
describe testruns_testrun;
select * from testruns_testrun;

It was here I refreshed the page to pull out the ID value to look against when all of a sudden my test runs loaded. I did a

sudo docker-compose down && sudo docker-compose up -d

To verify the issue doesn't come back and it didn't. I'm no DBA, just poking around. I did make a new run from a plan, which worked until I navigated away, and tried searching for the test run. I did the above afterwards.



来源:https://stackoverflow.com/questions/60295040/kiwi-tcms-v8-0-database-migration-problem-with-test-runs

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!