Skip to content

Instantly share code, notes, and snippets.

@sipatha
Last active October 20, 2020 05:15
Show Gist options
  • Save sipatha/5276256988523b024229d51b7d022927 to your computer and use it in GitHub Desktop.
Save sipatha/5276256988523b024229d51b7d022927 to your computer and use it in GitHub Desktop.
Upgrade ERPNext version 11 to version 12
# ensure all software is installed and upgraded
sudo apt-get install software-properties-common openssl build-essential libssl-dev python3-minimal python3-setuptools python3-dev python3-pip curl wget git git-core libffi-dev fonts-cantarell liblcms2-dev libldap2-dev libwebp-dev redis-server ttf-mscorefonts-installer -y --no-install-suggests --no-install-recommends
# clean software repos
sudo apt-get clean
# upgrade virtualenv package to latest version
pip install --upgrade virtualenv
# upgrade pip package to latest version
pip install --upgrade pip
pip --version
# create a new bench for version 12
bench init version-12-bench --frappe-path https://github.com/frappe/frappe --frappe-branch version-12 --python python3 --verbose
# SUCCESS: Bench version-12-bench initialized
# ensure you are in the new bench directory
cd version-12-bench
# get erpnext version 12
bench get-app erpnext https://github.com/frappe/erpnext --branch version-12 --verbose
# create a new site, the name should be the same as the one you are upgrading
bench new-site erp.vambita.com --db-name erpnext001 --admin-password 'admin123' --mariadb-root-password 'root123' --install-app erpnext --verbose
# unzip the database backup file
gzip -d 20200204_011356-erp_vambita_com-database.sql.gz
# restore the old database to the new installation. have the root password ready
bench --site erp.vambita.com --force restore ~/20200204_011356-erp_vambita_com-database.sql
# lastly, encryption. The new installation comes with its own encryption key. you need to copy the encryption key from the old bench
cat old-bench/sites/erp.vambita.com/site_config.json
# get the value for: encryption_key
vi version-12-bench/sites/erp.vambita.com/site_config.json
# replace the encryption key
# start the old version 11 ERPNext instance. make sure you are in the old bench directory. Redis should be up so that it can be updated
nohup bench start > bench-start.log 2>&1 &
# in the new bench directory, start the upgrade
cd ../version-12-bench/
bench update --pull
bench update --patch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment