Backup, Restore and the Go-Live Process
The purpose of this page is to walk you through the steps needed to prepare your environments for go-live. This page focuses on real-live environment management including backing up and restoring from a remote location. View this page and this page to learn the basic backup and restore processes built in to iDempiere.Environment Management Introduction
Offsite Backup Demonstration (ppt) - Database Only
Restore From Offsite Backup to Test Environment Demonstration - Database Only
Protecting Your Application Server (Binaries)
The above videos focus on your database. The below thread applies a similar concept to your application server. Link to discussionBackup All and Restore All - Moving both Binaries and Data
The purpose of this page is to help you manage test servers that are near-exact duplicates of production. Creating and managing test servers (UAT, Test, Dev, etc...) can be tough. Specifically, it is tough to create an exact duplicate of the production system to ensure what you are testing will behave the exact same way in production when released. Here are the steps to create your test system. Note these steps assume you are using Amazon's AWS; however, the concepts are the same for VMWare or Virtualbox.- Create a back on your production server using the below script. It will back up both your iDempiere binaries and database for use below.
- /opt/chuboe/idempiere-installation-script/utils/chuboe_backup_all.sh
- Create an image of your production server
- Launch a new server from that image called test
- ssh to your new TEST server
- Sudo edit the /etc/hosts file to point to the appropriate internal IP address
- Edit the /opt/chuboe/idempiere-installation-script/utils/chuboe.properties
- CHUBOE_PROP_IS_TEST_ENV="Y"
- Make sure the test server has the production server's pem
- Copy the pem to the test server
- Place in /home/idempiere/.ssh/PEMHere.pem
- sudo chown idempiere:idempiere
- sudo chmod 400 PEMHere.pem
- Edit the /opt/chuboe/idempiere-installation-script/utils/chuboe_restore_all.sh script
- TMP_REMOTE_BACKUP_SERVER=SetTheURLOfYourProductionServer
- TMP_SSH_PEM=" -i /home/$CHUBOE_PROP_IDEMPIERE_OS_USER/.ssh/YOUR_PEM_NAME.pem"
- Note that the bottom of chuboe_restore_all.sh includes SQL to disable production only services/settings
- Run the /opt/chuboe/idempiere-installation-script/utils/chuboe_restore_all.sh script from your test server
- Watch the logs to ensure all executed as expected
Creating Your Test Environment - Considerations
Note: this discussion is older, and it is replaced by the above Backup All and Restore All instructions.Executing a Scenario in your Clean Test Environment
Note: This video demonstrates how to remove test transactions from your server.The 7 Mock Go-Lives to Help Ensure your Success
20160811 Go-Live Push from Pristine Environment to Test Environment
Summary
The purpose of this section is to help you push both the server and the data from the Pristine environment to the Test environment. The following concepts are important:- There are times when pushing just the data (database) from pristine to test is not enough. If you are working with developers to create custom plugins, you need to test these plugins before releasing to production. Each time you push from pristine to test, your test environment should start from the pristine state to ensure you are properly testing the write code/environment.
- This act should be coordinated with both the end user and your development team
- Both the server (binaries) and the data (db export) are pushed so that the test environment is exactly aligned with pristine.
- The only time the pristine server (binaries and db) are upgraded is after they have been vetted in test. There may be times that you push from pristine to test and you are required to re-install 'stuff' in test because it has not been released to production.
- Once something has been released to production, it will no longer have to be re-installed in test.
From Pristine App Server
- sudo service idempiere stop
- cd /opt/idempiere-server/utils/
- sudo -u idempiere ./RUN_DBExport.sh
- Creates a current backup in the directory that will be moved
- cd /opt/idempiere-server/
- sudo -u idempiere hg addremove
- sudo -u idempiere hg commit -m "commit before restore to test commit"
- sudo -u idempiere hg push YOUR_ONLINE_BACKUP_BITBUCKET_ACCT_URL
- sudo rm -r /opt/id_back/*
- this step assumes you have already created this directory and that is owned by idempiere
- sudo -u idempiere cp /opt/idempiere-server/ /opt/id_back/ -R
- cd /opt/id_back
- sudo -u idempiere tar cvfz id.tar.gz idempiere-server/
From Pristine DB Server
- sudo service postgresql stop
- To prevent accidental contamination of pristine db - will start later
From Test App Server
- sudo service idempiere stop
- sudo rm /tmp/id.tar.gz
- scp USER_ID@MACHINE_NAME:/opt/id_back/id.tar.gz /tmp
- sudo rm /opt/id_back_test/* -r
- this step assumes you have already created this directory and it is owned by idempiere
- sudo -u idempiere cp /opt/idempiere-server/ /opt/id_back_test/ -R
- sudo rm /opt/idempiere-server/ -r
- sudo tar zxvf /tmp/id.tar.gz -C /opt/
- sudo chown idempiere:idempiere /opt/idempiere-server/
- cd /opt/idempiere-server/
- sudo -u idempiere ./console-setup.sh
- Override setting for the bolded options below:
- ...
- Application Server Host Name [TEST_MACHINE_NAME]:
- Application Server Web Port [8080]:
- ...
- Database Server Host Name [DATABASE_MACHINE_NAME]:
- ...
- cd /opt/idempiere-server/utils/
- sudo -u idempiere ./RUN_DBRestore.sh
- Restores from the above backup in the directory that will be moved
- Update /opt/idempiere-server/jettyhome/etc/jetty-ssl.xml to allow 0.0.0.0
- cd /opt/chuboe/idempiere-installation-script/utils/
- ./chuboe_idempiere_upgrade.sh
- NOTE: this performs any upgrades since the last production upgrade - this may be necessary to support plugins that are not released to production Now install all test plugins that have not already been installed in production. Restart app server when done.
Execute the following SQL script to update known tasks (like logos, etc…)
- Update AD_SysConfig set value = 'URL_TO_YOUR_SMALL_LOGO_FOR_TEST_ENV' where AD_SysConfig_ID=9999999999;
- Update AD_SysConfig set value = 'URL_TO_YOUR_LARGE_LOGO_FOR_TEST_ENV' where AD_SysConfig_ID=999999988;
Create Transactions in your Test Environment
This makes sure the test environment works and has no dependencies on the pristine environment.Back to the Pristine DB
- sudo service postgresql start
Back to the Pristine App
- Sudo service idempiere start