Skip to content

Migrating from ERPNext version 3

Anand Doshi edited this page Mar 23, 2016 · 15 revisions

Upgrade to MariaDB and install other requirements

For CentOS

Add MariaDB repository form here

service mysql stop
yum install -y MariaDB-server MariaDB-client MariaDB-compat MariaDB-devel redis
service mysql start
mysql_upgrade

For Debian, Ubuntu, and Elementary OS

sudo apt-get install redis-server

Install other requirements

For CentOS

Add IUS repository

Here $VER is 5 or 6 as per your CentOS version and $ARCH is i386 or x86_64 depending on the architecture of your CPU (i386 for 32bit and x86_64 is for 64bit)

wget http://dl.iuscommunity.org/pub/ius/stable/CentOS/$VER/$ARCH/epel-release-6-5.noarch.rpm
wget http://dl.iuscommunity.org/pub/ius/stable/CentOS/$VER/$ARCH/ius-release-1.0-11.ius.centos6.noarch.rpm
rpm -Uvh epel-release-6-5.noarch.rpm
rpm -Uvh ius-release-1.0-11.ius.centos6.noarch.rpm
yum install -y libXrender libXext redis

For Debian, Ubuntu, and Elementary OS

Add MariaDB repository form here

service mysql stop
sudo apt-get install mariadb-server mariadb-common libmariadbclient-dev
service mysql start
mysql_upgrade

Install bench

cd /home/erpnext
git clone https://github.com/frappe/bench bench-repo
sudo pip install -e bench-repo
cd bench-repo
    git fetch
git checkout tags/v0.93 -b v0.93

Setup ERPNext on the new bench

cd ~
bench init frappe-bench
cd frappe-bench
bench get-app erpnext https://github.com/frappe/erpnext				# Add ERPNext to your bench apps
bench get-app shopping_cart https://github.com/frappe/shopping-cart	# Add Shopping cart to your bench apps
cd apps/frappe && git fetch upstream && git checkout v4.x.x
cd apps/erpnext && git fetch upstream && git checkout v4.x.x
cd apps && ../env/bin/pip install -e frappe --upgrade --no-deps --force-reinstall
cd ~/frappe-bench && ./env/bin/pip install -r apps/frappe/requirements.txt

Migrate your site to the new bench

cd ~/frappe-bench
bench migrate-3to4 /path/to/old/erpnext/folder

If you get stuck in one of the patches and want to continue after fixing, run bench frappe --latest {sitename}

Upgrade to v6

cd /etc/mysql/conf.d (or equivalent for your OS) && sudo vim frappe.cnf

Paste the following:
--------------------
[mysqld]
innodb-file-format=barracuda
innodb-file-per-table=1
innodb-large-prefix=1
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

[mysql]
default-character-set = utf8mb4
--------------------
service mysql restart (or equivalent for your OS)

cd ~/bench-repo
git checkout master
cd ~/frappe-bench
bench switch-to-master --upgrade

bench setup procfile
bench setup socketio
bench setup redis

If you are on ubuntu and face errors related to redis-cache, do the following: vim config/redis_cache.conf remove the line save ""

Continue with production deployment

If you're setting up the site for production, follow the new production deployment instructions.