Tag: erpnext

  • Find ErpNext Version

    To find ErpNext version from command line, run

    bench version
    

    Example

    frappe@ubuntu-s-1vcpu-2gb-blr1-01:~/frappe-bench$ bench version
    erpnext 12.1.6
    frappe 12.0.16
    restore 0.0.1
    frappe@ubuntu-s-1vcpu-2gb-blr1-01:~/frappe-bench$
    

    Using Web Interface

    Login to ErpNext, then click the Help menu.

    erpnext help menu

    Click on “About” sub menu. You will get ErpNext version.

    erpnext version

    See ErpNext

  • Enable Developer Mode in ErpNext

    To enable developer mode in ErpNext, run

    bench --site YOUR_SITE_NAME_HEREĀ  set-config developer_mode 1
    

    Example

    bench --site erp.serverok.in set-config developer_mode 1
    

    Method 2

    You can manually enable development mode by editing site_config.json file

    vi frappe-bench/sites/{your site}/site_config.json
    

    Add “developer_mode”: 1

    {
      "developer_mode": 1,
      ...
    }
    

    Now clear the cache with the command

    bench clear-cache
    

    Method 3

    login to ErpNext as administrator, then enable Developer mode at

    Desk -> User dropdown list -> Set Desktop Icons -> check "Developer"
    

    See ErpNext

  • ErpNext backup a site

    To backup a site in ErpNext, you need to backup files and database.

    To backup files, run

    frappe@sok:~/frappe-bench$ bench --site erp.serverok.in backup --with-files
    Backed up files /home/frappe/frappe-bench/sites/erp.serverok.in/private/backups/20201112_140222-erp_grandeh_com-files.tar
    Backed up files /home/frappe/frappe-bench/sites/erp.serverok.in/private/backups/20201112_140222-erp_grandeh_com-private-files.tar
    frappe@sok:~/frappe-bench$ 
    

    To Backup database, run

    frappe@sok:~/frappe-bench$ bench --site erp.serverok.in backup
    frappe@sok:~/frappe-bench$ 
    

    To backup all sites, use

    cd /home/frappe/frappe-bench && bench --verbose --site all backup
    

    Backups are stored in folder

    /home/frappe/frappe-bench/sites/erp.serverok.in/private/backups/
    

    To restore a backup, you need to use the 3 files (private files, public files and database backup). To restore backup, check ErpNext restore backup.

    See ErpNext

  • ErpNext restore backup

    To restore ErpNext backup, run

    bench --site erp.serverok.in restore --with-public-files /backup/20201112_140222-erp_sevrerok_in-files.tar --with-private-files /backup/20201112_140222-erp_sevrerok_in-private-files.tar /backup/20201112_140505-erp_sevrerok_in-database.sql
    

    To see how to take backup check ErpNext backup a site.

    MySQL backup is is taken in .gz format, you need to gunzip to get the .sql file for restoring. If you specify the .gz file, restore will not work.

    See ErpNext

  • ERPnext Scheduler Inactive error

    ERPnext Scheduler Inactive error

    After installing ERPnext, when login for first time, i get error message

    Scheduler Inactive
    Background jobs are not running. Please contact Administrator.

    ERPnext

    To fix this, login to the user that is used to install erpnext, then change to the erpnext folder

    su - erpnext
    cd ~/erpnext
    

    Now run

    bench --site SITE_NAME_HERE enable-scheduler
    

    This will set following cronjobs

    erpnext@ip-172-31-38-185:~/erpnext$ crontab -l
    0 10 * * * cd /home/erpnext/erpnext &&  /home/erpnext/erpnext/env/bin/bench update --auto >> /home/erpnext/erpnext/logs/auto_update_log.log 2>&1
    0 */6 * * *  cd /home/erpnext/erpnext && /usr/local/bin/bench --site all backup >> /home/erpnext/erpnext/logs/backup.log 2>&1
    erpnext@ip-172-31-38-185:~/erpnext$ 
    

    Related Posts

    ERPnext
    Install LetsEncrypt SSL on ERPnext

  • Install LetsEncrypt SSL on ERPnext

    To install LetsEncrypt free SSL on ERPnext site, run

    sudo -H bench setup lets-encrypt [site-name] --custom-domain [custom-domain]
    

    Example

    sudo -H bench setup lets-encrypt lab.serverok.in
    

    To renew SSL, you can run

    sudo bench renew-lets-encrypt
    

    This will ask for your confirmation to restart nginx. Running this on cronjob won’t work. But you can use “echo y” to get it work. But it is better just to certbot-auto to renew SSL.

    Auto Renew ERPnext SSL

    To auto renew create a cronjob

    crontab -e
    

    Add

    30 2 * * 1 /usr/serverok/ssl-renew >> /var/log/le-renew.log
    

    Create file

    mkdir /usr/serverok/
    vi /usr/serverok/ssl-renew
    

    Add

    #!/bin/bash
    
    systemctl stop nginx
    /opt/certbot-auto renew
    systemctl start nginx
    

    Make it executable

    chmod 755 /usr/serverok/ssl-renew
    
  • How to delete ErpNext site with bench

    To delete an ErpNext site with bench, run

    bench drop-site DOMAIN
    

    Example

    ErpNext drop site