Skip to content

Migrating from ERPNext version 3

Anand Doshi edited this page Sep 14, 2015 · 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 checkout v5.x.x

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 you 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

Continue with production deployment

If you're setting up the site for production, follow the new production deployment instructions. Also, the production settings document instructed to replace nginx.conf. You should replace it again with the following content before continuing.

worker_processes 1;

user www-data www-data;
pid /var/run/nginx.pid;
error_log /tmp/nginx.error.log;

events {
	worker_connections 1024;
	accept_mutex off;
}


http {
	include mime.types;

	default_type application/octet-stream;
	access_log /tmp/nginx.access.log combined;
	sendfile on;
	types_hash_max_size 2048;

	upstream erpnext {
		server 127.0.0.1:8000 fail_timeout=0;
	}

	include /etc/nginx/conf.d/*.conf
}