Change location of ERPNext server

How to change location (Drive or Folder) of ERPNext server In Linux ?

It’s possible, but a little tricky.

After you copy 'frappe-bench' (and everything inside) to a new directory, the Python Virtual Environment 'env' will now be broken.
(this is because Virtual Environments contain files that reference the paths where they were created)

To solve this, what I’ve previously done is this:

  1. First, copy all the directories and files.
  2. Then delete the 'env' directory and all its contents.
  3. Create a new Python Virtual Environment, with the same name:
python3 -m venv env

(make sure you’re choosing the correct Python binary for your system)
4. Now begin re-installing all the Apps.

  • cd .../apps/frappe
  • pip3 install -e .
  • cd .../apps/erpnext
  • pip3 install -e .
  • …and more…

When finished, the bench start command “should” work.

Remaining Steps:

  • You should review and edit your cron jobs, so they know the new path.
  • If running in Production, you should review and edit your Supervisor configuration, updating any absolute paths.
1 Like

You can use bench setup requirements

# create new env
python3 -m venv env
# install frappe
./env/bin/pip install -e apps/frappe
# setup all apps (python) with bench command
bench setup requirements --python