# Upgrade from koa to lilac migration error

**URL:** <https://discuss.openedx.org/t/upgrade-from-koa-to-lilac-migration-error/9405>\
**Category:** Tutor Help\
**Tags:** tutor, koa, lilac\
**Created:** [February 21, 2023, 12:47pm UTC](https://discuss.openedx.org/t/upgrade-from-koa-to-lilac-migration-error/9405 "2023-02-21T12:47:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Engr\_James\_Lusuegro](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/engr_james_lusuegro/32/4908_2.png) [@Engr\_James\_Lusuegro](https://discuss.openedx.org/u/Engr_James_Lusuegro)\
**Post date:** [February 21, 2023, 12:47pm UTC](https://discuss.openedx.org/t/upgrade-from-koa-to-lilac-migration-error/9405/1 "2023-02-21T12:47:55Z")

</div>

Good day! I am upgrading my tutor koa to lilac (hopefully wanting my instance to be upgraded to nutmeg), but I’ve encountered some problem when running `tutor local quickstart`.

Using the commands:

`$ sudo su`  
`$ tutor local stop`  
`$ sudo curl -L "https://github.com/overhangio/tutor/releases/download/v12.2.0/tutor-$(uname -s)_$(uname -m)" -o /usr/local/bin/tutor`  
`$ sudo chmod 0755 /usr/local/bin/tutor`  
`$ tutor --version`  
`$ tutor config save`  
`$ tutor local upgrade --from=koa`  
`$ tutor local quickstart`

I ran through some error:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/openedx/original/2X/1/154f9b86329c7afe9b943f3a69423685cb0ef707.png)  
[Traceback.txt](https://discuss.openedx.org/uploads/short-url/6i2h6p4CjjNm47yB8LWMlNiTqgf.txt) (5.9 KB)

I don’t know why the migration is looking for some table called shoppingcart\_certificateitem when it doesn’t even exist in koa, (unless it should be created in the lilac upgrade), but then why didn’t the migration create it? Or is there a bigger picture prmblem here? Can please someone explain to me what just happened and how to fix it?

---

<div class="post-metadata">

**Author:** ![sambapete](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/sambapete/32/4100_2.png) [@sambapete](https://discuss.openedx.org/u/sambapete)\
**Post date:** [February 21, 2023, 1:39pm UTC](https://discuss.openedx.org/t/upgrade-from-koa-to-lilac-migration-error/9405/2 "2023-02-21T13:39:48Z")

</div>

First, you should not install Tutor as root.

If you are installing as root because of Docker, you should follow the instructions here or ask you system administrator to do it for you.

I am assuming you are installing on Ubuntu, but if not you should find the appropriate documentation for your operating system.

> **[Install Docker Engine on Ubuntu](https://docs.docker.com/engine/install/ubuntu/)**
>
> Jumpstart your client-side server applications with Docker Engine on Ubuntu. This guide details prerequisites and multiple methods to install.

> **[Linux post-installation steps for Docker Engine](https://docs.docker.com/engine/install/linux-postinstall/)**
>
> Find the recommended Docker Engine post-installation steps for Linux users, including how to run Docker as a non-root user and more.

It is not recommended to launch Tutor as root, we therefore need to add the ubuntu user to the docker group and restart the docker service.

```auto
sudo usermod -aG docker ubuntu
sudo service docker restart

```

We might want to reboot to make sure docker starts at reboot.

`sudo reboot`

The error “Loading settings $DJANGO\_SETTINGS\_MODULE” is an indirect result of installing Tutor as root.

---

<div class="post-metadata">

**Author:** ![Engr\_James\_Lusuegro](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/engr_james_lusuegro/32/4908_2.png) [@Engr\_James\_Lusuegro](https://discuss.openedx.org/u/Engr_James_Lusuegro)\
**Post date:** [February 22, 2023, 3:40am UTC](https://discuss.openedx.org/t/upgrade-from-koa-to-lilac-migration-error/9405/3 "2023-02-22T03:40:43Z")

</div>

Thank you for this suggestion. However, I’ve tried installing tutor from scratch and adding my ubuntu user to the docker group, but sadly, it still has the same error.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/openedx/original/2X/b/bfd2339d7a87cd71b69bfd43b52461f005aa67d2.png)

I do not see any table `shoppingcart_certificateitem` on my previous koa instance and I’m not sure if I should really see it, and I’m not quite sure as well why is it looking for it. Should I `migrate --fake` it?

---

<div class="post-metadata">

**Author:** ![regis](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/regis/32/2640_2.png) [@regis](https://discuss.openedx.org/u/regis)\
**Post date:** [February 22, 2023, 11:38am UTC](https://discuss.openedx.org/t/upgrade-from-koa-to-lilac-migration-error/9405/4 "2023-02-22T11:38:56Z")

</div>

“shoppingcart\_certificateitem” should absolutely be part of your Koa installation. I just launched a vanilla Koa platform with tutor 11.3.1, ran quickstart and that table is there.

```auto
mysql> show tables;                                                                                  
+------------------------------------------------------------------+
| Tables_in_openedx |
+------------------------------------------------------------------+
| announcements_announcement |
| api_admin_apiaccessconfig |
| api_admin_apiaccessrequest |
| assessment_assessment |
| assessment_assessmentfeedback |
| assessment_assessmentfeedback_assessments |
| assessment_assessmentfeedback_options |
...
| schedules_scheduleexperience |
| self_paced_selfpacedconfiguration |
| shoppingcart_certificateitem |
| shoppingcart_coupon |
| shoppingcart_couponredemption |
| shoppingcart_courseregcodeitem |
| shoppingcart_courseregcodeitemannotation |
...

```

If you don’t have the `shoppingcart_certificateitem` table in your MySQL database, then it might mean that you interrupted the migrations halfway. I don’t have a clear path forward for you. Your database might be in a corrupt state. You’ll probably have to fake-rollback some migrations and then re-apply them.

Good luck.

---

<div class="post-metadata">

**Author:** ![sambapete](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/sambapete/32/4100_2.png) [@sambapete](https://discuss.openedx.org/u/sambapete)\
**Post date:** [February 22, 2023, 12:35pm UTC](https://discuss.openedx.org/t/upgrade-from-koa-to-lilac-migration-error/9405/5 "2023-02-22T12:35:31Z")

</div>

In order to support @regis point, I can also confirm that the various `shoppingcart_` related tables were part of our Native Koa installation.

For the sake of completion, here are some personal notes I took when we first looked at migrating our Open edX instance from Native to Tutor for Koa. Please understand that our Open edX instance also started way back with Aspen, so there might be a lot tables creep over the various releases from Aspen to Nutmeg. So I basically compared what we had accumulated over the years and what a default Tutor installation for Koa contained.

**We also discovered a few differences between the tables under Native and Tutor when we installed Koa.3.**

**The tables with \< are in Native and the tables with \> are in Tutor pour edxapp / openedx database. This is taken from a diff of “show tables” in each environment.**

```auto
more DIFF-DB 
294d293
< | notifications_articlesubscription |
345a345,362
> | shoppingcart_certificateitem |
> | shoppingcart_coupon |
> | shoppingcart_couponredemption |
> | shoppingcart_courseregcodeitem |
> | shoppingcart_courseregcodeitemannotation |
> | shoppingcart_courseregistrationcode |
> | shoppingcart_courseregistrationcodeinvoiceitem |
> | shoppingcart_donation |
> | shoppingcart_donationconfiguration |
> | shoppingcart_invoice |
> | shoppingcart_invoicehistory |
> | shoppingcart_invoiceitem |
> | shoppingcart_invoicetransaction |
> | shoppingcart_order |
> | shoppingcart_orderitem |
> | shoppingcart_paidcourseregistration |
> | shoppingcart_paidcourseregistrationannotation |
> | shoppingcart_registrationcoderedemption |
411a429
> | thumbnail_kvstore |
451d468
< | wiki_articlesubscription |

```

**For notifications\_articlesubscription and wiki\_articlesubscription, I do not understand. They are empty in our Native environment. Should we remove them before the dump or should we edit them in the dump file before restoring the data? It doesn’t cause a problem to leave them in the database as they are unused.**

**We have not used the old shopping\_cart in years. The tables are still in our Native environment though. I don’t understand why the diff considered them missing? shoppingcart\_certificateitem is definitely not empty in our Native environment. shoppingcart\_order, shoppingcart\_orderitem, shoppingcart\_paidcourseregistration aren’t either. Old sales from old courses from before Oscar and Otto, and dating back from 2015-08-28 to 2016-06-27 according to the created field in shoppingcart\_orderitem.**

**The “shoppingcart” functionality is deprecated as of the Dogwood release, and it will be removed in a future release. Similar services are now provided by the [E-commerce Service](https://edx.readthedocs.io/projects/open-edx-release-notes/en/latest/dogwood.html?highlight=shoppingcart#otto-ecommerce-service).**

**I assume we switched to ecommerce around 2016-06-28 and before we installed Dogwood. I can’t find the exact date but it seems we migrated from Cypress to Dogwood around that time. Dogwood was released in early 2016 and that would fit with these dates. The first entries in the table order\_order in the ecommerce database are from 2016-10-14. That fits.**

**The old thumbnail\_kvstore table has caused us a lot of issues in the past. It does not seem to be in Maple anymore.**

**The migrations from Koa to Lilac to Maple may have removed some of the differences between Native and Koa since the thumbnail\_kvstore table and the shoppingcart tables are no longer in Maple under Tutor.**

**Supporting the sales from between 2015-08-28 and 2016-06-27 could be difficult.**

All that to say that the the various `shoppingcart_` related tables were really part of our Native Koa Open edX instance and were removed at some point during migrations from Koa to Lilac or from Lilac to Maple.

I am sorry @Engr_James_Lusuegro if I cannot be of more help at this point.

---

<div class="post-metadata">

**Author:** ![Engr\_James\_Lusuegro](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/engr_james_lusuegro/32/4908_2.png) [@Engr\_James\_Lusuegro](https://discuss.openedx.org/u/Engr_James_Lusuegro)\
**Post date:** [February 22, 2023, 3:11pm UTC](https://discuss.openedx.org/t/upgrade-from-koa-to-lilac-migration-error/9405/6 "2023-02-22T15:11:19Z")

</div>

Thank you for your replies. I’m not quite sure why there was an error though, but I might say that you may be right @regis . The migration before from Koa may have been interrupted.

But as stated here by @sambapete:

> [@sambapete](#):
>
> **I assume we switched to ecommerce around 2016-06-28 and before we installed Dogwood. I can’t find the exact date but it seems we migrated from Cypress to Dogwood around that time. Dogwood was released in early 2016 and that would fit with these dates. The first entries in the table order\_order in the ecommerce database are from 2016-10-14. That fits.**
> 
> **The old thumbnail\_kvstore table has caused us a lot of issues in the past. It does not seem to be in Maple anymore.**
> 
> **The migrations from Koa to Lilac to Maple may have removed some of the differences between Native and Koa since the thumbnail\_kvstore table and the shoppingcart tables are no longer in Maple under Tutor.**
> 
> **Supporting the sales from between 2015-08-28 and 2016-06-27 could be difficult.**
> 
> All that to say that the the various `shoppingcart_` related tables were really part of our Native Koa Open edX instance and were removed at some point during migrations from Koa to Lilac or from Lilac to Maple.

This indicates that the `shoppingcart_` related tables are no longer needed after the Maple release. Since our main goal is to upgrade into the Nutmeg release, would it cause any more errors if we would `migrate --fake` the `shoppingcart` app from Koa to Lilac then Lilac to Maple upgrade?

Either way, thank you for your replies.
