Upgrading from older version of OpenZeppelin Contracts and OpenZeppelin CLI?

Hi @robert.oschler,

Welcome :wave:

The most popular development tools are Truffle and Hardhat (formerly Buidler). (see: https://docs.openzeppelin.com/learn/developing-smart-contracts#setting-up-a-solidity-project)

Assuming you are already familiar with Truffle you could stick with that.

For creating upgradeable contracts we use Upgrades Plugins (rather than OpenZeppelin CLI as we halted development, see: Building for interoperability: why we’re focusing on Upgrades Plugins)

You may want to uninstall the global version of OpenZeppelin CLI. When you are doing openzeppelin --version you are getting the version of the OpenZeppelin CLI and not the version of OpenZeppelin Contracts that you have installed.

For an overview of writing upgradeable contracts with the plugins see: https://docs.openzeppelin.com/learn/upgrading-smart-contracts

There is also an OpenZeppelin Upgrades: Step by Step Tutorial for Truffle and OpenZeppelin Upgrades: Step by Step Tutorial for Hardhat.

When installing OpenZeppelin Contracts (the latest version is 3.4, see: https://blog.openzeppelin.com/openzeppelin-contracts-3-4/) there is a Solidity 0.6 and a Solidity 0.7 version, as well as upgradeable versions of both. When writing upgradeable contracts we need to use the Upgradeable version of OpenZeppelin Contracts, see: https://docs.openzeppelin.com/contracts/3.x/upgradeable


If you have an existing upgradeable project, then you can migrate from OpenZeppelin CLI to Upgrades Plugins using the following guide: https://docs.openzeppelin.com/upgrades-plugins/1.x/migrate-from-cli

Though depending on what version of OpenZeppelin Contracts you had previously used, you may not be able to upgrade versions due to changes with state variables.

If you are starting from scratch, then you can choose to use either Truffle or Hardhat and create a new project.

Feel free to ask any questions you need.