Questions tagged [migration]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
45 views

move_pallet: What is correct way to verify old pallet storage is deleted

In trying to use a migration implementation for substrate which can be used to rename BagsList to VoterList, using move_pallet a post migration check is failing when testing the migration with try-...
Mokhtar Naamani's user avatar
3 votes
1 answer
66 views

How to reset a pallet

I'm planning to reset a pallet. To do this, I've developed a migration process aimed at clearing all storage associated with the MyPallet key. Additionally, I've followed up by renaming the pallet. I'...
magecnion's user avatar
  • 148
2 votes
0 answers
44 views

How to solve Failed to get runtime version issue?

I recently upgraded the chain from version 0.9.36 to 1.0.0. Following this update, when attempting to perform a runtime upgrade on the blockchain, I encountered an error that resulted in the chain no ...
Ajit's user avatar
  • 775
1 vote
1 answer
36 views

Storage Migrations on Rococo?

GM everyone, has anyone noticed storage migrations stopped running on rococo? We are on 0.9.43 and can not get migrations to run, both through the pallets or the runtime running trace logs doesn't ...
Sam Elamin's user avatar
  • 1,203
2 votes
1 answer
70 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
  • 1,896
1 vote
1 answer
68 views

Querying events from storage migration

I'm currently attempting to perform a migration process that involves querying events emitted from a specific pallet. The objective of this migration is to extract relevant data from these events and ...
magecnion's user avatar
  • 148
2 votes
1 answer
34 views

EVM solo to para migration on Genesis

I need to migrate the state of an EVM solochain (not substrate) into a Frontier-based parachain. The original chain has been running for a while with high activity, so the state is fairly big. I am ...
Bernardo Rodrigues's user avatar
3 votes
2 answers
39 views

Is it possible to bootstrap a parachain node from pre-existing solo chainstate?

Let's imagine a scenario where a team is running a substrate private network and have all their chainstate that they want to move to a parachain after acquiring a slot. My question is, when the team ...
Purple_Turtle's user avatar
4 votes
2 answers
51 views

Need to migrate u32 to Vec<T::AccountId>

I have one storagemap which stores u32 values, now i need to migrate this to Vec<T::AccountId> How to do this?
Ajit's user avatar
  • 775
3 votes
0 answers
29 views

How to migrate / backup & restore ink smart contract storage?

Is there a way to backup ink smart contract storage and later restore on another chain? Lets say we have chain with 3 validators and deployed smart contract containing certain information in its ...
Alex 's user avatar
  • 83
5 votes
2 answers
59 views

Is there a canonical resource describing when migrations are needed

My understanding is that when anything about the storage type is changed for example the encoded type stored, the keys, prefix etc then a storage migration is required. But when else? Is there a ...
gatsey's user avatar
  • 183
5 votes
1 answer
55 views

using String in ink version 4

so I am migrating my contract from version 3 to 4 my goal is to use the open brush as well but we can not use the open brush in ink version 4 because it still needs the nightly features and Ink v4 ...
Rahul navgire's user avatar
3 votes
0 answers
73 views

Steps to import a parachain running in a production environment to test environment?

I am using export-state to copy a parachain running in production environment to development with all the configuration and blocks data. I am following these steps. Can any one please review the steps,...
Syed Kamran's user avatar
2 votes
1 answer
52 views

revert a chain migration

We executed a chain migration that was not intended ( it was already executed one time and was executed again 2 times ) https://github.com/paritytech/substrate/blob/polkadot-v0.9.18/frame/system/src/...
Dubs's user avatar
  • 294
3 votes
1 answer
149 views

Encoded error while performing a storage migration

This is my first time migrating data, and I'd like to receive general guidance about what steps and command lines I need to use. I've been working with the node-template before to implement it in my ...
Didier M's user avatar
3 votes
1 answer
156 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
3 votes
1 answer
50 views

Solochain to Parachain Block Production Problem - "Discarding slot xxx, block production took too long"

The following is a current issue when migrating from a Solochain to a Parachain (presently as a test on the Rococo relay chain): On the Rococo chain, we are unable to produce new blocks - it is ...
Josh's user avatar
  • 415
4 votes
0 answers
55 views

How to migrate blockchain data from Moonbeam network to a custom Substrate-based chain?

I deployed an ERC-721(NFT) contract on Moonbeam some time ago. Now I have added the NFT pallet to our Substrate-based chain. How can I migrate the data from the Moonbeam network chain data to our ...
Pankaj's user avatar
  • 1,896
0 votes
1 answer
28 views

How to regenerate the voterlist

Since I have an issue with the voterlist in a solo chain, what would be the correct way to trigger unsafe_regenerate from the bagslist pallet instance in the staking pallet ? https://paritytech.github....
Leouarz's user avatar
  • 189
2 votes
2 answers
52 views

Number of and writes of StorageMap drain

I was wondering about the number of reads and writes when draining a StorageMap which consists of n items. Is the answer (n, 1) or (n, n)?
0x5hmoo's user avatar
  • 167
3 votes
1 answer
268 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
  • 603
3 votes
2 answers
128 views

How to write pallet rename data migration?

I want to rename one of our collective pallet instances to be visible in the PolkaddotJs App. I think the best option would be to migrate raw data. I assume that all pallet data has the same trie path ...
Dzmitry Lahoda's user avatar
2 votes
1 answer
69 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
3 votes
1 answer
117 views

Substrate `translate` function

