msupply-foundation / open-msupply

Open mSupply represents our most recent advancement in the Logistics Management Information System (LMIS), expanding on more than two decades of development inherited from the well-established legacy of the original mSupply.
https://msupply.foundation/open-msupply/
GNU Affero General Public License v3.0
17 stars 11 forks source link

Migration Pathways between Open mSupply -> Mobile/Desktop : v2.0.0 Release Testing #3699

Closed nisha-dangol closed 5 days ago

nisha-dangol commented 2 weeks ago

Migrate from desktop to oms

Setting up some data in desktop-OG first

Extra currency-setup for desktop

Extra setup to cover msupply-foundation/open-msupply#2760

Migrate desktop-OG to oms

Extra currency migrations test

Extra tests to cover msupply-foundation/open-msupply#2760

Migrate from mobile to oms

Setting up some data in mobile-OG first

Migrate mobile to oms

roxy-dao commented 2 weeks ago

Just reiterating from meeting:

For https://github.com/msupply-foundation/open-msupply/issues/2760, the invoices have to be older than store creation date by 3 months. So would probably need some data manipulation, can you do that through record browser? Or change the time on your device (;

The rest of the tests sound good to me!

nisha-dangol commented 2 weeks ago

Just reiterating from meeting:

For msupply-foundation/open-msupply#2760, the invoices have to be older than store creation date by 3 months. So would probably need some data manipulation, can you do that through record browser? Or change the time on your device (;

The rest of the tests sound good to me!

yup, can do in v2.0.0-rc2.

nisha-dangol commented 2 weeks ago
  • [ ] Make sure the previously-set user-permissions are working fine

Just noticed that; users created from remote-desktop site after migrating to oms, now those users won't show up; which is technically correct because those users by default are Inactive on mSupply cloud and users in oms are syncing currently to Cloud Is there anything that can be done about this for smooth transition from desktop to oms or we discard this and warn people to ensure/configure the users first in mSupply Cloud before converting to oms? @roxy-dao @Chris-Petty

nisha-dangol commented 2 weeks ago

Further observations/questions:

  1. Repacks created from desktop (left in sg status), after converted to oms-store; now can't be processed at all. They do show up in history, but looks like no way to proceed. Should there be new issue to address this? or we can just leave it?
  2. Stocktake finalised in desktop, after converted to oms-store shows no items entry at all. I'm guessing this is an open issue for mSupply v7.14.XX : #https://github.com/msupply-foundation/msupply/issues/14624 , but I can be wrong as well. Good to confirm @roxy-dao and we can submit another issue if needed?
  3. I also see this issue where the old outbound-shipments when trying to process after converting to oms now does not generate corresponding Inbound at all; there's no SI record in mSupply Cloud either: Video reference PS: Also flops for the returns
roxy-dao commented 2 weeks ago
  1. Please create an issue to address this.
  2. Yeah, unfortunately have to wait until that issue is merged in OG for stocktake lines to merge again. I'll check with @JonnaQuismundo if it is still going in a patch.
  3. The 2023-12-12 shouldn't have a corresponding IS 🤔
Chris-Petty commented 2 weeks ago
  1. Yes it is going in patch, I will review today
  2. I must be misunderstanding, you mostly emphasise that the new SI exists for the old CI that you recently finalised, which is expected? Which SI is missing?

I see how you're doing the migration and that is very unconventional and definitely not how migration will be done in production so I'm worried about validity of tests there. You should wipe the datafile on OMS and reinitialise generally, though that is a bit of a chore 😕.

nisha-dangol commented 2 weeks ago
  1. I must be misunderstanding, you mostly emphasise that the new SI exists for the old CI that you recently finalised, which is expected? Which SI is missing?

@Chris-Petty here's the breakdown of the steps for Scenario 3:

  • create a store on 2022-12-12
  • create a CI (of ‘nw’ status, and note it has to be a stock-transfer, i.e., create CI to another store) on desktop-remote-siteA on 2023-12-12 and sync completely
  • move that remote-siteA to oms v2.0 by completely clearing the hardware ID & all, then re-initialise on oms on today’s date: 2024-05-02
  • now in oms-siteA, check that previously created CI of 'nw/sg' status
  • finalise it (In oms language, change status to Shipped) and sync
  • for the receiving-storeB, the corresponding SI is not created at all - this SI is the one missing.
