Unless you need to migrate your own Celo L1 data, we recommend using a snapshot instead.
You can find the latest snapshot in the Network Config & Assets section.
full
sync.
Alternative options:
- Fresh L2 node: Skip to the node operator guide for
snap
sync from scratch - Pre-migrated data: Download migrated datadirs from Network Config & Assets
TerminologyThe terms L1 and pre-hardfork are used interchangeably to reference Celo before the L2 transition. L1 does not refer to Ethereum in this document.
Migration Overview
Migrating a pre-hardfork datadir involves these high-level steps:- Upgrade your L1 node to the latest client release so it will stop producing blocks at the hardfork.
- 1-2 days before the hardfork, stop your node and run a pre-migration to migrate the majority of data. This is not required, but is highly recommended for minimizing downtime. See Preparing for the L2 migration.
- Restart your node and wait for the hardfork.
- Shut down your node once the hardfork block number is reached.
- Run the migration tool to migrate your L1 datadir and produce the hardfork block.
- Launch your L2 node with the migrated datadir.
Important Notes
- The migration tool can be run multiple times as the L1 chain data grows and will continue migrating from where it last left off.
- While the pre-migration can be run multiple times and will get faster each time, you should avoid running the full migration more than once as it will be slower the second time.
- All migrations writing to a given destination datadir must use the same nodeβs source datadir. That is, you should not run the pre-migration with a db snapshot from node A and then run the full migration with a db snapshot from node B.
- Your node must be stopped before the migration tool is run, even once it has reached the hardfork.
- You should not attempt to migrate archive node data, only full node data.
Preparation Steps
1. Upgrade L1 Nodes
All node operators must upgrade their L1 (celo-blockchain
) nodes to the required version before the hardfork. This release defines migration block numbers so nodes will stop producing blocks at the right time.
2. Run a Pre-Migration (Recommended)
Archive Node LimitationBoth pre-migration and full migration require full node data only. If you only have archive nodes, sync a full node before the hardfork. You cannot migrate archive data, even for L2 archive nodes. See Running an archive node for details.
Using Docker (Recommended)
- Stop your L1 node
-
Clone the migration repository:
-
Run the pre-migration where
<network>
isalfajores
,baklava
, ormainnet
:If a destination datadir is specified, ensure thatDATADIR_PATH
inside.env
is updated to match when you start your node. - Restart your L1 node and wait for the hardfork
Using Source Code
- Stop your L1 node
-
Build the migration tool:
-
Run the pre-migration:
- Restart your L1 node and wait for the hardfork
Key Information
Alfajores testnet
- Block number:
26384000
- Date: September 26, 2024
- Minimum
celo-blockchain
version: v1.8.7 op-geth
: celo-v2.0.0-rc4op-node
: celo-v2.0.0-rc4
Baklava testnet
- Block number:
28308600
- Date: February 20, 2025
- Minimum
celo-blockchain
version: v1.8.8 op-geth
: celo-v2.0.0-rc4op-node
: celo-v2.0.0-rc4
Mainnet
- Block number:
31056500
- Date: March 26, 2025 (3:00 AM UTC)
- Minimum
celo-blockchain
version: v1.8.9 op-geth
: celo-v2.0.0op-node
: celo-v2.0.0
Full Migration Process
When the hardfork block number is reached, complete the migration using either Docker (recommended) or source code.Hardware Requirements
- Make sure you have enough storage to accomodate 2x the pre-hardfork chaindata. Chaindata size can vary, so please double check your node.
- We recommend using local storage for the source and destination datadirs.
- 16GB+ RAM recommended
Run Migration with Docker
Once the hardfork block is reached, run the full migration using the same repository:- Stop your L1 node when the hardfork block number is reached
-
If you havenβt already, clone the migration repository:
-
Run the full migration where
<network>
isalfajores
,baklava
, ormainnet
:If a destination datadir is specified, ensure thatDATADIR_PATH
inside.env
is updated to match when you start your node.
Run Migration from Source
If you prefer not to use Docker, run the migration directly from source:- Stop your L1 node when the hardfork block number is reached
-
If you havenβt already, build the migration tool:
- Run the full migration:
finality_checkpoints
. We are using https://ethereum-beacon-api.publicnode.com in celo-l2-node-docker-compose.You can check support for historical finality_checkpoints
by retrieving some suitably old finality_checkpoints, for example slot 5000000.Troubleshooting
If you encounter difficulties during the migration that are not covered below, please reach out to our team. You can also check thecelo-l2-node-docker-compose
README and the celo-migrate
README for more information on how the migration tooling works.
Database Error (EOF)
If you encounter this error during migration:Missing Data / DB Continuity Check Failures
Both thepre
and full
migration commands will first run a script to check whether the source db provided has any gaps in data. This check may fail with an error indicating that data is missing from your source db.
To resolve this:
- Try re-running the migration with a different source datadir if available.
- We will post a full pre-hardfork database snapshot in the Network config & Assets section shortly after the hardfork, but we recommend having your own backup datadir available as well.
- Ensure the datadir is fully synced to just before the hardfork block.
check-db
script on its own as follows.
-
Check out and build the latest version of the script in celo optimism monorepo.
-
Run the script
This command takes in an optional
--fail-fast
flag that will make it exit at the first gap detected like it does when run via celo-l2-node-docker-compose. If the--fail-fast
flag is not provided then the script will collect all the gaps it finds and print them out at the end.