Projekt

Allgemein

Profil

ERPNext14 » Historie » Version 11

Jeremias Keihsler, 07.02.2023 23:14

1 1 Jeremias Keihsler
h1. ERPNext 14
2
3
h2. Bitnami based on Debian 11
4
5
out of the box ERPNext is installed. This describes what else can/needs to be done:
6
7
h3. convert VirtualBox-ova to be used with KVM
8
9
untar @.ova@
10
11
<pre><code class="shell">
12
tar xvf bitnami-erpnext-14.11.0-0-linux-vm-debian-11-x86_64-nami.ova
13
</code></pre>
14
15
convert @.vmdk@ to @.qcow2@ while showing 'progress'
16
17
<pre><code class="shell">
18
qemu-img convert -p -f vmdk -O qcow2 \
19
  bitnami-erpnext-14.11.0-0-linux-vm-debian-11-x86_64-nami-disk1.vmdk \
20
  bitnami-erpnext-14.11.0-0-linux-vm-debian-11-x86_64-nami-disk1.qcow2
21
</code></pre>
22
23
this is a sample virsh dumpxml with a bridged interface
24
25
<pre><code class="xml">
26
<domain type="kvm" id="7">
27 2 Jeremias Keihsler
  <name>bitnami_erpnext</name>
28
  <uuid>acf57964-b3d8-4148-9391-b4552a72a32c</uuid>
29
  <metadata>
30
    <libosinfo:libosinfo>
31
    <libosinfo:os id="http://debian.org/debian/11"/>
32
    </libosinfo:libosinfo>
33
  </metadata>
34
  <memory unit="KiB">4194304</memory>
35
  <currentMemory unit="KiB">4194304</currentMemory>
36
  <vcpu placement="static">2</vcpu>
37
  <resource>
38
    <partition>/machine</partition>
39
  </resource>
40
  <os>
41
    <type arch="x86_64" machine="pc-i440fx-rhel7.0.0">hvm</type>
42
    <boot dev="hd"/>
43
    <bootmenu enable="yes"/>
44
  </os>
45
  <features>
46
    <acpi/>
47
    <apic/>
48
  </features>
49
  <cpu mode="host-passthrough" check="none">
50
    <topology sockets="1" cores="1" threads="2"/>
51
  </cpu>
52
  <clock offset="utc">
53
    <timer name="rtc" tickpolicy="catchup"/>
54
    <timer name="pit" tickpolicy="delay"/>
55
    <timer name="hpet" present="no"/>
56
  </clock>
57
  <on_poweroff>destroy</on_poweroff>
58
  <on_reboot>restart</on_reboot>
59
  <on_crash>destroy</on_crash>
60
  <pm>
61
    <suspend-to-mem enabled="no"/>
62
    <suspend-to-disk enabled="no"/>
63
  </pm>
64
  <devices>
65
    <emulator>/usr/libexec/qemu-kvm</emulator>
66
    <disk type="file" device="disk">
67
      <driver name="qemu" type="qcow2"/>
68
      <source file="/../libvirt/images/bitnami-erpnext-14.11.0-0-linux-vm-debian-11-x86_64-nami-disk1.qcow2"/>
69
      <backingStore/>
70
      <target dev="vdb" bus="virtio"/>
71
      <alias name="virtio-disk1"/>
72
      <address type="pci" domain="0x0000" bus="0x00" slot="0x0b" function="0x0"/>
73
    </disk>
74
    <controller type="usb" index="0" model="ich9-ehci1">
75
      <alias name="usb"/>
76
      <address type="pci" domain="0x0000" bus="0x00" slot="0x05" function="0x7"/>
77
    </controller>
78
    <controller type="usb" index="0" model="ich9-uhci1">
79
      <alias name="usb"/>
80
      <master startport="0"/>
81
      <address type="pci" domain="0x0000" bus="0x00" slot="0x05" function="0x0" multifunction="on"/>
82
    </controller>
83
    <controller type="usb" index="0" model="ich9-uhci2">
84
      <alias name="usb"/>
85
      <master startport="2"/>
86
      <address type="pci" domain="0x0000" bus="0x00" slot="0x05" function="0x1"/>
87
    </controller>
88
    <controller type="usb" index="0" model="ich9-uhci3">
89
      <alias name="usb"/>
90
      <master startport="4"/>
91
      <address type="pci" domain="0x0000" bus="0x00" slot="0x05" function="0x2"/>
92
    </controller>
93
    <controller type="pci" index="0" model="pci-root">
94
      <alias name="pci.0"/>
95
    </controller>
96
    <controller type="virtio-serial" index="0">
97
      <alias name="virtio-serial0"/>
98
      <address type="pci" domain="0x0000" bus="0x00" slot="0x06" function="0x0"/>