nisha-dangol commented 2 weeks ago
  1. Please create an issue to address this.
  2. Yeah, unfortunately have to wait until that issue is merged in OG for stocktake lines to merge again. I'll check with @JonnaQuismundo if it is still going in a patch.
  3. The 2023-12-12 shouldn't have a corresponding IS 🤔

@Chris-Petty @roxy-dao

  1. Submitted issue: msupply-foundation/msupply#14695
  2. Will wait for v7.14.XX/v7.15 and re-try again after I get that installer
  3. For now, I've submitted msupply-foundation/open-msupply#3734 with details, this can be discussed then decide to proceed or discard accordingly
nisha-dangol commented 2 weeks ago

While testing mobile-oms migrations, at one point, I ended up migrating back from oms to mobile, which I know is very unlikely to happen at all; but here's one interesting issue:

Chris-Petty commented 1 week ago
  1. I must be misunderstanding, you mostly emphasise that the new SI exists for the old CI that you recently finalised, which is expected? Which SI is missing?

@Chris-Petty here's the breakdown of the steps for Scenario 3:

* create a store on 2022-12-12

* create a CI (of ‘nw’ status, and note it has to be a stock-transfer, i.e., create CI to another store) on desktop-remote-siteA on 2023-12-12 and sync completely

* move that remote-siteA to oms v2.0 by completely clearing the hardware ID & all, then re-initialise on oms on today’s date: 2024-05-02

* now in oms-siteA, check that previously created CI of 'nw/sg' status

* finalise it (In oms language, change status to Shipped) and sync

* for the receiving-storeB, the corresponding SI is not created at all - this SI is the one missing.

Is the receiving-storeB also OMS?

For reference the OMS code that should affect this: https://github.com/msupply-foundation/open-msupply/blob/02a6af05cfe4b216f5747f972303eff68bbe6407/server/service/src/processors/transfer/shipment/create_inbound_shipment.rs#L89-L99

If storeB is on OMS it is seeing is an invoice made on 2023-12-12, and storeB was created on ????. If storeB.created_date is >2024-01-12 then it will not make the SI (and the central server won't have it either).

nisha-dangol commented 1 week ago

@Chris-Petty here's the breakdown of the steps for Scenario 3:

* create a store on 2022-12-12

* create a CI (of ‘nw’ status, and note it has to be a stock-transfer, i.e., create CI to another store) on desktop-remote-siteA on 2023-12-12 and sync completely

* move that remote-siteA to oms v2.0 by completely clearing the hardware ID & all, then re-initialise on oms on today’s date: 2024-05-02

* now in oms-siteA, check that previously created CI of 'nw/sg' status

* finalise it (In oms language, change status to Shipped) and sync

* for the receiving-storeB, the corresponding SI is not created at all - this SI is the one missing.

Is the receiving-storeB also OMS?

Yes, it is.

If storeB is on OMS it is seeing is an invoice made on 2023-12-12, and storeB was created on ????. If storeB.created_date is >2024-01-12 then it will not make the SI (and the central server won't have it either).

storeB was created way before 2024, somewhere around 2023-07-xx. FYI, I've submitted the details in another issue already regrading this: msupply-foundation/open-msupply#3734

nisha-dangol commented 5 days ago
  1. Submitted issue: Post migrations from desktop, previous 'sg' repacks now cannot be processed at all #3733
  2. Will wait for v7.14.XX/v7.15 and re-try again after I get that installer
  3. For now, I've submitted SI's are missing when their CI's were initially created in desktop, then migrated to oms and finalised later #3734 with details, this can be discussed then decide to proceed or discard accordingly

1. & 3. will be further addressed in v2.1.0 For 2. , will need to wait for mSupply v7.14.XX installer until https://github.com/msupply-foundation/msupply/pull/14649

nisha-dangol commented 3 days ago

For 2. , will need to wait for mSupply v7.14.XX installer until msupply-foundation/msupply#14649

Checked this again with mSupply v7-14-02 :

  • First on mSupply-OG remote-site, created two stocktakes: one fn and one sg with some lines and synced
  • Then converted to oms by resetting hardware ID & all
  • In oms, the fn stocktakes appear with lines properly
  • The sg stocktake has no line at all. Submitted as #3910 for further investigation/discussion