summaryrefslogtreecommitdiff
path: root/docs/misc/bpq-migrate.md
blob: abbb85f5dcb99339da0d2a3a3f19cc4725140fee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# BPQ Migration

If you wish to migrate from a manual installation using binaries either self
built or downloaded directly from G8BPQ, the below should offer you an insight
into the best practises and things to look out for!

There are a few key differences from how the version shipped in Hibbian works
from vanilla LinBPQ! This might require a slight shift in how you approach some
basic commands.

  1. The config file lives in /etc with other system config files
  2. The working/state files live in /opt/oarc/bpq
  3. It is started/stopped with `systemd` instead of directly running the binary
  4. It runs as a dedicated user that you don't use day to day to allow for
better security.

!!! tip

    /opt/oarc/bpq is a reflection of the [OARC](https://oarc.uk) where the
    project grew from and I'm too scared at this point to move files out of
    that folder!

## Stop your existing LinBPQ

Use whatever method you normally use to stop your BPQ. It is best not to move
files around while changes are happening!

## Back everything up

Copy it to a different place, stick it on a USB stick or on a different
machine, but make sure you have another location where everything is in its
current state.

Have everything saved somewhere else so you can put it back in place and move
back to your current approach if you don't like the new one!

## Make note of locations of files

We're particularly interested in bpq32.cfg and the working files. This will be
the directory holding chatconfig.cfg, axipcache.cfg, BPQNODES.dat, DIRMES.SYS.
If you're using the plain binary of bpq I think it just puts all that stuff
beside it.

## Install the Hibbian Repo

Follow the instructions at [../repo](Repo guide) to set up the repo on your
computer.

## Install LinBPQ

To learn more about installing applications on Linux, please see
[../linux.md/#applications-and-repositories](the Linux Guide).

### GUI

Search linbpq in your computer's app store and install it

### Terminal

Run the below in your terminal to install the latest and greatest LinBPQ on
your system:

!!!note "Terminal Command"
	```
	sudo apt install linbpq
	```

Once this has completed, we also need to stop linbpq so we can replace the
files I put in place for a new install:

!!!note "Terminal Command"
    ```
    sudo systemctl stop linbpq
    ```

## Move your files into position
This will all need to be done as root via sudo

### bpq32.cfg

Copy `bpq32.cfg` from wherever it is to `/etc/bpq32.cfg` and update the
persmissions to ensure that the linbpq group can edit the config:

!!! note "Terminal Commands"
    ```
    sudo cp bpq32.cfg /etc/bpq32.cfg
    sudo chown :linbpq /etc/bpq32.cfg
    ```

### Working files

Copy working files and folders from where they are to /opt/oarc/bpq/ and then
update them to be owned by the `linbpq` user and group.

As an example, if all my files live in a bpq folder in my pi's home,

!!! note "Terminal Commands"
    ```
    sudo cp -rf /home/pi/bpq/* /opt/oarc/bpq/
    sudo chown -R linbpq:linbpq /opt/oarc/bpq/
    ```

### Start the new node!

Start your new setup with the below command and see if anything explodes.

The standard way to start your node is now:
!!!note "Terminal Command"
    ```
    sudo systemctl start linbpq
    ```

After a few seconds, I recommend checking to see if everything is running using

!!!note "Terminal Command"
    ```
    sudo systemctl status linbpq
    ```
This is the standard command to see if the system is alive, dead and how it
failed.

If everything is good, it'll say `Active: active (running)` with terminal
output that looks like this:

```
hibby@gb7hib:/etc$ sudo systemctl status linbpq
● linbpq.service - Linbpq systemd service file
     Loaded: loaded (/lib/systemd/system/linbpq.service; enabled; preset:
enabled)
     Active: active (running) since Sat 2024-11-30 20:57:01 UTC; 5s ago
   Main PID: 314200 (linbpq)
      Tasks: 7 (limit: 4395)
     Memory: 4.4M
        CPU: 160ms
     CGroup: /system.slice/linbpq.service
             └─314200 /usr/sbin/linbpq -c /etc -d /opt/oarc/bpq -l /opt/oarc/bpq

Nov 30 20:57:01 gb7hib linbpq[314200]: Config Processed
Nov 30 20:57:01 gb7hib LINBPQ[314200]: Resolving chatupdate.g8bpq.net
Nov 30 20:57:01 gb7hib LINBPQ[314200]: cant open forms dir
/opt/oarc/bpq/Standard_Templates 2 0
Nov 30 20:57:01 gb7hib LINBPQ[314200]: cant open forms dir
/opt/oarc/bpq/Standard Templates 2 0
Nov 30 20:57:01 gb7hib linbpq[314200]: Mail Started
Nov 30 20:57:01 gb7hib LINBPQ[314200]: cant open forms dir
/opt/oarc/bpq/Local_Templates 2 0
Nov 30 20:57:01 gb7hib LINBPQ[314200]: Maint Clock 1733011200 NOW 1733000221
Time to HouseKeeping 10979
Nov 30 20:57:03 gb7hib LINBPQ[314200]: Trying  APRSIS Host 56.244.0.0 (1)
aprsis1.he.fi
Nov 30 20:57:03 gb7hib LINBPQ[314200]: # aprsc 2.1.19-g730c5c0
```

If not all is well, look a little deeper! Scroll the console output with:

!!!note "Terminal Command"
    ```
    sudo journalctl -xeu linbpq
    ```

Have a read and see if there's anything failing noisily.

Failing that, recheck you did the permissions step above, reach out for help
or, worst case, go back to the old system you've backed up and definitely not
deleted or modified!