99
    </controller>
100
    <controller type="scsi" index="0" model="virtio-scsi">
101
      <alias name="scsi0"/>
102
      <address type="pci" domain="0x0000" bus="0x00" slot="0x0a" function="0x0"/>
103
    </controller>
104
    <interface type="bridge">
105
      <mac address="52:54:00:29:00:87"/>
106
      <source bridge="br0"/>
107
      <target dev="vnet1"/>
108
      <model type="virtio"/>
109
      <alias name="net0"/>
110
      <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x0"/>
111
    </interface>
112
    <serial type="pty">
113
      <source path="/dev/pts/9"/>
114
      <target type="isa-serial" port="0">
115
        <model name="isa-serial"/>
116
      </target>
117
      <alias name="serial0"/>
118
    </serial>
119
    <console type="pty" tty="/dev/pts/9">
120
      <source path="/dev/pts/9"/>
121
      <target type="serial" port="0"/>
122
      <alias name="serial0"/>
123
    </console>
124
    <channel type="unix">
125
      <source mode="bind" path="/var/lib/libvirt/qemu/channel/target/domain-7-bitnami_erpnext/org.qemu.guest_agent.0"/>
126
      <target type="virtio" name="org.qemu.guest_agent.0" state="disconnected"/>
127
      <alias name="channel0"/>
128
      <address type="virtio-serial" controller="0" bus="0" port="1"/>
129
    </channel>
130
    <channel type="spicevmc">
131
      <target type="virtio" name="com.redhat.spice.0" state="disconnected"/>
132
      <alias name="channel1"/>
133
      <address type="virtio-serial" controller="0" bus="0" port="2"/>
134
    </channel>
135
    <input type="tablet" bus="usb">
136
      <alias name="input0"/>
137
      <address type="usb" bus="0" port="1"/>
138
    </input>
139
    <input type="mouse" bus="ps2">
140
      <alias name="input1"/>
141
    </input>
142
    <input type="keyboard" bus="ps2">
143
      <alias name="input2"/>
144
    </input>
145
    <graphics type="spice" port="5901" autoport="yes" listen="127.0.0.1">
146
      <listen type="address" address="127.0.0.1"/>
147
    </graphics>
148
    <sound model="ich6">
149
      <alias name="sound0"/>
150
      <address type="pci" domain="0x0000" bus="0x00" slot="0x04" function="0x0"/>
151
    </sound>
152
    <video>
153
      <model type="qxl" ram="65536" vram="65536" vgamem="16384" heads="1" primary="yes"/>
154
      <alias name="video0"/>
155
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x0"/>
156
    </video>
157
    <redirdev bus="usb" type="spicevmc">
158
      <alias name="redir0"/>
159
      <address type="usb" bus="0" port="2"/>
160
    </redirdev>
161
    <redirdev bus="usb" type="spicevmc">
162
      <alias name="redir1"/>
163
      <address type="usb" bus="0" port="3"/>
164
    </redirdev>
165
    <memballoon model="virtio">
166
      <alias name="balloon0"/>
167
      <address type="pci" domain="0x0000" bus="0x00" slot="0x08" function="0x0"/>
168
    </memballoon>
169
    <rng model="virtio">
170
      <backend model="random">/dev/urandom</backend>
171
      <alias name="rng0"/>
172
      <address type="pci" domain="0x0000" bus="0x00" slot="0x09" function="0x0"/>
173
    </rng>
174
  </devices>
175
  <seclabel type="dynamic" model="selinux" relabel="yes">
176
    <label>system_u:system_r:svirt_t:s0:c328,c377</label>
177
    <imagelabel>system_u:object_r:svirt_image_t:s0:c328,c377</imagelabel>
178
  </seclabel>
179
  <seclabel type="dynamic" model="dac" relabel="yes">
180
    <label>+107:+107</label>
181
    <imagelabel>+107:+107</imagelabel>
182
  </seclabel>
183 1 Jeremias Keihsler
</domain>
184
</code></pre>
185
186 2 Jeremias Keihsler
h3. activate SSH-Server
187 1 Jeremias Keihsler
188 2 Jeremias Keihsler
taken from https://docs.bitnami.com/virtual-machine/faq/get-started/enable-ssh/
189 1 Jeremias Keihsler
190 2 Jeremias Keihsler
<pre><code class="shell">
191
sudo rm -f /etc/ssh/sshd_not_to_be_run
192
sudo systemctl enable ssh
193
sudo systemctl start ssh
194
</code></pre>
195 1 Jeremias Keihsler
196 3 Jeremias Keihsler
h3. ... password-based SSH auth (are you serious?)
197
198
maybe ok for testing .. 
199
taken from https://docs.bitnami.com/virtual-machine/faq/get-started/enable-ssh-password/
200
201
edit @/etc/ssh/sshd_config@ and add/modify the following line
202
203
<pre><code class="shell">
204
  PasswordAuthentication yes
