Fix code-blocks formatting, headings and grammar
[aai/aai-common.git] / docs / platform / Getting Started / How_to_AAI_data_snapshot_and_restore_in_ONAP_1_1.rst
1 .. contents::
2    :depth: 3
3 ..
4
5 How to create a snapshot and restore AAI data in ONAP 1.1
6 ==========================================================
7
8 1. Check the containers that are running and get the container name for the resources microservice, as this container contains both the data snapshot and restore scripts.
9
10 2. If the deployment was followed properly, then the container name will be:
11
12    .. code-block:: bash
13
14     testconfig\_aai-resources.api.simpledemo.openecomp.org\_1
15
16 3. Run the following command to save the current snapshot of your data:
17
18    .. code-block:: bash
19    
20     docker exec -u aaiadmin -it
21     testconfig\_aai-resources.api.simpledemo.openecomp.org\_1
22     /opt/app/aai-resources/bin/dataSnapshot.sh
23
24 4. After running that command, you should see the following line in the standard output:
25
26    .. code:: bash
27
28     Snapshot written to
29     /opt/app/aai-resources/logs/data/dataSnapshots/dataSnapshot.graphSON.201709221713
30
31 The snapshot location
32 ---------------------
33
34 The file dataSnapshot.graphSON.201709221713 can be found in **/opt/aai/logroot/AAI-RESOURCES/data/dataSnapshots** on the host vm.
35
36 Restoring data form the snapshot
37 --------------------------------
38
39 1. To restore the data from the snapshot, run this command:
40
41    .. code-block:: bash
42
43     docker exec -u aaiadmin -it
44     testconfig\_aai-resources.api.simpledemo.openecomp.org\_1
45     /opt/app/aai-resources/bin/dataRestoreFromSnapshot.sh
46     dataSnapshot.graphSON.201709221713
47
48    The argument to the dataRestoreFromSnapshot.sh is the dataSnapshot graphson file and it only needs the base name and expects to be found in the host vm **/opt/aai/logroot/AAI-RESOURCES/data/dataSnapshots**.
49
50 2. Once the command has run, you will be given a warning of 5 seconds to quit the process, as it will replace whatever you have in your AAI data with the snapshot and **any current data that is not saved into a snapshot will be lost**.