Upgrade

Follow these steps to upgrade your OpenAlgo application:

Option 1 : Regular Upgrade Method

Backup the Database

Navigate to your database folder and make a copy of the current database file for safekeeping.

# Example: Copy the existing DB file to a backup location
cd openalgo
cp db/openalgo.db db/openalgo_backup.db

Update the Application Code

Open your terminal and run the following command to pull the latest changes:

git pull

Update the .env files

update your .env files from .sample.env (as some of the newer updates often has new enviromentatal variables. which is vital for the openalgo to function

cp .sample.env .env

and config the apikeys and apisecret as per the openalgo broker documentation

Install Dependencies

Install or update the required Python packages by running:

Run the Migration Script

Execute the migration script to add the feed_token column to your database:

Option 2 : UV Method (Modern)

Here is a separate and clean upgrade guide for the UV method only:


1️⃣ Backup the Database

Before making any changes, backup your database:


2️⃣ Pull the Latest Application Code

Update to the latest version of OpenAlgo:


3️⃣ Update .env File

Copy the latest sample .env and edit with your API keys and secrets:

Then configure the required environment variables inside .env as per your broker and setup.


4️⃣ Install or Update Dependencies

Use uv to install/update packages:


5️⃣ Run the Migration Script

Update the database schema:


6️⃣ Run OpenAlgo Using UV

From the root OpenAlgo folder:

You should see logs like:


Post-Upgrade Checklist

  • All databases initialize correctly

  • Scheduler, Websockets, ZeroMQ services are running

  • Broker modules are visible

  • API and strategy functions work normally

Verify the Migration

After running the script, verify that the column was added successfully by:

  1. Checking the script output for success messages

  2. Logging into your OpenAlgo application and testing broker authentication

Dependencies Check (Optional)

Ensure all installed dependencies are compatible with the new version:

• Use a virtual environment to avoid conflicts:

Configure the Environment

Create a .env file from the provided .sample.env file. Update the following configurations in the .env file:

• Generate random values for APP_KEY and API_KEY_PEPPER using: • Update the following parameters:

• BROKER_API_KEY

• BROKER_API_SECRET

• REDIRECT_URL

• Verify and adjust other configurations as needed.

Sample .env template

Last updated

Was this helpful?