diff --git a/RELEASE_PROCESS.md b/RELEASE_PROCESS.md index da883e391111..3b0da040a0db 100644 --- a/RELEASE_PROCESS.md +++ b/RELEASE_PROCESS.md @@ -120,7 +120,7 @@ ways in stable releases and `main` branch. ### Migrations -To smoothen the update to the latest stable release, the SDK includes a set of CLI commands for managing migrations between SDK versions, under the `migrate` subcommand. Only migration scripts between stable releases are included. For the current major release, and later, migrations are supported. +See the SDK's policy on migrations [here](https://docs.cosmos.network/main/migrations/intro). ### What qualifies as a Stable Release Update (SRU) diff --git a/UPGRADING.md b/UPGRADING.md index e29a8b2c8cfe..c9c245d5f2eb 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -66,16 +66,16 @@ This is no longer the case, the assertion has been loosened to only require modu The following modules `NewKeeper` function now take a `KVStoreService` instead of a `StoreKey`: -- `x/auth` -- `x/consensus` +* `x/auth` +* `x/consensus` When not using depinject, the `runtime.NewKVStoreService` method can be used to create a `KVStoreService` from a `StoreKey`: ```diff -- app.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper(appCodec, keys[consensusparamtypes.StoreKey], authtypes.NewModuleAddress(govtypes.ModuleName).String()) -+ app.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper( +app.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper( appCodec, - runtime.NewKVStoreService(keys[consensusparamtypes.StoreKey]), +- keys[consensusparamtypes.StoreKey] ++ runtime.NewKVStoreService(keys[consensusparamtypes.StoreKey]), authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) ``` diff --git a/docs/.gitignore b/docs/.gitignore index fc7eb7e9ba84..1aca9b4b7a3a 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -19,6 +19,7 @@ docs/docs/tooling/02-depinject.md docs/docs/tooling/03-confix.md docs/docs/tooling/04-hubl.md docs/run-node/04-rosetta.md +docs/migrations/02-upgrading.md # Misc .DS_Store diff --git a/docs/docs/migrations/01-pre-upgrade.md b/docs/docs/building-apps/03-app-upgrade.md similarity index 83% rename from docs/docs/migrations/01-pre-upgrade.md rename to docs/docs/building-apps/03-app-upgrade.md index 5b0c241ee2e3..d60e781177bc 100644 --- a/docs/docs/migrations/01-pre-upgrade.md +++ b/docs/docs/building-apps/03-app-upgrade.md @@ -2,7 +2,17 @@ sidebar_position: 1 --- -# Pre-Upgrade Handling +# Application upgrade + +:::note +This document describes how to upgrade your application. If you are looking specifically for the changes to perform between SDK versions, see the [SDK migrations documentation](https://docs.cosmos.network/main/migrations/intro). +::: + +:::warning +This section is currently incomplete. Track the progress of this document [here](https://github.com/cosmos/cosmos-sdk/issues/11504). +::: + +## Pre-Upgrade Handling Cosmovisor supports custom pre-upgrade handling. Use pre-upgrade handling when you need to implement application config changes that are required in the newer version before you perform the upgrade. diff --git a/docs/docs/migrations/00-intro.md b/docs/docs/migrations/00-intro.md deleted file mode 100644 index 1d363ff41112..000000000000 --- a/docs/docs/migrations/00-intro.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -sidebar_position: 1 ---- - -# Introduction to Migrations - -This document contains all the migration guides to update your app and modules to the current Cosmos SDK. - -1. Chain Upgrade Guide to v0.47: - * See [UPGRADING.md](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/UPGRADING.md) for breaking changes and deprecations upgrade instructions. - * See [Release Notes](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/RELEASE_NOTES.md) and [changelog](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/CHANGELOG.md) for the exhaustive list of API and State Machine breaking changes. diff --git a/docs/docs/migrations/01-intro.md b/docs/docs/migrations/01-intro.md new file mode 100644 index 000000000000..b27b294ea297 --- /dev/null +++ b/docs/docs/migrations/01-intro.md @@ -0,0 +1,15 @@ +--- +sidebar_position: 1 +--- + +# SDK Migrations + +To smoothen the update to the latest stable release, the SDK includes a CLI command for hard-fork migrations (under the ` genesis migrate` subcommand). +Additionally, the SDK includes in-place migrations for its core modules. These in-place migrations are useful to migrate between major releases. + +* Hard-fork migrations are supported from the last major release to the current one. +* In-place module migrations are supported from the last two major releases to the current one. + +Migration from a version older than the last two major releases is not supported. + +When migrating from a previous version, refer to the [`UPGRADING.md`](./02-upgrading.md) and the `CHANGELOG.md` of the version you are migrating to. diff --git a/docs/docs/migrations/_category_.json b/docs/docs/migrations/_category_.json index 5d4562bb6974..add3887b861b 100644 --- a/docs/docs/migrations/_category_.json +++ b/docs/docs/migrations/_category_.json @@ -1,5 +1,5 @@ { - "label": "Migrations", + "label": "SDK Migrations", "position": 6, "link": null } \ No newline at end of file diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index e26cd1d67b76..9c513446e5a5 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -389,6 +389,10 @@ const config = { from: ["/main/run-node/cosmovisor"], to: "/main/tooling/cosmovisor", }, + { + from: ["/main/migrations/pre-upgrade"], + to: "/main/building-apps/migrations", + }, ], }, ], diff --git a/docs/post.sh b/docs/post.sh index fef3afc4719b..4f2d6e07313c 100755 --- a/docs/post.sh +++ b/docs/post.sh @@ -9,4 +9,5 @@ rm -rf docs/run-node/04-rosetta.md rm -rf docs/architecture rm -rf docs/spec rm -rf docs/rfc +rm -rf docs/migrations/02-upgrading.md rm -rf versioned_docs versioned_sidebars versions.json \ No newline at end of file diff --git a/docs/pre.sh b/docs/pre.sh index 921a678f1d6f..2b9d35c87f18 100755 --- a/docs/pre.sh +++ b/docs/pre.sh @@ -33,4 +33,7 @@ cp -r ./architecture ./docs cp -r ./spec ./docs ## Add rfc documentation -cp -r ./rfc ./docs \ No newline at end of file +cp -r ./rfc ./docs + +## Add SDK migration documentation +cp -r ../UPGRADING.md ./docs/migrations/02-upgrading.md \ No newline at end of file