I am trying to understand the usage of the translate function that is frequently used when writing migrations. Is this function only being used to do changes to some existing storage values(I don't ...
Szegoo's user avatar
  • 603
2 votes
0 answers
34 views

Elections phragmen migration

I am working on Substrate-based node upgrades for solo-chain. I stick to Polkadot releases and during the upgrade from polkadot-release-v0.8.27 to polkadot-v0.8.28 I found a storage migration. This ...
Maksim Ramanenkau's user avatar
7 votes
2 answers
115 views

How to identify node update storage migrations?

I am working on Substrate-based node upgrades. I stick to Polkadot releases and start from polkadot-v0.8.25 to the latest versions. While upgrading I need to make sure that I don’t miss any storage ...
Maksim Ramanenkau's user avatar
3 votes
2 answers
186 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,130
1 vote
1 answer
44 views

Split extrinsic execution across multiple blocks

Is it possible to split the execution of an extrinsic into several continuous blocks? Looking at this post, it is possible to create migrations, but I was wondering if the same can be applied to an ...
andresvsm's user avatar
  • 1,104
5 votes
0 answers
63 views

How to determine if a parachain runtime migration is too big?

I want to write runtime storage migration for our parachain. This time it will scan large storage maps with more than 10k entries. This may results in very large PoV block size. I'm wondering what the ...
h4x3rotab's user avatar
  • 717
3 votes
1 answer
74 views

Potential storage issue with try-runtime tool

Hey guys I'm seeing a weird thing with the following migration code: pub struct SomeMigration; impl OnRuntimeUpgrade for SomeMigration { fn on_runtime_upgrade() -> Weight { let ...
Georgi Zlatarev's user avatar
0 votes
2 answers
134 views

Babe PoA to NPoS migration

Here's my babe pallet configuration: I suppose that for PoA we want to keep the same authority set impl pallet_babe::Config for Runtime { type EpochDuration = EpochDuration; type ...
mr_bovo's user avatar
  • 171
2 votes
1 answer
51 views

What happens if `on_runtime_upgrade` during migration fails?

In parachain context, imagine we have declared a migration within type Executvie where we want to migrate some state from pallet A to pallet B in on_runtime_upgrade. In the new wasm the pallet A gets ...
Kailai's user avatar
  • 363
0 votes
1 answer
59 views

Is using `put_storage_value` on a storage map while iterating over the same map using `storage_iter` undefined behavior?

The IterableStorageMap API explicitly forbids altering the map while iterating: https://paritytech.github.io/substrate/master/src/frame_support/storage/mod.rs.html#270-272 The frame_support::storage::...
mkl's user avatar
  • 420
3 votes
1 answer
156 views

Export state of a running chain and run it as alice

Hello everyone, I'm trying to spin up a test chain(with imported real chain data) with alice(so I can start it from genesis and start producing blocks with --alice flag) and after dumping the state of ...
flipchan's user avatar
  • 319
3 votes
2 answers
99 views

I'm getting some issue during storage migration

I'm trying to trigger the storage migration on polkadot UI for our parachain. I'm trying different types to do this but getting some issues: Type 1 : If I simply upload the wasm file from sudo > ...
Deepak Chaudhary's user avatar
2 votes
1 answer
67 views

Does changing an enum require a storage migration? What about `Error` and `Event`

Say I have instances of this enum stored on-chain: enum Enum { V0, V1, } And suppose now that I change the enum in some way: enum Enum { V0, V2, V1, } This is what the substrate ...
mkl's user avatar
  • 420
4 votes
2 answers
119 views

How to add storage migration in parachain?

I have successfully performed storage migration on standalone chain. But how to do this for parachain ? Like, How/what wasm should be upload of new version and Where Should I upload ? Is there any ...
Deepak Chaudhary's user avatar
4 votes
1 answer
172 views

How do I fix "SpecVersionNeedsToIncrease" error?

I Just clone this https://github.com/OAK-Foundation/substrate-node-template/tree/nicks-v2 for storage migration. After launch on polkadot ,this error shows: I'm using following commands to run: ./...
Deepak Chaudhary's user avatar
3 votes
1 answer
77 views

Exported method `TryRuntime_on_runtime_upgrade` is not found

cargo run --features try-runtime try-runtime \ --execution Native \ --chain dev \ on-runtime-upgrade \ live \ --uri ws://xxxxxxxx I implemented try-runtime according to the ...
junyuan wei's user avatar
5 votes
1 answer
158 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
0 votes
2 answers
82 views

Pallet declares internal migrations (which *might* execute). On-chain `StorageVersion(0)` vs current storage version `StorageVersion(0)`

After a runtime upgrade on Frontier, these warnings are logged: In this case, the pallets are related to Frontier only, but that seems possible for any FRAME pallets. Does anything need to be done ...
afm's user avatar
  • 345
2 votes
1 answer
190 views

Migrating storage without creating a new storage item

I am using Substrate V3 (using decl_storage) and have an existing storage defined like this: pub Foo get(fn get_foo) config(): map hasher(blake2_128_concat) u32 => H160; I would like to change ...
Nahu's user avatar
  • 337
1 vote
2 answers
119 views

How do I know if I will need a storage migration along a forkless upgrade?

I have a blockchain running a version of Frontier from september 2021, and want to upgrade it to the latest commits. I'm prepared to do a forkless upgrade, but who do I know if I will need storage ...
afm's user avatar
  • 345
4 votes
1 answer
65 views

Can't read storage item from migration script, however can read from polkadot.js.app

Here are the details, I need to do a storage migration for a pallet. I can read the storage item from the polkadot.js.app, as shown below: however, I can not read it from migration script(returned ...
Wenfeng Wang's user avatar
4 votes
1 answer
231 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
102 views

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
97 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,822
6 votes
1 answer
126 views

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
284 views

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
394 views

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