205
</code></pre>
206
207
restart SSH server
208
209
<pre><code class="shell">
210
  sudo /etc/init.d/ssh force-reload
211
  sudo /etc/init.d/ssh restart
212
</code></pre>
213
214 4 Jeremias Keihsler
h3. modify keyboard layout
215
216
taken from https://docs.bitnami.com/virtual-machine/faq/configuration/configure-keyboard/
217
218
<pre><code class="shell">
219
  sudo apt-get install keyboard-configuration console-setup
220
  sudo dpkg-reconfigure keyboard-configuration
221
  sudo systemctl restart keyboard-setup
222
</code></pre>
223
224 5 Jeremias Keihsler
h3. alias ll
225
226 6 Jeremias Keihsler
for everyone .. taken from https://www.server-world.info/en/note?os=Debian_11&p=initial_conf&f=2
227
228 5 Jeremias Keihsler
<pre><code class="shell">
229
sudo vim /etc/profile.d/command_alias.sh
230
</code></pre>
231
232
<pre>
233
# create new file
234
# add alias you'd like to set
235
alias ll='ls $LS_OPTIONS -l'
236
# alias l='ls $LS_OPTIONS -lA'
237
# alias rm='rm -i'
238
# alias cp='cp -i'
239
# alias mv='mv -i'
240
</pre>
241
242
<pre><code class="shell">
243
source /etc/profile.d/command_alias.sh
244
</code></pre>
245
246 7 Jeremias Keihsler
h3. migrate ERPNext to new server
247 1 Jeremias Keihsler
248 7 Jeremias Keihsler
h4. backup
249
250 5 Jeremias Keihsler
<pre><code class="shell">
251
cd /opt/bitnami/erpnext/frappe-bench
252 1 Jeremias Keihsler
bench backup-all-sites
253 7 Jeremias Keihsler
</code></pre>
254
255
files are saved very deep
256
257
<pre><code class="shell">
258
cd /opt/bitnami/erpnext/frappe-bench/sites/erpnext/private/backups/
259
</code></pre>
260
261
h4. restore
262
263
copy files to new server into @/home/bitnami@
264
265
<pre><code class="shell">
266
gunzip yyyymmdd_hhmmss-erpnext-database.sql.gz
267
</code></pre>
268
269 1 Jeremias Keihsler
connect to MariaDB (password is the same as application-password)
270 8 Jeremias Keihsler
taken from https://docs.bitnami.com/general/apps/erpnext/get-started/connect-mariadb/
271 7 Jeremias Keihsler
272
<pre><code class="shell">
273
mysql -u root -p
274
</code></pre>
275
276 1 Jeremias Keihsler
<pre><code class="sql">
277
DROP DATABASE bitnami_erpnext;
278 8 Jeremias Keihsler
\q
279
</code></pre>
280
281 9 Jeremias Keihsler
*as of 2023-02-07 restore seems not to work following the instructions*
282
283 8 Jeremias Keihsler
<pre><code class="shell">
284
cd /opt/bitnami/erpnext/frappe-bench/
285 5 Jeremias Keihsler
bench restore /home/bitnami
286
</code></pre>
287 1 Jeremias Keihsler
288
h2. vanilla install based on Ubuntu
289 10 Jeremias Keihsler
290 11 Jeremias Keihsler
h3. backup and load into test-site
291 10 Jeremias Keihsler
292
To create a staging site from a production site backup:
293
294
<pre><code class="shell">
295
cd <frappe/erpnext Verzeichnis>
296
mkdir ~/backup/
297
298
bench --site prod.example.net set-maintenance-mode on
299
bench --site prod.example.net set-config pause_scheduler 1
300
bench --site prod.example.net backup --with-files --compress --backup-path ~/backup/ 
301
# notice: Database Public & Private from stdout
302
bench --site prod.example.net set-maintenance-mode off
303
304
restore into other Staging instance:
305
306
bench new-site staging.example.net
307
bench --site staging.example.net set-maintenance-mode on
308
309
bench --site staging.example.net restore ~/backup/YYYYMMDD_HHMMSS-prod.example.net-database.sql.gz
310
  --with-public-files  ~/backup/YYYYMMDD_HHMMSS-prod.example.net-files.tar.gz
311
  --with-private-files ~/backup/YYYYMMDD_HHMMSS-prod.example.net-private-files.tar.gz
312
  MySQL root password:
313
314
bench --site staging.example.net mute_emails true
315
bench --site staging.example.net set-maintenance-mode off
316
rm -r ~/backup/
317
</code></pre>