Installation and upgrade guide - V4 to V5

Hi everyone

I have installed two ERPNext instances, and once running, I have been extremely
impressed with it. Much, much better than other ERP systems I have
tried…well done and thank you to all developers.

However, there have been problems. I am writing this to help those of you with
similar issues in the hope that it will help you to resolve any problems you are
having.

My first install occurred with no problems - it was on a Debian based fresh
install. Everything occurred as it should - great!

However, my second install was on an existing Debian based distro and I had
hours of troubleshooting to resolve.

Be aware, anything suggested here may break your system and dependencies…tread
with caution. Having said that, I have succeeded in a reset without any issues.

If the ‘easy install’ fails then you need to remove the nginx, supervisor, redis-server installs. This assumes you do not use these for any other purpose.

Also you need to remove the database that was (or may have been) installed, and the frappe-bench and bench-repo folders.

To remove the nginx, supervisor and redis enter the following:

sudo apt-get purge redis*
sudo apt-get purge supervisor*
sudo apt-get purge nginx*

Note you need to enter the ‘purge’ in the apt-get to ensure the configuration files are removed…if they are not then issues can continue.

*** EDIT ***
You will have to manually remove the /etc/supervisor/conf.d directory. The apt-get purge does not remove it. If it remains, then the install routine will fail


To remove the database
You will be prompted for the password for the root user of the database server; this is found in root’s home folder. (/root)

So first

sudo su

and then

cd /root

cat *.txt

and copy the mysql/mariadb root password that is listed to your clipboard. Paste that password when prompted for the password when you log in to the mysql database.

Now make sure you exit the root environment by typing:

exit

and you should be taken back to your normal user prompt.

Start the mysql/mariadb command line interface (CLI) and remove the database:

mysql -u root -p

Now issue the following commands (note the semi-colons are important - you need to end the lines/statements with them as written):

show databases;

THis will list any database that exist, system as well as user created ones. My ERPNext one is

1bd3e0294d

but I guess yours may be different. To check it is the ERPNext database run the following, substituting your database name you wish to check:

use 1bd3e0294d;  
show tables;

When you run these you will be shown all the tables that exist in this database - they are lots of tables. If the list ends in something like…

| tabWeb Form Field                         |
| tabWeb Page                               |
| tabWebsite Item Group                     |
| tabWebsite Slideshow                      |
| tabWebsite Slideshow Item                 |
| tabWebsite Theme                          |
| tabWorkflow                               |
| tabWorkflow Action                        |
| tabWorkflow Document State                |
| tabWorkflow State                         |
| tabWorkflow Transition                    |
| tabWorkstation                            |
| tabWorkstation Working Hour               |
+-------------------------------------------+

…then that is your ERPNext db.

Next type:

drop database 1bd3e0294d;

This will take a few moments and will remove the DB from the server. Now type:

\q

to leave the mysql CLI interface and you will be taken back to the standard prompt.

Now type

cd ~

and you should be in the home area of the user you wish to install ERPNext for. Now we need to remove any previous version of Frappe and Bench:

sudo rm -rf frappe*
sudo rm -rf bench*

Now you can run the standard ‘friendly’ install command.

sudo bash setup_frappe.sh --setup-production

Note: I did run into one more issue - permission denied for bench.log. This has recently occurred for me and it is because, for a reason I haven’t managed to ascertain, bench.log is owned, and is in the group, of root. Run the following command to resolve:

sudo chown {user}:{user} bench.log

replacing {user} with your Frappe user account.

Upgrade to V5
This installs (when this was written 3rd May 2015) version 4.25.xxx. To upgrade to V5 run:

bench switch-to-master

Ignore the request “Please run bench update --patch to be safe from any differences in database schema” as this caused me many irrocoverable errors.

Then run

bench switch-to-develop

then

bench update --upgrade

then

bench retry-upgrade

At this point you should have a brand new ERPNext install available on Port 80 (standard web/http port).

Enjoy!

3 Likes