# 1 - Backup on Plugin Node V2.0

In Plugin Node 2.0, the following four steps are carried out:

* 1.1 Generate and Export Node Address Keystore File
* 1.2 Configure Backup Directory and Set Permissions for Plugin Node V2.0
* 1.3 Save Essential Files in the Backup Directory
* 1.4 Transfer Backup Locally Using SFTP or Other Methods

<mark style="color:red;">**1.1 Generate and Export Node Address Keystore File**</mark>

The command outputs the node address keystore file to the home directory.

```
cd ~/pluginV2Install/
```

```
./pli_node_scripts.sh keys
```

<mark style="color:red;">**1.2 Configure Backup Directory and Set Permissions for Plugin Node V2.0**</mark>

Now, let's execute the setup script to verify that the backup directory and permissions are correctly configured.

```
./_plinode_setup_bkup.sh
```

<mark style="color:red;">**1.3 Save Essential Files in the Backup Directory**</mark>

Before upgrading to Plugin Node 2.4, it is advisable to complete a full backup in Plugin Node 2.0 using commands (1-3-1). Additionally, create a directory named originals/pluginV2 within the /plinode\_backups/ directory and copy the necessary files from Plugin Node 2.0 using commands (1-3-2).

```
cd ~/pluginV2Install/  
```

```
./_plinode_backup.sh -full
```

* Executes the \_plinode\_backup.sh -full script to create a complete backup of Plugin Node 2.0

```
mkdir -p /plinode_backups/originals/pluginV2 &&\ 
cd ~/pluginV2/ && cp -u ~/pluginV2/apicredentials.txt config.toml secrets.toml /plinode_backups/originals/pluginV2/ && \
cd ~ && cp -u ~/plinode_$(hostname -f).vars plinode_$(hostname -f)_keys*.json /plinode_backups/originals/pluginV2/ && \
tree -a /plinode_backups/ 
```

* Creates a backup directory (/plinode\_backups/originals/pluginV2).
* Copies essential configuration files (apicredentials.txt, config.toml, secrets.toml).
* Backs up node-specific files (plinode\_$(hostname -f).vars, key JSON files).
* Verifies the backup structure using the tree command.

```
cp ~/plinode_$(hostname -f).vars /plinode_backups/plinode_V2.vars
cp $(ls -t ~/plinode_$(hostname -f)_keys_* | head -n 1) /plinode_backups/plinode_V2_keys.json
grep "Keystore\s*=" ~/pluginV2/secrets.toml | sed "s/.*Keystore\s*=\s*'//;s/'$//" > /plinode_backups/.env.password
tree -a /plinode_backups/

```

* Copies the latest node variable and key files to /plinode\_backups/.
* Extracts the keystore password from secrets.toml and saves it securely.
* Displays the directory structure for verification.

<mark style="color:red;">**1.4 Transfer Backup Locally Using SFTP or Other Methods**</mark>

Before upgrading, ensure all necessary files are backed up from your server to your local machine. This step is crucial for restoring Plugin Node settings after migrating to Ubuntu 24.04.

Using an SFTP Client (Turmius Example)

A convenient way to transfer files is by using an SFTP client like Turmius, which provides an intuitive GUI for seamless file transfers between your server and local machine.

Steps to Back Up Using Turmius:

* Open Turmius and connect to your server via SFTP.
* Navigate to the /plinode\_backups/ directory on the server.
* Select the necessary backup files and download them to a local directory (e.g., C:\Users\YourName\plinode\_backups).
* Verify that all files have been successfully downloaded before proceeding with the upgrade.

The following screenshot demonstrates the backup process using Turmius:

<img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcanuTUoOszA3SdiI5qap0qIrY3W-kZVBBhsv8f9S2hh5QTwIPo_2UMxibASy5fP2CThirvgVVi8wNsQElo8S1LihWgBHU6qpYKSYPxH22UcKurivH3RYULWEAH9YbCSP4D36dY?key=mn_fIPfVH025DNDvRj6RUVtQ" alt="" data-size="original">

<br>

<br>

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.goplugin.co/migrating-from-plugin-node-v2-to-v2.4-without-changing-the-node-address/1-backup-on-plugin-node-v2.0.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
