# Upgrading derivative canisters

**URL:** <https://forum.dfinity.org/t/upgrading-derivative-canisters/5189>\
**Category:** Command Line Tools\
**Created:** [June 14, 2021, 10:00pm UTC](https://forum.dfinity.org/t/upgrading-derivative-canisters/5189 "2021-06-14T22:00:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![skilesare](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/skilesare/32/5609_2.png) [@skilesare](https://forum.dfinity.org/u/skilesare)\
**Post date:** [June 14, 2021, 10:00pm UTC](https://forum.dfinity.org/t/upgrading-derivative-canisters/5189/1 "2021-06-14T22:00:45Z")

</div>

If my canister spawns a new canister by instantiating an actor class, how do I upgrade that derivative canister? It won’t necessarily be in my dfx configs. It will be out there on the network somewhere and I guess I can catalog the canister ID in my original canister. If I end up with a bunch of these and need to upgrade the actor class of that canister, how do I do that? Am I going to have to pull the list and do some command-line scripting where I have to update my .json files?

---

<div class="post-metadata">

**Author:** ![apotheosis](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/apotheosis/32/24516_2.png) [@apotheosis](https://forum.dfinity.org/u/apotheosis)\
**Post date:** [July 1, 2021, 2:46am UTC](https://forum.dfinity.org/t/upgrading-derivative-canisters/5189/2 "2021-07-01T02:46:20Z")

</div>

I am interested in the same problem. How are you spawning derivative canisters now?

---

<div class="post-metadata">

**Author:** ![y-ang2010](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/y-ang2010/32/1014_2.png) [@y-ang2010](https://forum.dfinity.org/u/y-ang2010)\
**Post date:** [July 20, 2021, 1:31am UTC](https://forum.dfinity.org/t/upgrading-derivative-canisters/5189/3 "2021-07-20T01:31:37Z")

</div>

I interested too.  
Do you solve it ?

---

<div class="post-metadata">

**Author:** ![honopu](https://avatars.discourse-cdn.com/v4/letter/h/ecccb3/32.png) [@honopu](https://forum.dfinity.org/u/honopu)\
**Post date:** [September 22, 2021, 2:59pm UTC](https://forum.dfinity.org/t/upgrading-derivative-canisters/5189/4 "2021-09-22T14:59:40Z")

</div>

Is there some answers?

---

<div class="post-metadata">

**Author:** ![skilesare](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/skilesare/32/5609_2.png) [@skilesare](https://forum.dfinity.org/u/skilesare)\
**Post date:** [September 22, 2021, 6:50pm UTC](https://forum.dfinity.org/t/upgrading-derivative-canisters/5189/5 "2021-09-22T18:50:15Z")

</div>

My understanding is that you have to do it with the management canister. You literally have to push the wasm to the canister via dfx or some other method. I think dfx has a 1MB limit on the command line. I saw some chatter on the discord about it and I’m fairly sure someone is working of solving the problem a bit more elegantly.

---

<div class="post-metadata">

**Author:** ![gohan](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/gohan/32/4626_2.png) [@gohan](https://forum.dfinity.org/u/gohan)\
**Post date:** [January 22, 2022, 1:14am UTC](https://forum.dfinity.org/t/upgrading-derivative-canisters/5189/7 "2022-01-22T01:14:11Z")

</div>

> **[Internet Computer | Documentation](https://smartcontracts.org/docs/interface-spec/index.html#ic-management-canister)**
>
> Documentation for the internet computer.

`install_code : (record { mode : variant {install; reinstall; upgrade};`

---

<div class="post-metadata">

**Author:** ![paulyoung](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/paulyoung/32/5251_2.png) [@paulyoung](https://forum.dfinity.org/u/paulyoung)\
**Post date:** [January 22, 2022, 3:29am UTC](https://forum.dfinity.org/t/upgrading-derivative-canisters/5189/8 "2022-01-22T03:29:00Z")

</div>

> [@OpenChat: A Truly Decentralized Alternative to WhatsApp](https://forum.dfinity.org/t/openchat-a-truly-decentralized-alternative-to-whatsapp/4823/6):
>
> Hey! I’m one of the OpenChat devs (there are 3 of us). Each time a new user registers an account, an update command is sent to our ‘user\_index’ canister. That canister creates the user a new canister, installs the latest version of the user canister wasm, and initialises it, passing in the new user’s principal in the init args. To upgrade the user canisters, we push the new canister wasm to the user\_index canister, which then upgrades each of the user canisters using ‘heartbeat’. We also hav…

> [@OpenChat: A Truly Decentralized Alternative to WhatsApp](https://forum.dfinity.org/t/openchat-a-truly-decentralized-alternative-to-whatsapp/4823/9):
>
> We pull 5 canisters from the queue and upgrade them on each heartbeat. As we grow we will potentially have 10s or even 100s of thousands of canisters, so we can’t kick them all off at the same time as that would cause the system to become overloaded and unresponsive, so instead we opted for gradual rolling upgrades. @alexeychirkov yes exactly, we call the ‘upgrade\_user\_canister\_wasm’ method on our user\_index canister. This canister then holds that new wasm in a normal Rust struct. But if the u…
