Commit e26e17f8 authored by Jeffrey Schlitt's avatar Jeffrey Schlitt

added backup, restore and upgrade of Team

parent a93dae88
......@@ -66,18 +66,19 @@ To do this you must issue the following commands
#+sql
:output file
:path '/users/jschlitt/Downloads/jeff1'
:type csv
:delimiter ','
:null_value 'NULL'
:quote_char '"'
:escape_char '\'
:row_delimiter '/'
:overwrite true
#+begin
select * from wb_pro_marketing_list
where emaildomain = 'aginity.com'
#+end
.. note::
We only support today the file type of csv. You can still change the delimiter but all files with have a csv extension
The table below illustrates the current values accepted in execute to file commands
+--------------------------------------+--------------------------------------+
......@@ -88,10 +89,6 @@ The table below illustrates the current values accepted in execute to file comma
| | should be in the format |
| | "drive:\directory\filename". |
+--------------------------------------+--------------------------------------+
| type | Only supported file type today is |
| | csv. This is only the extension, |
| | you can change the delimiter. |
+--------------------------------------+--------------------------------------+
| delimiter | You can use any value but we |
| | recommend , or | or ^ or \t for (tab)|
+--------------------------------------+--------------------------------------+
......@@ -101,13 +98,6 @@ The table below illustrates the current values accepted in execute to file comma
| quote_char | enter how to enclose character string|
| | typically the quotation (") |
+--------------------------------------+--------------------------------------+
| escape_char | if an escape character is seen it |
| | will be seen with the "\" character |
+--------------------------------------+--------------------------------------+
| row_delimiter | an end of row is signified with a |
| | carriage return. This feature is |
| | not implemented yet. |
+--------------------------------------+--------------------------------------+
| overwrite | whether or not to allow overwrite |
| | if file exists: true or false |
+--------------------------------------+--------------------------------------+
......
......@@ -272,6 +272,7 @@ When adding a new folder you will be presented with a basic text box to create y
:align: center
:alt: Browse the Database Catalog
.. _manexport:
Import and Export Items from Catalog
===========================================
......
......@@ -2,9 +2,14 @@
********************************************************
Installing the Catalog Server for |var_product_name|
Administering |var_product_name|
********************************************************
Installing Aginity Team
=========================
Installing team consists of accessing and setting up an environment based on an Ubuntu O/S. You can either do this on an existing Ubuntu Server or set up a Virtual Machine that will host the shared catalog database and Team application server.
If you have not yet done so download the software from `here <https://www.aginity.com/pricing/>`_.
......@@ -12,7 +17,7 @@ If you have not yet done so download the software from `here <https://www.aginit
Once you register and download the software you can begin the installation process. Upon registration you the software will automatically download. The software should be titled **aginity-team-<version#>-amd64.deb**.
Pre-Requisites and Getting to a Server
==========================================
------------------------------------------
Team is installed on an Ubuntu Server or Virtual Machine environment. The machine Ubuntu is installed on must meet the following requirements
......@@ -41,7 +46,7 @@ If you would prefer, we are happy to schedule a free install for you. Please cl
`Click here to schedule an install with an Aginity Consultant <https://outlook.office365.com/owa/calendar/Aginity@aginity365.onmicrosoft.com/bookings/s/8FDfJOeuUUa7UehVlqSdkg2>`_
The Installation Process
=========================
---------------------------
The following steps should be executed in order
......@@ -105,7 +110,7 @@ You will be asked for the following information
Starting Aginity Team Server
================================
------------------------------------
**Step 5:** You are now ready to start |var_product_name|
......@@ -123,7 +128,7 @@ You can check if |var_product_name| is running by issuing this command
Accessing |var_product_name| for the First Time
=================================================
-----------------------------------------------------
**Step 6:** Step 6: Open browser and navigate to https://<ip or team server name>:8080/login. You will see the following image
......@@ -161,7 +166,7 @@ Accessing |var_product_name| for the First Time
Stopping |var_product_name| Services
=======================================
----------------------------------------
Log in as the team user and issue the following command
......@@ -175,3 +180,136 @@ Log in as the team user and issue the following command
.. seealso::
:ref:`Add Connections <newconn>`
Upgrading |var_product_name|
========================================================
Upgrading team consists of logging into the Team server, downloading the latest update and applying it from the command line.
For clarities sake when we refer to **aginity-team-<version#>-amd64.deb** we purposely leave version# generic. Each upgrade will have a different number associated with it.
.. warning::
It is important to take a backup of both your encryption key for the Team catalog and to do a `Backing Up or Restoring Team Catalog`_ before upgrading. This way if anything goes wrong you will not use your catalog.
It is also recommended to do a :ref:`manual export <manexport>` of your catalog from time to time.
You can get the encryption key using the command below.
.. code-block:: bash
sudo cat /etc/aginity-team/service.conf
Step 1: Logging into Team Server
----------------------------------
SSH into the Team server as an administrator.
.. note::
Typically you will log in as an account other than root and then you will be using the sudo command
Step 2: Check to see if Team is Currently Running and then Shut it Down
---------------------------------------------------------------------------
Issue the command below to check the status of the Team service
.. code-block:: bash
sudo systemctl status aginity-team
If Team is running shut it down by issuing this command
.. code-block:: bash
sudo systemctl stop aginity-team
.. note::
It is always a good idea to run the status check again to make sure Team has been shut down.
Step 3: Download the Latest Version of Aginity Team
------------------------------------------------------
Using the wget command you can download the latest version as shown below.
.. code-block:: bash
wget http://repository.aginity.com.s3.amazonaws.com/AginityTeam/aginity-team-<version#>-amd64.deb
Step 4: Upgrading the Software
----------------------------------
Run the upgrade process by issuing this command.
.. code-block:: bash
sudo dpkg -i aginity-team
When presented with the menu shown in the image below hit "N" to tell the software to keep the catalog as is.
.. image:: ../../team_images/AginityTeamUpdate.png
:scale: 80
:align: center
:alt: Post Install
Step 5: Restart Aginity Team
---------------------------------
Restart the server by issuing this command.
.. code-block:: bash
sudo systemctl start aginity-team
.. _backup:
Backing Up or Restoring Team Catalog
===================================================
We have provided two files listed and described below which will allow you to automate or manually backup and restore your |var_product_name| catalog.
Backup Script
-------------
The backup script :download:`backup.sh <backup.sh>` will perform and compress a backup of the |var_product_name| Catalog to the /tmp/ directory on your O/S. It will append the date to the end of the file created and should be named in this pattern. **aginity_backup_%m_%d_%Y.zip**
.. note::
Before running the backup.sh script you will need to edit it and provide the following variables.
* DESTINATION ~ if you do not want to use the default /tmp/
* TOKEN ~ this value is the encryption key for the database. To find out the value of it run this command.
.. code-block:: bash
sudo cat /etc/aginity-team/service.conf
* H2PATH ~ Unless you modified the installation directory from the default you should not need to change this.
* DBPATH ~ Unless you modified the installation directory from the default you should not need to change this.
When running a backup the |var_product_name| server process will be stopped then restarted when complete.
.. seealso::
If you want to schedule the backup and automate it we recommend scheduling using Crontab: `Crontab Reference Guide <https://linuxconfig.org/linux-crontab-reference-guide>`_
Restore Script
-----------------
To restore to an instance of the backup follow these instructions.
You'll need to set the variables within the restore.sh to match what is in the backup.sh.
First download the restore script :download:`restore.sh <restore.sh>`. Next you will provide the file name of the backup you want to restore in the
* SOURCE variable.
Now run the script and it will automatically re-start |var_product_name| when complete.
......@@ -86,6 +86,7 @@
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../../docs/admin/install_team.html">Installing the Catalog Server for Aginity Team</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../docs/admin/userpermission.html">Creating Users in Aginity Team</a></li>
<li class="toctree-l1"><a class="reference internal" href="../connections/configure_connections.html">Configuring Connections in Aginity Team</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Object_Browser/using_browser.html">Using the Database Explorer in Aginity Team</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Using the Query Panel in Aginity Team</a><ul>
......@@ -258,20 +259,14 @@
10
11
12
13
14
15
16</pre></div></td><td class="code"><div class="highlight"><pre><span></span> <span class="c1">-- This will write the SQL statement between #+begin and #+end to the file specified.</span>
13</pre></div></td><td class="code"><div class="highlight"><pre><span></span> <span class="c1">-- This will write the SQL statement between #+begin and #+end to the file specified.</span>
<span class="o">#+</span><span class="k">sql</span>
<span class="p">:</span><span class="k">output</span> <span class="n">file</span>
<span class="p">:</span><span class="n">path</span> <span class="s1">&#39;/users/jschlitt/Downloads/jeff1&#39;</span>
<span class="p">:</span><span class="k">type</span> <span class="n">csv</span>
<span class="p">:</span><span class="k">delimiter</span> <span class="s1">&#39;,&#39;</span>
<span class="p">:</span><span class="n">null_value</span> <span class="s1">&#39;NULL&#39;</span>
<span class="p">:</span><span class="n">quote_char</span> <span class="s1">&#39;&quot;&#39;</span>
<span class="p">:</span><span class="n">escape_char</span> <span class="s1">&#39;\&#39;</span>
<span class="p">:</span><span class="n">row_delimiter</span> <span class="s1">&#39;/&#39;</span>
<span class="p">:</span><span class="n">overwrite</span> <span class="k">true</span>
<span class="o">#+</span><span class="k">begin</span>
<span class="k">select</span> <span class="o">*</span> <span class="k">from</span> <span class="n">wb_pro_marketing_list</span>
......@@ -280,6 +275,10 @@
</pre></div>
</td></tr></table></div>
</div></blockquote>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">We only support today the file type of csv. You can still change the delimiter but all files with have a csv extension</p>
</div>
<p>The table below illustrates the current values accepted in execute to file commands</p>
<table border="1" class="docutils">
<colgroup>
......@@ -298,33 +297,19 @@
should be in the format
“drive:directoryfilename”.</td>
</tr>
<tr class="row-odd"><td>type</td>
<td>Only supported file type today is
csv. This is only the extension,
you can change the delimiter.</td>
</tr>
<tr class="row-even"><td>delimiter</td>
<tr class="row-odd"><td>delimiter</td>
<td>You can use any value but we
recommend , or | or ^ or t for (tab)</td>
</tr>
<tr class="row-odd"><td>null_value</td>
<tr class="row-even"><td>null_value</td>
<td>enter a character field for null
typically ‘’ (empty string) or ‘NULL’</td>
</tr>
<tr class="row-even"><td>quote_char</td>
<tr class="row-odd"><td>quote_char</td>
<td>enter how to enclose character string
typically the quotation (“)</td>
</tr>
<tr class="row-odd"><td>escape_char</td>
<td>if an escape character is seen it
will be seen with the “” character</td>
</tr>
<tr class="row-even"><td>row_delimiter</td>
<td>an end of row is signified with a
carriage return. This feature is
not implemented yet.</td>
</tr>
<tr class="row-odd"><td>overwrite</td>
<tr class="row-even"><td>overwrite</td>
<td>whether or not to allow overwrite
if file exists: true or false</td>
</tr>
......
......@@ -85,7 +85,8 @@
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../../docs/admin/install_team.html">Installing the Catalog Server for Aginity Team</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../docs/admin/install_team.html">Administering Aginity Team</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../docs/admin/userpermission.html">Creating Users in Aginity Team</a></li>
<li class="toctree-l1"><a class="reference internal" href="../connections/configure_connections.html">Configuring Connections in Aginity Team</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Object_Browser/using_browser.html">Using the Database Explorer in Aginity Team</a></li>
<li class="toctree-l1"><a class="reference internal" href="../Query_Panel/using_panel.html">Using the Query Panel in Aginity Team</a></li>
......@@ -372,7 +373,7 @@ FROM addresses
<a class="reference internal image-reference" href="../../../../_images/pro_catalog_new_folder.png"><img alt="Browse the Database Catalog" class="align-center" src="../../../../_images/pro_catalog_new_folder.png" style="width: 306.6px; height: 102.6px;" /></a>
</div>
<div class="section" id="import-and-export-items-from-catalog">
<h2>Import and Export Items from Catalog<a class="headerlink" href="#import-and-export-items-from-catalog" title="Permalink to this headline"></a></h2>
<span id="manexport"></span><h2>Import and Export Items from Catalog<a class="headerlink" href="#import-and-export-items-from-catalog" title="Permalink to this headline"></a></h2>
<p>You have the ability to Import and Export both your full catalog as well as any folder selected within the catalog.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
......
......@@ -83,7 +83,8 @@
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../docs/admin/install_team.html">Installing the Catalog Server for Aginity Team</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../docs/admin/install_team.html">Administering Aginity Team</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../docs/admin/userpermission.html">Creating Users in Aginity Team</a></li>
<li class="toctree-l1"><a class="reference internal" href="docs/connections/configure_connections.html">Configuring Connections in Aginity Team</a></li>
<li class="toctree-l1"><a class="reference internal" href="docs/Object_Browser/using_browser.html">Using the Database Explorer in Aginity Team</a></li>
<li class="toctree-l1"><a class="reference internal" href="docs/Query_Panel/using_panel.html">Using the Query Panel in Aginity Team</a></li>
......
This diff is collapsed.
......@@ -84,7 +84,7 @@
<ul>
<li class="toctree-l1"><a class="reference internal" href="docs/admin/install_team.html">Installing the Catalog Server for Aginity Team</a></li>
<li class="toctree-l1"><a class="reference internal" href="docs/admin/install_team.html">Administering Aginity Team</a></li>
<li class="toctree-l1"><a class="reference internal" href="docs/admin/userpermission.html">Creating Users in Aginity Team</a></li>
<li class="toctree-l1"><a class="reference internal" href="aginity-pro/source/docs/connections/configure_connections.html">Configuring Connections in Aginity Team</a></li>
<li class="toctree-l1"><a class="reference internal" href="aginity-pro/source/docs/Object_Browser/using_browser.html">Using the Database Explorer in Aginity Team</a></li>
......
......@@ -36,7 +36,7 @@
<link rel="stylesheet" href="_static/theme_overrides.css" type="text/css" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Installing the Catalog Server for Aginity Team" href="docs/admin/install_team.html" />
<link rel="next" title="Administering Aginity Team" href="docs/admin/install_team.html" />
</head>
<body class="wy-body-for-nav">
......@@ -84,7 +84,7 @@
<ul>
<li class="toctree-l1"><a class="reference internal" href="docs/admin/install_team.html">Installing the Catalog Server for Aginity Team</a></li>
<li class="toctree-l1"><a class="reference internal" href="docs/admin/install_team.html">Administering Aginity Team</a></li>
<li class="toctree-l1"><a class="reference internal" href="docs/admin/userpermission.html">Creating Users in Aginity Team</a></li>
<li class="toctree-l1"><a class="reference internal" href="aginity-pro/source/docs/connections/configure_connections.html">Configuring Connections in Aginity Team</a></li>
<li class="toctree-l1"><a class="reference internal" href="aginity-pro/source/docs/Object_Browser/using_browser.html">Using the Database Explorer in Aginity Team</a></li>
......@@ -155,7 +155,7 @@
<div class="rst-breadcrumbs-buttons" role="navigation" aria-label="breadcrumb navigation">
<a href="docs/admin/install_team.html" class="btn btn-neutral float-right" title="Installing the Catalog Server for Aginity Team" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="docs/admin/install_team.html" class="btn btn-neutral float-right" title="Administering Aginity Team" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
</div>
......@@ -172,12 +172,10 @@
<p>The documentation consists of the following sections:</p>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="docs/admin/install_team.html">Installing the Catalog Server for Aginity Team</a><ul>
<li class="toctree-l2"><a class="reference internal" href="docs/admin/install_team.html#pre-requisites-and-getting-to-a-server">Pre-Requisites and Getting to a Server</a></li>
<li class="toctree-l2"><a class="reference internal" href="docs/admin/install_team.html#the-installation-process">The Installation Process</a></li>
<li class="toctree-l2"><a class="reference internal" href="docs/admin/install_team.html#starting-aginity-team-server">Starting Aginity Team Server</a></li>
<li class="toctree-l2"><a class="reference internal" href="docs/admin/install_team.html#accessing-var-product-name-for-the-first-time">Accessing Aginity Team for the First Time</a></li>
<li class="toctree-l2"><a class="reference internal" href="docs/admin/install_team.html#stopping-var-product-name-services">Stopping Aginity Team Services</a></li>
<li class="toctree-l1"><a class="reference internal" href="docs/admin/install_team.html">Administering Aginity Team</a><ul>
<li class="toctree-l2"><a class="reference internal" href="docs/admin/install_team.html#installing-aginity-team">Installing Aginity Team</a></li>
<li class="toctree-l2"><a class="reference internal" href="docs/admin/install_team.html#upgrading-var-product-name">Upgrading Aginity Team</a></li>
<li class="toctree-l2"><a class="reference internal" href="docs/admin/install_team.html#backing-up-or-restoring-team-catalog">Backing Up or Restoring Team Catalog</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="docs/admin/userpermission.html">Creating Users in Aginity Team</a><ul>
......
No preview for this file type
......@@ -84,7 +84,7 @@
<ul>
<li class="toctree-l1"><a class="reference internal" href="docs/admin/install_team.html">Installing the Catalog Server for Aginity Team</a></li>
<li class="toctree-l1"><a class="reference internal" href="docs/admin/install_team.html">Administering Aginity Team</a></li>
<li class="toctree-l1"><a class="reference internal" href="docs/admin/userpermission.html">Creating Users in Aginity Team</a></li>
<li class="toctree-l1"><a class="reference internal" href="aginity-pro/source/docs/connections/configure_connections.html">Configuring Connections in Aginity Team</a></li>
<li class="toctree-l1"><a class="reference internal" href="aginity-pro/source/docs/Object_Browser/using_browser.html">Using the Database Explorer in Aginity Team</a></li>
......
This diff is collapsed.
Subproject commit edc4850cec619e00e04d8a046cebaab22ed04d54
Subproject commit 423ed71e3d745d59b032706670ac381fb01bca73
#!/bin/bash
###############################################################################
# Collect some variables
###############################################################################
# Set the date format for backup name
NOW=$(date +"%m_%d_%Y")
# Backup destination and filename
DESTINATION="/tmp/aginity_backup_$NOW.zip"
# Path to H2 jar file
H2PATH="/opt/h2/bin/h2-1.4.199.jar"
#Path to the Aginity Team database
DBPATH="/root/.local/share/aginity-pro/aginity_pro.db"
# Encryption token from the initial installation of Aginity Team
TOKEN="PiMQJx5KoTMI5ipVadTDXzS9kqxit804"
###############################################################################
# Stop Aginity Team
###############################################################################
systemctl stop aginityteam
###############################################################################
# Run the bachkup command
###############################################################################
java -cp $H2PATH org.h2.tools.Script -url "jdbc:h2:$DBPATH;cipher=AES" -user sa -password "$TOKEN " -script $DESTINATION -options compression zip &
BACKUP_PID=$!
while kill -0 $BACKUP_PID> /dev/null 2>&1 ; do
echo "Starting backup to $DESTINATION"
sleep 1
done
###############################################################################
# Start Aginity Team
###############################################################################
systemctl start aginityteam
......@@ -2,9 +2,14 @@
********************************************************
Installing the Catalog Server for |var_product_name|
Administering |var_product_name|
********************************************************
Installing Aginity Team
=========================
Installing team consists of accessing and setting up an environment based on an Ubuntu O/S. You can either do this on an existing Ubuntu Server or set up a Virtual Machine that will host the shared catalog database and Team application server.
If you have not yet done so download the software from `here <https://www.aginity.com/pricing/>`_.
......@@ -12,7 +17,7 @@ If you have not yet done so download the software from `here <https://www.aginit
Once you register and download the software you can begin the installation process. Upon registration you the software will automatically download. The software should be titled **aginity-team-<version#>-amd64.deb**.
Pre-Requisites and Getting to a Server
==========================================
------------------------------------------
Team is installed on an Ubuntu Server or Virtual Machine environment. The machine Ubuntu is installed on must meet the following requirements
......@@ -41,7 +46,7 @@ If you would prefer, we are happy to schedule a free install for you. Please cl
`Click here to schedule an install with an Aginity Consultant <https://outlook.office365.com/owa/calendar/Aginity@aginity365.onmicrosoft.com/bookings/s/8FDfJOeuUUa7UehVlqSdkg2>`_
The Installation Process
=========================
---------------------------
The following steps should be executed in order
......@@ -105,7 +110,7 @@ You will be asked for the following information
Starting Aginity Team Server
================================
------------------------------------
**Step 5:** You are now ready to start |var_product_name|
......@@ -123,7 +128,7 @@ You can check if |var_product_name| is running by issuing this command
Accessing |var_product_name| for the First Time
=================================================
-----------------------------------------------------
**Step 6:** Step 6: Open browser and navigate to https://<ip or team server name>:8080/login. You will see the following image
......@@ -161,7 +166,7 @@ Accessing |var_product_name| for the First Time
Stopping |var_product_name| Services
=======================================
----------------------------------------
Log in as the team user and issue the following command
......@@ -175,3 +180,136 @@ Log in as the team user and issue the following command
.. seealso::
:ref:`Add Connections <newconn>`
Upgrading |var_product_name|
========================================================
Upgrading team consists of logging into the Team server, downloading the latest update and applying it from the command line.
For clarities sake when we refer to **aginity-team-<version#>-amd64.deb** we purposely leave version# generic. Each upgrade will have a different number associated with it.
.. warning::
It is important to take a backup of both your encryption key for the Team catalog and to do a `Backing Up or Restoring Team Catalog`_ before upgrading. This way if anything goes wrong you will not use your catalog.
It is also recommended to do a :ref:`manual export <manexport>` of your catalog from time to time.
You can get the encryption key using the command below.
.. code-block:: bash
sudo cat /etc/aginity-team/service.conf
Step 1: Logging into Team Server
----------------------------------
SSH into the Team server as an administrator.
.. note::
Typically you will log in as an account other than root and then you will be using the sudo command
Step 2: Check to see if Team is Currently Running and then Shut it Down
---------------------------------------------------------------------------
Issue the command below to check the status of the Team service
.. code-block:: bash
sudo systemctl status aginity-team
If Team is running shut it down by issuing this command
.. code-block:: bash
sudo systemctl stop aginity-team
.. note::
It is always a good idea to run the status check again to make sure Team has been shut down.
Step 3: Download the Latest Version of Aginity Team
------------------------------------------------------
Using the wget command you can download the latest version as shown below.
.. code-block:: bash
wget http://repository.aginity.com.s3.amazonaws.com/AginityTeam/aginity-team-<version#>-amd64.deb
Step 4: Upgrading the Software
----------------------------------
Run the upgrade process by issuing this command.
.. code-block:: bash
sudo dpkg -i aginity-team
When presented with the menu shown in the image below hit "N" to tell the software to keep the catalog as is.
.. image:: ../../team_images/AginityTeamUpdate.png
:scale: 80
:align: center
:alt: Post Install
Step 5: Restart Aginity Team
---------------------------------
Restart the server by issuing this command.
.. code-block:: bash
sudo systemctl start aginity-team
.. _backup:
Backing Up or Restoring Team Catalog
===================================================
We have provided two files listed and described below which will allow you to automate or manually backup and restore your |var_product_name| catalog.
Backup Script
-------------
The backup script :download:`backup.sh <backup.sh>` will perform and compress a backup of the |var_product_name| Catalog to the /tmp/ directory on your O/S. It will append the date to the end of the file created and should be named in this pattern. **aginity_backup_%m_%d_%Y.zip**
.. note::
Before running the backup.sh script you will need to edit it and provide the following variables.
* DESTINATION ~ if you do not want to use the default /tmp/
* TOKEN ~ this value is the encryption key for the database. To find out the value of it run this command.
.. code-block:: bash
sudo cat /etc/aginity-team/service.conf
* H2PATH ~ Unless you modified the installation directory from the default you should not need to change this.
* DBPATH ~ Unless you modified the installation directory from the default you should not need to change this.
When running a backup the |var_product_name| server process will be stopped then restarted when complete.
.. seealso::
If you want to schedule the backup and automate it we recommend scheduling using Crontab: `Crontab Reference Guide <https://linuxconfig.org/linux-crontab-reference-guide>`_
Restore Script
-----------------
To restore to an instance of the backup follow these instructions.
You'll need to set the variables within the restore.sh to match what is in the backup.sh.
First download the restore script :download:`restore.sh <restore.sh>`. Next you will provide the file name of the backup you want to restore in the
* SOURCE variable.
Now run the script and it will automatically re-start |var_product_name| when complete.
#!/bin/bash
###############################################################################
# Collect some variables
###############################################################################
# Backup location and filename
SOURCE="/tmp/aginity_backup_07_01_2019.zip"
# Path to H2 jar file
H2PATH="/opt/h2/bin/h2-1.4.199.jar"
#Path to the Aginity Team database
DBPATH="/root/.local/share/aginity-pro/aginity_pro.db"
# Encryption token from the initial installation of Aginity Team
TOKEN="PiMQJx5KoTMI5ipVadTDXzS9kqxit804"
###############################################################################
# Stop the running service to release the lock on the database
###############################################################################
systemctl stop aginityteam
###############################################################################
# Run the bachkup command
###############################################################################
java -cp $H2PATH org.h2.tools.RunScript -url "jdbc:h2:$DBPATH;cipher=AES" -user sa -password "$TOKEN " -script $SOURCE -options compression zip &
BACKUP_PID=$!
while kill -0 $BACKUP_PID> /dev/null 2>&1 ; do
echo "Starting restore of $SOURCE"
sleep 1
done
###############################################################################
# Start Aginity Team
###############################################################################
systemctl start aginityteam