---
title: Existing Projects
seoTitle: "How to add Solana into an existing app or project"
description:
  "How to add an existing project to Solana project scaffold using the
  'create-solana-program' tool."
keywords:
  - solana program development
  - create solana program
  - solana anchor development
  - program scaffold
  - anchor framework
  - solana workspace set up
h1: Update an Existing Project
---

> This is a beta version of the [Solana Toolkit](/docs/toolkit/), and is
> still a WIP. Please post all feedback as a GitHub issue
> [here](https://github.com/solana-foundation/developer-content/issues/new?title=%5Btoolkit%5D%20).

If you have an existing Anchor program and want to use the
[`create-solana-program`](https://github.com/solana-program/create-solana-program)
tool, you can easily replace the generated program with your existing one:

<Steps>
<Step>


### Verify correct versions

Ensure the installed Solana and Anchor versions are the same as the ones your
existing program requires.

</Step>
<Step>

### Run create-solana-program

Scaffold a new Solana program using Anchor by running:

```shell
npx create-solana-program --anchor
```

</Step>
<Step>

### Migrate your program source code

Replace the `program` folder with your existing program directory (not the
workspace directory). If you have more than one program, add more folders to the
root directory and update the `members` attribute of the top-level `Cargo.toml`
accordingly.

</Step>
<Step>

### Update each program's Cargo.toml

Ensure your program’s `Cargo.toml` contains the following metadata:

```toml title="Cargo.toml"
[package.metadata.solana]
program-id = "YOUR_PROGRAM_ADDRESS"
program-dependencies = []
```

</Step>
<Step>

### Build your program and clients

Run the following commands to build your programs and generate the clients:

```shell
npm install
npm run programs:build
npm run generate
```

</Step>
<Step>

### Update the ID alias

If you have a generated Rust client, update the `clients/rust/src/lib.rs` file
so the `ID` alias points to the correct generated constant.

</Step>
<Step>

### Update any client tests

If you have any generated clients, update the scaffolded tests so they work with
your existing program.


</Step>
</Steps>
