Skip to main content

Questions tagged [migration]

Related to runtime upgrades, a one time conversion of chain state.

Filter by
Sorted by
Tagged with
8 votes
2 answers
358 views

How to perform a large migration?

If I want to migrate the Balance::Locks to a new structure. Imagine there are millions of accounts in the storage. This is what I came out. Is this the right way? Split them into multiple blocks. If ...
AurevoirXavier's user avatar
  • 10.5k
4 votes
1 answer
341 views

Testing a migration with `try-runtime`

I have written a migration for the phragmen pallet in Substrate and now I want to test it. I would want to use the current state of Kusama/Polkadot to make sure the migration works correctly. To ...
Szegoo's user avatar
  • 657
4 votes
2 answers
223 views

How do I do a multi-block migration?

I noticed that my migration is too big and will take up more than one block. How do I do a multi-block migration?
Bruno's user avatar
  • 8,365
2 votes
1 answer
108 views

How to selectively populate state from a snapshot of one chain onto another?

Goal To use a full snapshot at some block height of one chain and selectively pull in select parts of this state. Use cases Migrating state from another chain. Example: A snapshot of only assets ...
Nuke's user avatar
  • 1,842
2 votes
1 answer
84 views

How can we restart the chain if it becomes stuck during data migration?

I performed a runtime upgrade on the chain, but due to a migration failure, the chain stopped producing blocks. The logs only show that the migration failed. When I attempt to restart the validators, ...
Pankaj's user avatar
  • 2,021
5 votes
1 answer
175 views

Migrate keytype of StorageMap without breakin API

Assume we have a StorageMap MyMap of which we want to extend the type of the decoded keys from KeyTypeOld to an enum including the old type as well as a new one. Before pub type MyMap = StorageMap<...
William Freudenberger's user avatar
5 votes
1 answer
259 views

Removal of storage prefix from database

I am currently writing a migration to remove a pallet and all its memory from our runtime. Unfortunately, I cannot manage to check for the existence of the pallet's prefix in the pre- and post upgrade ...
William Freudenberger's user avatar
3 votes
1 answer
182 views

How to migrate from Kusama to Polkadot?

I want to migrate my production parachain from Kusama or Polkadot. How can I achieve this?
sea212's user avatar
  • 539
2 votes
1 answer
73 views

Are pallet migrations triggered automatically by default or we need to pass each pallets migration explicitly in Executive Type?

Recently did a runtime upgrade on our node which broke all existing ink contracts. Later included the pallet contracts migration in Executive Type which fixed the issue. My impression was all runtime ...
lordofdalords's user avatar
2 votes
1 answer
66 views

Reclaim used space of a removed StorageItem on a live chain

I am changing the collator_selection pallet by removing the LastAuthoredBlock StorageItem and adding an unrelated one, so although the chain is live, no data migration is needed. What happens with the ...
Garandor's user avatar
  • 121
2 votes
1 answer
124 views

Forked Parity pallet, didn't migrate storage, deployed to chain. How to clear original storage from the live chain?

We started a chain using pallet_collator_selection and later forked it. Both the original and the forked pallet use the LastAuthoredBlock StorageItem. We did not execute a storage migration from the ...
Garandor's user avatar
  • 121