# Migrate Contract

If you want to easily compile, test, and deploy your code to different environments (locally, testnet, mainnet), then you've come to the right place.

You can also use Truffle to migrate `npx truffle migrate`.

First we'll create a contract deployment JSON file with the following command:

```bash
# zeus create contract-deployment tokenpeg tokenpegacct kylin
zeus create contract-deployment <CONTRACT_FILE_NAME> <CONTRACT_ACCOUNT_NAME> <CHAIN_NAME>
```

To set code on the kylin testnet or any EOSIO network run the following

{% tabs %}
{% tab title="Migrate" %}

```bash
# zeus migrate tokenpeg --network=kylin --creator=tokenpegacct --creator-key ... --no-reset
zeus migrate [CONTRACT] --network=kylin --creator=[ACCOUNT_NAME] --creator-key [ACTIVE_PRIVATE_KEY_ACCOUNT_NAME]
```

{% endtab %}

{% tab title="Options" %}

```bash
zeus migrate [contract]

run migration scripts

Options:
  --version                 Show version number                        [boolean]
  --storage-path            path for persistent storage
                                                 [default: "/home/ubuntu/.zeus"]
  --rc-file                 use rc file to load options from
                                     [default: "/home/ubuntu/.zeus/zeusrc.json"]
  --rc-ignore               ignore rc file                      [default: false]
  --verbose, -v                                                 [default: false]
  -h, --help                Show help                                  [boolean]
  --compile-all             compile all contracts                [default: true]
  --wallet                  keosd wallet to use                [default: "zeus"]
  --creator-key             private key to set contract to
                [default: "5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"]
  --creator                 eos account to set contract to    [default: "eosio"]
  --reset                   reset local environment              [default: true]
  --chain                   chain to work on                    [default: "eos"]
  --network                 network to work on          [default: "development"]
  --services                service APIs to run                    [default: ""]
  --sidechain               sidechain name to use for liquidx      [default: ""]
  --transfer                account staking amount             [default: "1000"]
  --custom-token            custom chain token                     [default: ""]
  --custom-token-precision  custom chain token permission           [default: 4]
  --evm-host                custom evm host                        [default: ""]
  --evm-port                custom evm port                         [default: 4]
  --evm-sister-host         custom evm sister host                 [default: ""]
  --evm-sister-port         custom evm sister port                  [default: 4]
  --stake                   account staking amount              [default: "300"]

Examples:
  zeus migrate [contract] --no-compile-all --no-reset
```

{% endtab %}

{% tab title="Truffle" %}

```
npx truffle migrate
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Before migrating, you can also [import the keys](/liquidapps-documentation/working-with-zeus-sdk/zeus-basics/import-export-keys.md) and not need to pass the creator key
{% endhint %}

You can also run combinations like:

```bash
# specify key for deployment
zeus migrate cronconsumer --creator natdeveloper --creator-key 5JxD6PbUpUSQQhunwGDK9ajWFZQ17h4Qa4271SzMdhivhwunQ4x --network=kylin          
# all kylin cronconsumer contract deployments on jungle3
zeus migrate cronconsumer --network=jungle3
# all migrations
zeus migrate
# all migrations on kylin
zeus migrate --network=kylin
# all migrations for creator natdeveloper on development
zeus migrate --creator natdeveloper --network=development
# do not compile and do not reset environment
zeus migrate --no-compile-all --no-reset
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.liquidapps.io/liquidapps-documentation/working-with-zeus-sdk/zeus-basics/migrate.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
