To update your ERPNext and Frappe Framework to the latest versions, please follow these steps carefully. Ensure you have administrative access to your server and are familiar with command-line operations.
1. Backup Your Data
Before proceeding, it's crucial to back up your current ERPNext environment to prevent data loss in case of any issues during the update.
- Database Backup: Use the following command to create a backup of your database:
mysqldump -u [username] -p [database_name] > backup_db_dump.sql
Replace [username] and [database_name] with your MySQL credentials and database name.
- Files Backup: Copy your
sites directory to a safe location:
cp -r /path/to/your/frappe-bench/sites /path/to/backup/sites_backup
2. Check and Upgrade System Dependencies
Ensure your server meets the necessary requirements for the latest versions of ERPNext and Frappe.
- Python: ERPNext v14 requires Python 3.10. Check your current version:
python3 --version
If it's below 3.10, upgrade Python:
sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.10 python3.10-dev python3.10-distutils
Set Python 3.10 as the default:
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1
- PIP: Upgrade PIP to the latest version:
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10
pip3 install --upgrade pip
- Node.js: ERPNext v14 requires Node.js v16.x. Check your current version:
node --version
If it's below v16.x, upgrade Node.js:
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt install -y nodejs
- NPM: Upgrade NPM to the latest version:
sudo npm install -g npm@latest
3. Update Bench
Ensure that Bench, the command-line tool for managing Frappe applications, is up to date:
pip3 install --upgrade frappe-bench
4. Switch to the Latest Version Branches
Navigate to your Frappe Bench directory and switch your apps to the latest version branches:
cd /path/to/your/frappe-bench
bench switch-to-branch version-14 frappe erpnext --upgrade
This command switches both Frappe and ERPNext to the version-14 branch and handles any necessary upgrades.
5. Update and Migrate Your Site
After switching branches, update your apps and migrate your site:
bench update --requirements
bench update
bench --site [your_site_name] migrate
Replace [your_site_name] with the name of your site.
6. Restart Services
Restart the necessary services to apply the updates:
sudo service supervisor restart
sudo service nginx restart
7. Verify the Update
Check the versions to confirm the update:
bench version
This command will display the current versions of Frappe and ERPNext.
8. Update Frappe HR
If you're using Frappe HR, ensure it's also updated to the latest version:
bench get-app hrms
bench --site [your_site_name] install-app hrms
Replace [your_site_name] with your actual site name.
Important Notes:
-
Customizations: If you have custom apps or modifications, ensure they are compatible with the new versions. Test the update in a staging environment before applying it to production.
-
Dependencies: ERPNext v14 introduces changes in dependencies and build systems. Review the migration guide for detailed information.
-
Testing: After updating, thoroughly test your system to ensure all functionalities are working as expected.
By following these steps, you should be able to successfully update your ERPNext and Frappe Framework to the latest versions.