Skip to main content

Questions tagged [migration]

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

Filter by
Sorted by
Tagged with
5 votes
1 answer

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

Perform large migration between substrate versions

We want to perform a large migration on a chain composed with standard pallets ( balance, babe, ... ) to a most recent substrate tag which is polkadot-v0.9.18. Is there a way to call all the ...
Dubs's user avatar
  • 294
2 votes
1 answer

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
6 votes
1 answer

Parachain large migration best practices

We need to insert a lot of data to storage. In standalone version we can do it via System.SetStorage with sudo weight override. But in parachains this approach maybe can break our chain. What are the ...
Veniamin's user avatar
2 votes
2 answers

How to export the current running chain data and import it in a new chain?

The use case is that maybe the existing chain has bricked down (not producing block anymore possibly due to no block having been produced in the past epoch), or I want to copy the current production ...
Jimmy Chu's user avatar
  • 185
5 votes
2 answers

Storage Migration Guide Using #[pallet::storage]

I am new to both substrate and rust so trying to educate myself. I've the read documentation for both and am now going through the various tutorials and guides. I'm currently on the Basic Storage ...
jpataylor's user avatar
  • 321
2 votes
1 answer

Migrating to new code base

We have a prototype of substrate-based blockchain running with few nodes. After some time running and testing we came up with new version of code-base, which consists of the same runtime, pallets and ...
Yevhen V's user avatar
8 votes
2 answers

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.6k
3 votes
1 answer

Should I do storage migration after remove fields from storage struct type?

I have a map storage, which stores structures. I've just removed a field from the structure, should I write storage migration codes for that? Could substrate work with existing values without a ...
Chino Chang's user avatar
2 votes
1 answer

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
2 votes
1 answer

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
5 votes
2 answers

Where should pallet migrations be executed?

I have seen two methods of executing runtime migrations: Execute the migration code directly in the pallet's on_runtime_upgrade hook Create a struct and implement the OnRuntimeUpgrade trait. Include ...
sea212's user avatar
  • 539