GithubHelp home page GithubHelp logo

morghim / erpnext-backup-restore Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sihaysistema/erpnext-backup-restore

0.0 0.0 1.0 30 KB

A simple script to backup and restore erpnext server instances quickly. [WIP]

Python 100.00%

erpnext-backup-restore's Introduction

ERPNext Remote Backup Script

This script will allow you to backup your ERPNext instance in two steps:

  1. You configure a backup-restore.json file with your server IP, credentials and your local machine's SSH keys
  2. You run the script

The json file must be located one directory above the script: erpnext-backup.py

Requirements

  • Python 3.6
  • Your local machine MUST have a SSH private key registered, so that it may open the remote server previously configured with the private keys complementary public key. Here are some references on using SSH keys. Just remember: Register your private key on the local machine, and add the public key on the remote server where you will be backing up and the remote server where you will be restoring.

Configuration

Using a text editor, open the generic backup-restore.json file located in this directory Change the key values appropriately Save in the parent directory where you cloned this GitHub repository. (This is for security reasons, in case you edit this on your fork, you would not want to push a file with all your credentials, right?)

hostname: The server address of your ERPNext instance. For example: 192.168.1.38 user: The username configured on your server instance when setting up your server. For example: james password: The password you use when logging in to your server instance. Usually when you don't have an ssh key configured, this is used. It can be left blank if using ssh key authentication mySSHK: Your public key file with complete path. For example: /Users/myuser/.ssh/my-key-name.pub mySSHK_passphrase: The passphrase you entered to access you private key when generating your key pair. our public key file with complete path. This is the passphrase that you entered when you ran ssh-keygen . This passphrase keeys the private key encrypted, and adds extra security. sites: An array of site names on the server. Currently it is not being used. Planned for further support of multiple site backups.

backup_dir: The directory in the remote server where the backup will be written. I recommend home

backup_filename: The filename which will be used when constructing the complete filename for the database backup.
This script will create a new .sql file whose name equals the hostname-year-month-day-hour-minute-backup-filename.sql

pvt_files_backup_filename: The filename which will be user when constructing the complete filename for the private files backup. This script will create a new .gz file whose name will be hostname-year-month-day-hour-minute-pvt_files_backup_filename.tar.gz

pub_files_backup_filename: The filename which will be user when constructing the complete filename for the public files backup. This script will create a new .gz file whose name will be hostname-year-month-day-hour-minute-pub_files_backup_filename.tar.gz

Usage:

python3.6 erpnext-backup.py

erpnext-backup-restore's People

Contributors

morghim avatar tropicalrambler avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.