This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
# OPS-BACKUP Placeholder
|
||||
|
||||
[Under Construction]
|
||||
|
||||
Backup process, controls, ongoing maintenance, notification settings related to backup
|
||||
10 backup rotation
|
||||
Settings related to backup
|
||||
|
||||
|
||||
ROLES AND RIGHTS:
|
||||
Modify automated backup settings
|
||||
Trigger backup
|
||||
DownloadBackup file
|
||||
Ops
|
||||
View Backup settings
|
||||
Ops, opsrestricted
|
||||
|
||||
|
||||
@@ -1,21 +1,31 @@
|
||||
# OPERATIONS BACKUP FORM
|
||||
|
||||
[UNDER CONSTRUCTION PRE-RELEASE]
|
||||
|
||||
AyaNova can automatically back up to the local file system once per day at a selected time.
|
||||
|
||||
The backup form is where you can configure how the backup works, perform a test backup and download backups for offsite storage.
|
||||
|
||||
The backup form is available to any User with the Operations Role selected and is located in the navigation panel under `Server Operations -> Backup`
|
||||
|
||||
It is not necessary to use the AyaNova automatic backup job if you already have a backup system in place for your PostgreSQL server, however the attachment files would still require some method to back them up independently if the AyaNova automatic backup job is not used.
|
||||
|
||||
## Backup format
|
||||
|
||||
AyaNova creates _two_ backup files when a backup is processed, the files are named based on date and time.
|
||||
|
||||
The attachments backup file starts with "at-" in the file name followed by a timestamp and is a standard zip archive of the attachments folder.
|
||||
|
||||
The database backup file starts with "db-" in the file name followed by a timstamp and with the extension ".backup". AyaNova uses the [pg_dump](https://www.postgresql.org/docs/current/app-pgdump.html) PostgreSQL utility to backup the database and uses the `-Fc` command line switch to create a "custom" format backup which is compressed.
|
||||
|
||||
## Best practices for disaster recovery
|
||||
AyaNova backs up to it's own server's **local** drive only. This is **not a full backup solution** only a partial one; you also need to store copies of the backups **off site** from the AyaNova server in case of hardware failure, natural disaster, theft etc.
|
||||
|
||||
AyaNova backs up to it's own server's **local** drive only. This is **not a full backup solution** only a partial one; you also need to store copies of the backups **off site** from the AyaNova server in case of hardware failure, natural disaster, theft etc.
|
||||
|
||||
A backup only stored on the same server (or even in the same building) as the live data is no backup at all if hardware fails or a server is stolen or burns down in a fire.
|
||||
|
||||
You should regularly download the backups for storage to a secure off-site location from the AyaNova server. Also keep in mind recovery time, if the data is stored in a location that is hard to access it will add to the time taken to recover the server and be back in business should there be a loss of data.
|
||||
You should regularly download the backups for storage to a secure off-site location from the AyaNova server. Also keep in mind recovery time, if the data is stored in a location that is hard to access it will add to the time taken to recover the server and be back in business should there be a loss of data.
|
||||
|
||||
### 10 backup rotation
|
||||
|
||||
Unless your industry has a different specific legal requirement that must be followed; we recommend the standard business practice of a 10 backup rotation system of retaining 10 copies of the daily backup.
|
||||
|
||||
You would download the most recent backup to a secure offsite location daily, naming and rotating them by replacing the oldest one each in the following pattern:
|
||||
@@ -30,32 +40,38 @@ The reason to keep so many backups is that there can be cases where critical dat
|
||||
|
||||
It is also a reasonable precaution to keep a yearly offsite backup going back as many years as is practical to store or appropriate to your business (and any potential legal requirements for your industry).
|
||||
|
||||
## Restoring from backup
|
||||
|
||||
To restore from backup see the [restore guide](ops-restore.md).
|
||||
|
||||
## Configuration
|
||||
|
||||
### Backup time
|
||||
Choose a time for the automatic backup when the server will be least busy. Usually this will be set to a value just before midnight for most sites.
|
||||
|
||||
### Backup attachment files
|
||||
Choose a time for the automatic backup when the server will be least busy. Usually this will be set to a value just before midnight for most sites.
|
||||
|
||||
### Backup attachment files
|
||||
|
||||
Attached files are stored by the AyaNova server separately from the AyaNova database in a special location in the file system.
|
||||
|
||||
Checking this box will cause AyaNova to also back up the attached files in addition to the database backup.
|
||||
Checking this box will cause AyaNova to also back up the attached files in addition to the database backup.
|
||||
|
||||
### Number of backups to keep
|
||||
|
||||
The backup system will automatically remove old backups depending upon this setting. If it is set to 3 then the most recent three days worth of backups are kept.
|
||||
The backup system will automatically remove old backups depending upon this setting. If it is set to 3 then the most recent three days worth of backups are kept.
|
||||
|
||||
If you are following a policy of 10 backup rotation as suggested above then you would really only need to keep 1 or 2 current backups.
|
||||
|
||||
### Active
|
||||
|
||||
Backups won't run if set to inactive. This is a control to turn on or off the Backup job entirely.
|
||||
Backups won't run if set to inactive. This is a control to turn on or off the Backup job entirely.
|
||||
|
||||
### Backup Files
|
||||
|
||||
This table contains the available backups on the server and provides the link to download them for off site storage.
|
||||
|
||||
#### Backup names
|
||||
|
||||
The listed backups have particular names:
|
||||
|
||||
The first segment of the name identifies the data in the backup file: Database backups will have "db" in their name, attachment backups will have "at" in their name. If the backup was triggered manually in the user interface it will be prepended with "manual" in the name.
|
||||
@@ -65,4 +81,5 @@ The second segment is the date and time of the backup.
|
||||
Attachment backups are `.zip` files and database backups are Postgress standard `.backup` files.
|
||||
|
||||
### Menu option: Backup now
|
||||
The Backup now menu option does exactly that: an on demand instant backup. This is useful for testing purposes or after large changes are made that you would like to ensure have been backed up. This will generate a manual backup that is not part of the normal automated backup process.
|
||||
|
||||
The Backup now menu option does exactly that: an on demand instant backup. This is useful for testing purposes or after large changes are made that you would like to ensure have been backed up. This will generate a manual backup that is not part of the normal automated backup process.
|
||||
|
||||
@@ -25,6 +25,23 @@ Install the **"ASP.NET CORE RUNTIME"** (NOT SDK VERSION) using this guide for yo
|
||||
|
||||
There are three different versions of .net core listed, be sure you select the "ASP.NET Core Runtime" version.
|
||||
|
||||
NOTE: In the example command lines in the linked pages above they are sometimes missing the `sudo` command, be sure to add it before commands listed there if non root user.
|
||||
|
||||
Confirm ASP.NET Core runtime is installed and available before proceeding to the next step:
|
||||
|
||||
```bash
|
||||
dotnet --list-runtimes
|
||||
```
|
||||
|
||||
The AspNetCore runtime should be displayed with version 6 or newer:
|
||||
|
||||
```
|
||||
Microsoft.AspNetCore.App 6.0.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
|
||||
Microsoft.NETCore.App 6.0.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
|
||||
```
|
||||
|
||||
If you do not see this go through the installation steps above again.
|
||||
|
||||
### PostgreSQL server
|
||||
|
||||
AyaNova requires access to a PostgreSQL database server version 12 or newer. If you do not have a PostgreSQL server already available then it must be installed to a location visible to the AyaNova server (same computer or a local computer on the same network).
|
||||
@@ -35,9 +52,9 @@ To install PostgreSQL directly start here [https://www.postgresql.org/download/l
|
||||
|
||||
### Set the PostgreSQL password
|
||||
|
||||
If you are installing a local copy of PostgreSQL for the first time to use with AyaNova a password will need to be set for access. If you have an existing PostgreSQL server then you can skip this step but will need the Postgre server password in a later step.
|
||||
If you are installing a local copy of PostgreSQL for the first time to use with AyaNova a password will need to be set for secure access. PostgreSQL on linux defaults to no password and must be secured. If you have an existing PostgreSQL server then you can skip this step but will need a PostgreSQL server password in a later step.
|
||||
|
||||
Open a PostgreSQL psql console:
|
||||
Open a PostgreSQL psql console as the postgres user:
|
||||
|
||||
```bash
|
||||
sudo -u postgres psql
|
||||
|
||||
@@ -46,6 +46,21 @@ There are three different versions of .net core listed, be sure you select the "
|
||||
|
||||
NOTE: In the example command lines in the linked pages above they are sometimes missing the `sudo` command, be sure to add it before commands listed there if non root user.
|
||||
|
||||
Confirm ASP.NET Core runtime is installed and available before proceeding to the next step:
|
||||
|
||||
```bash
|
||||
dotnet --list-runtimes
|
||||
```
|
||||
|
||||
The AspNetCore runtime should be displayed with version 6 or newer:
|
||||
|
||||
```
|
||||
Microsoft.AspNetCore.App 6.0.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
|
||||
Microsoft.NETCore.App 6.0.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
|
||||
```
|
||||
|
||||
If you do not see this go through the installation steps above again.
|
||||
|
||||
### Install PostgreSQL server
|
||||
|
||||
AyaNova requires access to a PostgreSQL database server version 12 or newer. If you do not have a PostgreSQL server already available then it must be installed to a location visible to the AyaNova server (same computer or a local computer on the same network).
|
||||
@@ -57,9 +72,9 @@ To install PostgreSQL directly start here
|
||||
|
||||
### Set the PostgreSQL password
|
||||
|
||||
If you are installing a local copy of PostgreSQL for the first time to use with AyaNova a password will need to be set for access. If you have an existing PostgreSQL server then you can skip this step but will need the Postgre server password in a later step.
|
||||
If you are installing a local copy of PostgreSQL for the first time to use with AyaNova a password will need to be set for secure access. PostgreSQL on linux defaults to no password and must be secured. If you have an existing PostgreSQL server then you can skip this step but will need a PostgreSQL server password in a later step.
|
||||
|
||||
Open a PostgreSQL psql console:
|
||||
Open a PostgreSQL psql console as the postgres user:
|
||||
|
||||
```bash
|
||||
sudo -u postgres psql
|
||||
@@ -232,7 +247,7 @@ Start the server service
|
||||
sudo systemctl start ayanova.service
|
||||
```
|
||||
|
||||
Confirm the AyaNova service is running by viewing the service status:
|
||||
Confirm the AyaNova service is running by first waiting for about 20 seconds after the last step for AyaNova to boot up then viewing the service status:
|
||||
|
||||
```bash
|
||||
sudo systemctl status ayanova.service
|
||||
@@ -240,7 +255,7 @@ sudo systemctl status ayanova.service
|
||||
|
||||
You should see in the service status display the AyaNova server version and that it is booting. Any problems found that prevent boot up will be displayed here.
|
||||
|
||||
Note that the first boot of AyaNova may require a few seconds to fully open before you will see server open message below. If you view the status too soon you may not see it get to BOOT: COMPLETED yet, just quite `q` and show status again.
|
||||
Note that the first boot of AyaNova may require a few seconds to fully open before you will see server open message below. If you view the status too soon you may not see it get to BOOT: COMPLETED yet. In that case type `q` to quit and then show status again.
|
||||
|
||||
If all is well the status will display "BOOT: COMPLETED - SERVER OPEN" as well as some other configuration data:
|
||||
|
||||
@@ -248,12 +263,6 @@ If all is well the status will display "BOOT: COMPLETED - SERVER OPEN" as well a
|
||||
|
||||
To exit the status display type `q` and enter to quit.
|
||||
|
||||
If you need to stop the AyaNova service:
|
||||
|
||||
```bash
|
||||
sudo systemctl stop ayanova.service
|
||||
```
|
||||
|
||||
### Local network access
|
||||
|
||||
If users are accessing AyaNova only on a private local area network no more installation steps are required and AyaNova should be ready for use.
|
||||
@@ -284,7 +293,7 @@ These instructions will assume use of a free SSL certificate from [LetsEncrypt](
|
||||
|
||||
##### Reverse proxy server
|
||||
|
||||
We will provide instructions for using the free and open source [NGINX](https://nginx.org/) as a reverse proxy server, if you already have another server capable of being a reverse proxy Apache you will need to adapt these instructions to match your situation.
|
||||
We will provide instructions for using the free and open source [NGINX](https://nginx.org/) as a reverse proxy server, if you already have another server capable of being a reverse proxy (such as Apache) you will need to adapt these instructions to match your situation.
|
||||
|
||||
#### Install NGINX
|
||||
|
||||
@@ -294,13 +303,13 @@ Install NGINX to be the reverse proxy server:
|
||||
sudo apt install nginx
|
||||
```
|
||||
|
||||
The server's firewall may need to be adjusted. Firewall configuration is beyond the scope of this installation guide, be sure you have a firewall in place and set correct, we will outline the requirements as they relate to AyaNova itself.
|
||||
The server's firewall may need to be adjusted. Firewall configuration is beyond the scope of this installation guide, be sure you have a firewall in place and set correctly, we will outline the requirements as they relate to AyaNova itself.
|
||||
|
||||
Ports 80 http will need to be open for requesting SSL certificates from LetsEncrypt and port 443 https will need to be open for ongoing access.
|
||||
Port 80 http will need to be open for requesting SSL certificates from LetsEncrypt and port 443 https will need to be open for ongoing access.
|
||||
|
||||
AyaNova itself does not require any port other than HTTPS port 443 to be open to the internet for the reverse proxy server.
|
||||
AyaNova itself does not require any port to be open to the outside world other than HTTPS port 443 for the reverse proxy server.
|
||||
|
||||
If this is a new server installation be sure you have a firewall set up in place. For hosted linux through Digitalocean the firewall may be set in the droplet networking control panel and there then would be no firewall required at the server itself and you can skip this step, otherwise ufw is commonly used.
|
||||
For hosted linux through a cloud provider the firewall may be set in the cloud networking control panel and there then would be no firewall required at the server itself and you can skip this step, otherwise ufw is commonly used.
|
||||
|
||||
NGINX registers itself as a service with ufw on installation so if ufw is active on your server it can be adjusted to work with NGINX as follows:
|
||||
|
||||
@@ -398,6 +407,13 @@ Confirm that NGINX sees the configuration as valid:
|
||||
sudo nginx -t
|
||||
```
|
||||
|
||||
You should see a response similar to this:
|
||||
|
||||
```
|
||||
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
|
||||
nginx: configuration file /etc/nginx/nginx.conf test is successful
|
||||
```
|
||||
|
||||
Restart NGINX so the new configuration takes effect:
|
||||
|
||||
```bash
|
||||
|
||||
@@ -14,7 +14,7 @@ The restricted role is ideal for giving access to a non technical staff member t
|
||||
## Backup
|
||||
The single most important ongoing task is ensuring the backup process is working properly and monitoring it. A full backup consists of a backup of the Postgres AyaNova database **and** a backup of the attachment files that are stored in the file system. It is not sufficient to merely allow AyaNova to backup to it's own drive, it's critically important that backups be stored **off-site** physically far away from the AyaNova server to ensure business recovery is possible in the event of a theft, fire or other disaster.
|
||||
|
||||
See the [backup guide](ops-backup.md) for details.
|
||||
See the [backup guide](ops-form-backup.md) for details.
|
||||
|
||||
## Metrics
|
||||
The AyaNova client [server metrics](ops-metrics.md) form in the AyaNova user interface is an important resource to monitor the ongoing health of the AyaNova server and ensure that it has enough resources to perform adequately. Metrics should be reviewed on an ongoing and regular basis to view changes over time and ensure the server isn't running out of resources like memory or disk space (for example) that could slow down or even prevent the server from performing it's tasks.
|
||||
|
||||
@@ -1,5 +1,58 @@
|
||||
# RESTORE BACKUP Placeholder
|
||||
# RESTORE AYANOVA BACKUP
|
||||
|
||||
[UNDER CONSTRUCTION PRE-RELEASE]
|
||||
Restoring an [AyaNova backup](ops-form-backup.md) is done manually through the operating system.
|
||||
|
||||
todo: how to restore, where the key is etc; this page is linked to from the client app when there is no license
|
||||
A full AyaNova backup consists of:
|
||||
|
||||
1. A database backup file identified by name which starts with "db-" followed by a timestamp and ends with ".backup"
|
||||
2. An attachments backup file which contains all files attached to objects within AyaNova and can be identified by name which starts with "at-" followed by a timestamp and ends with ".zip" as it is a standard zip format archive. Attachement files are _NOT_ stored in their original name and are identified from the database so it is important that a database backup and attachment backup be restored **together** as a matched pair or there is a chance of losing the connection between attachment files and the AyaNova objects to which they are attached.
|
||||
|
||||
## What will be restored
|
||||
|
||||
The AyaNova license key and all user entered data are stored in the AyaNova database. All attached files are stored in the attachments folder in many sub folders.
|
||||
The restoration process will restore all data entered in AyaNova to the point in time that the backup was taken. There is no need to separately install or backup a license, as long as the database is backed up, the license is also backed up.
|
||||
|
||||
## Restore steps
|
||||
|
||||
### In the case of a completely new server installation
|
||||
|
||||
If this is a restoration to a new computer that doesn't have AyaNova installed and confirmed running; then the first step is to [install AyaNova](ops-install.md)
|
||||
|
||||
It must be started and confirmed to be operating correctly **before** proceeded to the next step to ensure it's working and also so it can create the AyaNova database in PostgreSQL server correctly so it can be restored to later. PostgreSQL restore process requires the database to be present before restoring over top of it.
|
||||
|
||||
Once the AyaNova server is running and has created a database it must be shut down before proceeding.
|
||||
|
||||
### Shut down the AyaNova server
|
||||
|
||||
#### Server type installation
|
||||
|
||||
For all "Server" installations of AyaNova, stop the AyaNova server but do _not_ stop the PostgreSQL server.
|
||||
|
||||
#### Windows standalone "single" type installation
|
||||
|
||||
If this is a single standalone Windows installation configuration, PostgreSQL is stopped automatically when the AyaNova server is stopped so Postgre will need to be started manually from a command prompt.
|
||||
|
||||
Stop the AyaNova server first then start PostgreSQL from a command prompt.
|
||||
|
||||
If the default values were used during installation the command will be:
|
||||
|
||||
```bat
|
||||
"C:/Program Files/ayanova/local-postgres/bin/postgres.exe" -D "C:/ProgramData/ayanova/database" -p 5432
|
||||
```
|
||||
|
||||
Be sure to include the quotation marks exactly as written. PostgreSQL will display `database system is ready to accept connections` indicating it's up and running and ready for restore.
|
||||
|
||||
### Identify the attachments data folder location
|
||||
|
||||
Check the [server configuration](ops-config-environment-variables.md) and identify the location of the attachment files. There are two ways this can be specified, either directly through the [AYANOVA_ATTACHMENT_FILES_PATH](ops-config-folder-user-files.md) setting or indirectly through the [AYANOVA_DATA_PATH](ops-config-data-path.md) setting in which case the attachments folder will be found in a folder called `attachments` inside the folder specified by the AYANOVA_DATA_PATH setting.
|
||||
|
||||
### Make a copy of the server data folder
|
||||
|
||||
If there is any existing data then a file copy of the existing data folders to a safe location should be done first as a precaution. Restoring data will wipe out any existing data and mistakes can happen.
|
||||
|
||||
### Restore the attachments
|
||||
|
||||
- Erase the current contents of the attachments folder identifed above, it must be completely empty before the next step
|
||||
- Unzip the contents of the attachements zip file into the attachments folder. There will be a lot of folders with single letter of digit names contained within each other, this is normal, you will not see recognizable file names here.
|
||||
|
||||
### Restore the database
|
||||
|
||||
@@ -132,10 +132,13 @@ nav:
|
||||
- 'Linux': 'ops-install-linux.md'
|
||||
- 'Linux desktop': 'ops-install-linux-desktop.md'
|
||||
- 'Linux server': 'ops-install-linux-server.md'
|
||||
- Backup & Restore:
|
||||
- 'Backup': 'ops-form-backup.md'
|
||||
- 'Restore': 'ops-restore.md'
|
||||
- Forms:
|
||||
- 'Introduction': 'ops-intro.md'
|
||||
- 'Server state': 'ops-server-state.md'
|
||||
- 'Backup': 'ops-backup.md'
|
||||
- 'Backup': 'ops-form-backup.md'
|
||||
- 'Job queue': 'ops-jobs.md'
|
||||
- 'Server log': 'ops-log.md'
|
||||
- 'Server metrics': 'ops-metrics.md'
|
||||
@@ -167,7 +170,6 @@ nav:
|
||||
- 'Notification queue': 'ops-notify-queue.md'
|
||||
- 'Backup utility PGDUMP path': 'ops-config-backup-pgdump-path.md'
|
||||
- 'Backup folder': 'ops-config-folder-backup-files.md'
|
||||
- 'Restore backup': 'ops-restore.md'
|
||||
- Developer guide:
|
||||
- 'Introduction': 'api-intro.md'
|
||||
- 'API developers console': 'api-console.md'
|
||||
|
||||
Reference in New Issue
Block a user