How the automatic update broke my install and I migrated to the new framework

First off, I want to thank the developers and team that brings us ERPNext. It is a great program and even better after the change in framework back in October. I am writing this as a "How-To" for anyone having issues currently and to share my experience with the dev team.

My day started off yesterday, with a backup of my ERPNext system and an update through the web UI. The system I had was the ERPNext VM running on centOS with Apache. 

After the update I was served with the Apache 2 test page. After researching the forums, I realized that I needed to move forward to the new framework running on nginx instead of try to patch an old system. My options were 1) to try and upgrade my current system, or 2) to spin up a new system and restore my data. The second option seemed like a winner, and after trying both options, I ended up successful with the second one. Here are my steps:

1) Spin up the latest copy of ERPNext VM.
2) Run through the initial setup web UI.
3) Log into the system via terminal. (note, you must "sudo" commads as the user "erpnext")
4) Update your current system with the following commands:

# cd /home/erpnext/erpnext
# ./lib/wnf.py --pull origin master
# ./lib/wnf.py --latest
# sudo pip install semantic-version
# ./lib/wnf.py --latest
# ./lib/wnf.py --build
# sudo supervisorctl restart gunicorn

5) The above commands were run on the ERPNext VM from erpnext.com labeled "erpnext-1113.ova"
6) Now restart your system and verify that ERPNext is still operational.

# sudo reboot

7) Log back into your system via. terminal.
8) Now create a tmp directory in your home folder to store your old data.

# cd /home
# sudo mkdir tmp
# cd /tmp

9) Now download and extract your SQL database and file backups. I downloaded mine from my dropbox folder.

# sudo wget URL_OF_DATABASE_BACKUP
# sudo wget URL_OF_FILES_BACKUP
# ls -l
# sudo gunzip DATABASE_BACKUP.sql.gz
# sudo tar xvf FILES_BACKUP.tar
# ls -l

10) This part may be a little different depending on the version you are migrating from. You need to copy the files from you /home/tmp directory to the new directory. Below is my command for reference.

# cp /home/tmp/var/www/erpnext/public/files/* /home/erpnext/erpnext/public/files/

11) I would suggest taking a backup of the new default database in case the restore doesn't work. I did this through the web UI.
12) Now restore your old database and update ERPNext again. Note that some of the commands below were invalid when I ran them. I do not recall which ones exactly.

# ./lib/wnf.py --mysql < /home/tmp/DATABASE_BACKUP.sql
# ./lib/wnf.py --patch_sync
# ./lib/wnf.py --latest
# ./lib/wnf.py --pull origin master
# ./lib/wnf.py --latest
# ./lib/wnf.py --build
# ./lib/wnf.py --patch_sync
# ./lib/wnf.py --sync_all

13) Restart your system and verify your data.

# sudo reboot

14) Note that the port has changed from 8080 to 8000 in the new system.



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.
EDIT:

In step 12, you need to cd to the erpnext folder before running those commands. The step should be:

12) Now restore your old database and update ERPNext again. Note that some of the commands below were invalid when I ran them. I do not recall which ones exactly.

# cd /home/erpnext/erpnext
# ./lib/wnf.py --mysql < /home/tmp/DATABASE_BACKUP.sql
# ./lib/wnf.py --patch_sync
# ./lib/wnf.py --latest
# ./lib/wnf.py --pull origin master
# ./lib/wnf.py --latest
# ./lib/wnf.py --build
# ./lib/wnf.py --patch_sync
# ./lib/wnf.py --sync_all



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.
Travis this is great.

You can also post it on the GitHub wiki and link it to the update section (the posts tend to get lost in the forum!)

best,
Rushabh

On Wednesday, December 18, 2013 8:59:53 PM UTC+5:30, Travis McAdams wrote:
EDIT:

In step 12, you need to cd to the erpnext folder before running those commands. The step should be:

12) Now restore your old database and update ERPNext again. Note that some of the commands below were invalid when I ran them. I do not recall which ones exactly.

# cd /home/erpnext/erpnext
# ./lib/wnf.py --mysql < /home/tmp/DATABASE_BACKUP.sql
# ./lib/wnf.py --patch_sync
# ./lib/wnf.py --latest
# ./lib/wnf.py --pull origin master
# ./lib/wnf.py --latest
# ./lib/wnf.py --build
# ./lib/wnf.py --patch_sync
# ./lib/wnf.py --sync_all



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.