Projekt

Allgemein

Profil

ERPNext14 » Historie » Version 61

Jeremias Keihsler, 17.10.2023 13:40

1 1 Jeremias Keihsler
h1. ERPNext 14
2
3 41 Jeremias Keihsler
long term goal is to run ERPNext in a podman-pod. Maybe this can be a first stepping stone:
4
https://piotrkrzyzek.com/how-to-setup-self-host-erpnext-in-docker-without-treafik-nginx-only/
5
until then we use Bitnami VMs.
6
7 1 Jeremias Keihsler
h2. Bitnami based on Debian 11
8
9
out of the box ERPNext is installed. This describes what else can/needs to be done:
10
11
h3. convert VirtualBox-ova to be used with KVM
12
13
untar @.ova@
14
15
<pre><code class="shell">
16 52 Jeremias Keihsler
tar xvf bitnami-erpnext-14.44.0-r0-debian-11-x86_64-amd64.ova
17 1 Jeremias Keihsler
</code></pre>
18
19
convert @.vmdk@ to @.qcow2@ while showing 'progress'
20
21
<pre><code class="shell">
22
qemu-img convert -p -f vmdk -O qcow2 \
23 52 Jeremias Keihsler
  bitnami-erpnext-14-14.44.0-r0-debian-11-x86_64-amd64-disk-0.vmdk \
24
  bitnami-erpnext-14-14.44.0-r0-debian-11-x86_64-amd64-disk-0.qcow2
25 1 Jeremias Keihsler
</code></pre>
26
27
this is a sample virsh dumpxml with a bridged interface
28
29
<pre><code class="xml">
30
<domain type="kvm" id="7">
31 2 Jeremias Keihsler
  <name>bitnami_erpnext</name>
32
  <uuid>acf57964-b3d8-4148-9391-b4552a72a32c</uuid>
33
  <metadata>
34
    <libosinfo:libosinfo>
35
    <libosinfo:os id="http://debian.org/debian/11"/>
36
    </libosinfo:libosinfo>
37
  </metadata>
38
  <memory unit="KiB">4194304</memory>
39
  <currentMemory unit="KiB">4194304</currentMemory>
40
  <vcpu placement="static">2</vcpu>
41
  <resource>
42
    <partition>/machine</partition>
43
  </resource>
44
  <os>
45
    <type arch="x86_64" machine="pc-i440fx-rhel7.0.0">hvm</type>
46
    <boot dev="hd"/>
47
    <bootmenu enable="yes"/>
48
  </os>
49
  <features>
50
    <acpi/>
51
    <apic/>
52
  </features>
53
  <cpu mode="host-passthrough" check="none">
54
    <topology sockets="1" cores="1" threads="2"/>
55
  </cpu>
56
  <clock offset="utc">
57
    <timer name="rtc" tickpolicy="catchup"/>
58
    <timer name="pit" tickpolicy="delay"/>
59
    <timer name="hpet" present="no"/>
60
  </clock>
61
  <on_poweroff>destroy</on_poweroff>
62
  <on_reboot>restart</on_reboot>
63
  <on_crash>destroy</on_crash>
64
  <pm>
65
    <suspend-to-mem enabled="no"/>
66
    <suspend-to-disk enabled="no"/>
67
  </pm>
68
  <devices>
69
    <emulator>/usr/libexec/qemu-kvm</emulator>
70
    <disk type="file" device="disk">
71
      <driver name="qemu" type="qcow2"/>
72
      <source file="/../libvirt/images/bitnami-erpnext-14.11.0-0-linux-vm-debian-11-x86_64-nami-disk1.qcow2"/>
73
      <backingStore/>
74
      <target dev="vdb" bus="virtio"/>
75
      <alias name="virtio-disk1"/>
76
      <address type="pci" domain="0x0000" bus="0x00" slot="0x0b" function="0x0"/>
77
    </disk>
78
    <controller type="usb" index="0" model="ich9-ehci1">
79
      <alias name="usb"/>
80
      <address type="pci" domain="0x0000" bus="0x00" slot="0x05" function="0x7"/>
81
    </controller>
82
    <controller type="usb" index="0" model="ich9-uhci1">
83
      <alias name="usb"/>
84
      <master startport="0"/>
85
      <address type="pci" domain="0x0000" bus="0x00" slot="0x05" function="0x0" multifunction="on"/>
86
    </controller>
87
    <controller type="usb" index="0" model="ich9-uhci2">
88
      <alias name="usb"/>
89
      <master startport="2"/>
90
      <address type="pci" domain="0x0000" bus="0x00" slot="0x05" function="0x1"/>
91
    </controller>
92
    <controller type="usb" index="0" model="ich9-uhci3">
93
      <alias name="usb"/>
94
      <master startport="4"/>
95
      <address type="pci" domain="0x0000" bus="0x00" slot="0x05" function="0x2"/>
96
    </controller>
97
    <controller type="pci" index="0" model="pci-root">
98
      <alias name="pci.0"/>
99
    </controller>
100
    <controller type="virtio-serial" index="0">
101
      <alias name="virtio-serial0"/>
102
      <address type="pci" domain="0x0000" bus="0x00" slot="0x06" function="0x0"/>
103
    </controller>
104
    <controller type="scsi" index="0" model="virtio-scsi">
105
      <alias name="scsi0"/>
106
      <address type="pci" domain="0x0000" bus="0x00" slot="0x0a" function="0x0"/>
107
    </controller>
108
    <interface type="bridge">
109
      <mac address="52:54:00:29:00:87"/>
110
      <source bridge="br0"/>
111
      <target dev="vnet1"/>
112
      <model type="virtio"/>
113
      <alias name="net0"/>
114
      <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x0"/>
115
    </interface>
116
    <serial type="pty">
117
      <source path="/dev/pts/9"/>
118
      <target type="isa-serial" port="0">
119
        <model name="isa-serial"/>
120
      </target>
121
      <alias name="serial0"/>
122
    </serial>
123
    <console type="pty" tty="/dev/pts/9">
124
      <source path="/dev/pts/9"/>
125
      <target type="serial" port="0"/>
126
      <alias name="serial0"/>
127
    </console>
128
    <channel type="unix">
129
      <source mode="bind" path="/var/lib/libvirt/qemu/channel/target/domain-7-bitnami_erpnext/org.qemu.guest_agent.0"/>
130
      <target type="virtio" name="org.qemu.guest_agent.0" state="disconnected"/>
131
      <alias name="channel0"/>
132
      <address type="virtio-serial" controller="0" bus="0" port="1"/>
133
    </channel>
134
    <channel type="spicevmc">
135
      <target type="virtio" name="com.redhat.spice.0" state="disconnected"/>
136
      <alias name="channel1"/>
137
      <address type="virtio-serial" controller="0" bus="0" port="2"/>
138
    </channel>
139
    <input type="tablet" bus="usb">
140
      <alias name="input0"/>
141
      <address type="usb" bus="0" port="1"/>
142
    </input>
143
    <input type="mouse" bus="ps2">
144
      <alias name="input1"/>
145
    </input>
146
    <input type="keyboard" bus="ps2">
147
      <alias name="input2"/>
148
    </input>
149
    <graphics type="spice" port="5901" autoport="yes" listen="127.0.0.1">
150
      <listen type="address" address="127.0.0.1"/>
151
    </graphics>
152
    <sound model="ich6">
153
      <alias name="sound0"/>
154
      <address type="pci" domain="0x0000" bus="0x00" slot="0x04" function="0x0"/>
155
    </sound>
156
    <video>
157
      <model type="qxl" ram="65536" vram="65536" vgamem="16384" heads="1" primary="yes"/>
158
      <alias name="video0"/>
159
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x0"/>
160
    </video>
161
    <redirdev bus="usb" type="spicevmc">
162
      <alias name="redir0"/>
163
      <address type="usb" bus="0" port="2"/>
164
    </redirdev>
165
    <redirdev bus="usb" type="spicevmc">
166
      <alias name="redir1"/>
167
      <address type="usb" bus="0" port="3"/>
168
    </redirdev>
169
    <memballoon model="virtio">
170
      <alias name="balloon0"/>
171
      <address type="pci" domain="0x0000" bus="0x00" slot="0x08" function="0x0"/>
172
    </memballoon>
173
    <rng model="virtio">
174
      <backend model="random">/dev/urandom</backend>
175
      <alias name="rng0"/>
176
      <address type="pci" domain="0x0000" bus="0x00" slot="0x09" function="0x0"/>
177
    </rng>
178
  </devices>
179
  <seclabel type="dynamic" model="selinux" relabel="yes">
180
    <label>system_u:system_r:svirt_t:s0:c328,c377</label>
181
    <imagelabel>system_u:object_r:svirt_image_t:s0:c328,c377</imagelabel>
182
  </seclabel>
183
  <seclabel type="dynamic" model="dac" relabel="yes">
184
    <label>+107:+107</label>
185
    <imagelabel>+107:+107</imagelabel>
186
  </seclabel>
187 1 Jeremias Keihsler
</domain>
188
</code></pre>
189
190 48 Jeremias Keihsler
h3. modify keyboard layout
191
192
taken from https://docs.bitnami.com/virtual-machine/faq/configuration/configure-keyboard/
193
194
<pre><code class="shell">
195 54 Jeremias Keihsler
sudo apt update
196
sudo apt install keyboard-configuration console-setup
197 48 Jeremias Keihsler
</code></pre>
198
199 12 Jeremias Keihsler
h3. set static IP address
200
201
taken from https://docs.bitnami.com/virtual-machine/faq/configuration/configure-static-address/
202
203
check link and current IPs
204
205
<pre><code class="shell">
206
sudo ifconfig
207
</code></pre>
208
209
<pre><code class="shell">
210
cd /etc/systemd/network
211
sudo touch 25-wired.network
212
</code></pre>
213
214
add following lines
215
216
<pre>
217
[Match]
218 30 Jeremias Keihsler
Name=ens3
219 12 Jeremias Keihsler
220
[Network]
221
Address=HOST-IP-ADDRESS
222
Gateway=GATEWAY-IP-ADDRESS
223
</pre>
224
225
restart service
226
227
<pre><code class="shell">
228 55 Jeremias Keihsler
sudo systemctl restart systemd-networkd
229 30 Jeremias Keihsler
sudo systemctl enable systemd-networkd
230 12 Jeremias Keihsler
</code></pre>
231
232 2 Jeremias Keihsler
h3. activate SSH-Server
233 1 Jeremias Keihsler
234 2 Jeremias Keihsler
taken from https://docs.bitnami.com/virtual-machine/faq/get-started/enable-ssh/
235 1 Jeremias Keihsler
236 2 Jeremias Keihsler
<pre><code class="shell">
237
sudo rm -f /etc/ssh/sshd_not_to_be_run
238
sudo systemctl enable ssh
239
sudo systemctl start ssh
240
</code></pre>
241 1 Jeremias Keihsler
242 3 Jeremias Keihsler
h3. ... password-based SSH auth (are you serious?)
243
244
maybe ok for testing .. 
245
taken from https://docs.bitnami.com/virtual-machine/faq/get-started/enable-ssh-password/
246
247
edit @/etc/ssh/sshd_config@ and add/modify the following line
248
249
<pre><code class="shell">
250
  PasswordAuthentication yes
251
</code></pre>
252
253
restart SSH server
254
255
<pre><code class="shell">
256 35 Jeremias Keihsler
  sudo systemctl restart ssh
257 28 Jeremias Keihsler
</code></pre>
258
259 4 Jeremias Keihsler
h3. ... and of course cert-based ..
260
261
from the remote machine just
262
263
<pre><code class="shell">
264 36 Jeremias Keihsler
ssh-copy-id bitnami@example.com
265 31 Jeremias Keihsler
</code></pre>
266
267 56 Jeremias Keihsler
h3. install some little tools
268
269
<pre><code class="shell">
270 60 Jeremias Keihsler
sudo apt install vim htop rsync wget
271 56 Jeremias Keihsler
</code></pre>
272
273 5 Jeremias Keihsler
h3. alias ll
274
275 6 Jeremias Keihsler
for everyone .. taken from https://www.server-world.info/en/note?os=Debian_11&p=initial_conf&f=2
276
277 5 Jeremias Keihsler
<pre><code class="shell">
278
sudo vim /etc/profile.d/command_alias.sh
279
</code></pre>
280
281
<pre>
282
# create new file
283
# add alias you'd like to set
284
alias ll='ls $LS_OPTIONS -l'
285
# alias l='ls $LS_OPTIONS -lA'
286
# alias rm='rm -i'
287
# alias cp='cp -i'
288
# alias mv='mv -i'
289
</pre>
290
291
<pre><code class="shell">
292
source /etc/profile.d/command_alias.sh
293
</code></pre>
294
295 13 Jeremias Keihsler
h3. Install the Wkhtmltopdf extension
296
297
taken from https://docs.bitnami.com/aws/apps/erpnext/configuration/install-wkhtmltopdf/
298
299 59 Jeremias Keihsler
alternatively it should be possible to install via something like @bench install wkhtmltopdf@ but it's not working as of 2023-10-17
300 42 Jeremias Keihsler
301 1 Jeremias Keihsler
<pre><code class="shell">
302 59 Jeremias Keihsler
# cd /opt/bitnami/erpnext/frappe-bench/apps/erpnext/
303
# . ../../../venv/bin/activate
304
# pip install ansible
305
# sudo bench install wkhtmltopdf
306 58 Jeremias Keihsler
</code></pre>
307
308
<pre><code class="shell">
309
find /opt/bitnami/common/bin -name fc-* | sudo xargs -I {} mv {} {}.bak
310
sudo apt install zlib1g fontconfig libxrender1 libfreetype6 libxext6 libx11-6
311
</code></pre>
312
313 14 Jeremias Keihsler
Download the latest version of the package from the Wkhtmltopdf project releases page and install it. Replace the X.Y.Z and PLATFORM placeholders with the correct version and platform strings from the release filename.
314
315
https://github.com/wkhtmltopdf/wkhtmltopdf/releases/
316
317 15 Jeremias Keihsler
as of 2023-02-16 https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.buster_amd64.deb
318
319 14 Jeremias Keihsler
<pre><code class="shell">
320 13 Jeremias Keihsler
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/X.Y.Z/wkhtmltox_X.Y.Z.PLATFORM.deb
321
sudo apt install -f ./wkhtmltox_X.Y.Z.PLATFORM.deb
322
sudo /opt/bitnami/ctlscript.sh restart
323
</code></pre>
324
325 21 Jeremias Keihsler
h4. install alternative way?
326
327
without QT but with virtual X11-Server
328
329
https://packages.debian.org/bullseye/xvfb
330
https://installati.one/debian/11/wkhtmltopdf/
331
https://packages.debian.org/stable/wkhtmltopdf
332
333
needs some testing
334
335 23 Jeremias Keihsler
h4. Troubleshooting PDF formating issues
336 18 Jeremias Keihsler
337
taken from https://discuss.frappe.io/t/pdf-alignment-problem/34425/7
338
339
set the IP-adr. in @site_config.json@
340
341
<pre><code class="shell">
342
vim /opt/bitnami/erpnext/frappe-bench/sites/erpnext/site_config.json
343
</code></pre>
344
345 24 Jeremias Keihsler
replace @http:localhost@ with the @https://hostname-ip:443@
346 18 Jeremias Keihsler
347
<pre>
348 24 Jeremias Keihsler
 "host_name": "https://192.168.41.131:443"
349 18 Jeremias Keihsler
</pre>
350
351 20 Jeremias Keihsler
h4. Troubleshooting (is just a reminder ... I stumbled across but didn't do it, as there were no related issues yet)
352 13 Jeremias Keihsler
353
If you experience issues with display resolution on Linux platforms, they could be related to the xfonts-75dpi or xfonts-100dpi packages. Uninstall them by executing:
354
355
<pre><code class="shell">
356
sudo dpkg --remove --force-depends xfonts-75dpi
357
sudo dpkg --remove --force-depends xfonts-100dpi
358 18 Jeremias Keihsler
</code></pre>
359 13 Jeremias Keihsler
360 61 Jeremias Keihsler
h3. Troubleshooting post migration
361
362
h4. upload attachments fail (private/public files)
363
364
<pre><code class="shell">
365
sudo chmod g+w /opt/bitnami/erpnext/frappe-bench/sites/erpnext/private/files
366
sudo chown bitnami:daemon /opt/bitnami/erpnext/frappe-bench/sites/erpnext/private/files/*
367
sudo chmod g+w /opt/bitnami/erpnext/frappe-bench/sites/erpnext/public/files
368
sudo chown bitnami:daemon /opt/bitnami/erpnext/frappe-bench/sites/erpnext/public/files/*
369
</code></pre>
370
371
h4. sending mails fail
372
373
encryption key needs to transfered from original installation
374
375
<pre><code class="shell">
376
sudo vim /opt/bitnami/erpnext/frappe-bench/sites/erpnext/site_config.json
377
</code></pre>
378
379
<pre>
380
 "encryption_key": "super_lksdjfdlskfdlskf_secret",
381
</pre>
382
383
384
385 16 Jeremias Keihsler
h3. install weasyprint
386
387
taken from https://packages.debian.org/bullseye/weasyprint
388
389
<pre><code class="shell">
390
sudo apt install weasyprint
391
</code></pre>
392
393 29 Jeremias Keihsler
h3. automatic backup of ERPNext
394 25 Jeremias Keihsler
395
<pre><code class="shell">
396
sudo vim /usr/local/bin/erpnext-backup.sh
397
</code></pre>
398
399
<pre><code class="shell">
400 26 Jeremias Keihsler
#!/bin/bash -l
401 1 Jeremias Keihsler
402 26 Jeremias Keihsler
# there is some 'magic' in the shebang, the '-l' is invoking the environment of the calling user (in this case 'bitnami')
403 1 Jeremias Keihsler
# JKE 2023-08-24
404 25 Jeremias Keihsler
cd /opt/bitnami/erpnext/frappe-bench
405 33 Jeremias Keihsler
# JKE 2023-10-13 backup sites individually and with files
406
# bench backup-all-sites
407 34 Jeremias Keihsler
# bench --site erpnext backup --with-files
408 39 Jeremias Keihsler
# bench --site erpnext set-maintenance-mode on
409 34 Jeremias Keihsler
bench --site all backup --with-files
410 39 Jeremias Keihsler
# bench --site erpnext set-maintenance-mode off
411 38 Jeremias Keihsler
# bench --site all backup --with-files --compress --backup-path /var/cache/myerpnext.bak/
412 33 Jeremias Keihsler
# /JKE 2023-10-13
413 25 Jeremias Keihsler
</code></pre>
414
415
<pre><code class="shell">
416
sudo chmod +x /usr/local/bin/erpnext-backup.sh
417 1 Jeremias Keihsler
</code></pre>
418
419 26 Jeremias Keihsler
<pre><code class="shell">
420
sudo vim /etc/cron.d/erpnext-backup
421
</code></pre>
422 1 Jeremias Keihsler
423 26 Jeremias Keihsler
<pre><code class="shell">
424
# JKE 2023-08-24
425
#
426
#    min  hr   dom  month dow     user    command
427
#    -    -    -    -     -
428
#    |    |    |    |     |
429
#    |    |    |    |     +-day of week (0-7) sunday=0 or 7
430
#    |    |    |    +---------month (1-12)
431
#    |    |    +----------------day of month (1-31)
432
#    |    +-----------------------hour (0-23)
433
#    +------------------------------min (0-59)
434
#
435
#     32   13   *    *     *       bitnami  /usr/local/bin/erpnext-backup.sh >> /home/bitnami/erpnext-backup.log 2>&1
436
     15   18   *    *     *       bitnami  /usr/local/bin/erpnext-backup.sh
437
</code></pre>
438
439
here is again some 'magic', there is no MTA available. So any output from the cron-job gets discarded.
440
use the upper construct to debug and append the output to @/home/bitnami/erpnext-backup.log@
441 25 Jeremias Keihsler
442 1 Jeremias Keihsler
the backups are stored in @/opt/bitnami/erpnext/frappe-bench/sites/erpnext/private/backups@
443 29 Jeremias Keihsler
444
h4. retrieve backups from external machine
445
446
rsync is not installed by default ..
447
448
<pre><code class="shell">
449
sudo apt-get install rsync
450
</code></pre>
451
452
from the external machine, just invoke like
453
454
<pre><code class="shell">
455
rsync --verbose --progress --stats --recursive bitnami@example.com:/opt/bitnami/erpnext/frappe-bench/sites/erpnext/private/backups/* .
456
</code></pre>
457 16 Jeremias Keihsler
458 40 Jeremias Keihsler
h3. check ERPNext version
459
460
<pre><code class="shell">
461
cd /opt/bitnami/erpnext/frappe-bench
462
bench version
463
</code></pre>
464
465 1 Jeremias Keihsler
h3. migrate ERPNext to new server
466 43 Jeremias Keihsler
467
h4. backup complete machine
468
469
come on, you know how to do that image..
470
471
h4. check the current version
472
473
<pre><code class="shell">
474
cd /opt/bitnami/erpnext/frappe-bench
475
bench version
476
bench --version
477
</code></pre>
478
479
h4. upgrade ERPNext
480
481
taken from: https://docs.bitnami.com/general/apps/erpnext/administration/upgrade/
482
483
Executing the following commands as bitnami user or the user who installed the application:
484
this may also help: https://medium.com/@prasantpant141/update-your-frappe-to-specific-latest-version-a08689fcd296
485
486
<pre><code class="shell">
487
cd /opt/bitnami/erpnext/frappe-bench/apps/erpnext
488
. ../../../venv/bin/activate
489
bench update
490
deactivate
491 53 Jeremias Keihsler
bench --site erpnext migrate
492 43 Jeremias Keihsler
</code></pre>
493
494
maybe it is necessary to update @pip@ and/or @frappe-bench@ to make it happen:
495
496
<pre><code class="shell">
497
cd /opt/bitnami/erpnext/frappe-bench
498
pip install --upgrade pip
499
pip3 install --upgrade frappe-bench
500
</code></pre>
501
502
h5. troubleshoot
503
504
the update from v14.16 upwards seem to miss 2 log-files.
505
<pre><code class="shell">
506
cd /opt/bitnami/erpnext/frappe-bench/logs
507
sudo touch database.log
508
sudo chown daemon:daemon database.log
509
sudo chmod 666 database.log
510
cd /opt/bitnami/erpnext/frappe-bench/sites/erpnext/logs
511
sudo touch database.log
512
sudo chown daemon:daemon database.log
513
sudo chmod 666 database.log
514
</code></pre>
515 1 Jeremias Keihsler
516 7 Jeremias Keihsler
h4. backup
517
518 47 Jeremias Keihsler
see also: https://medium.com/@anjanadhakal09/erpnext-frappe-backup-and-restore-in-new-site-4aa908dc3fb0
519
520 5 Jeremias Keihsler
<pre><code class="shell">
521
cd /opt/bitnami/erpnext/frappe-bench
522 50 Jeremias Keihsler
bench --site all backup --with-files
523 7 Jeremias Keihsler
</code></pre>
524
525
files are saved very deep
526
527
<pre><code class="shell">
528
cd /opt/bitnami/erpnext/frappe-bench/sites/erpnext/private/backups/
529
</code></pre>
530
531
h4. restore
532
533 46 Jeremias Keihsler
also have a look at:
534
* https://frappeframework.com/docs/user/en/bench/reference/restore
535
* https://serverok.in/erpnext-restore-backup
536 45 Jeremias Keihsler
537 7 Jeremias Keihsler
copy files to new server into @/home/bitnami@
538
539
<pre><code class="shell">
540 8 Jeremias Keihsler
cd /opt/bitnami/erpnext/frappe-bench/
541 51 Jeremias Keihsler
bench --site erpnext restore /home/bitnami/yyyymmdd_hhmmss-erpnext-database.sql.gz  --with-public-files /home/bitnami/yyyymmdd_hhmmss-erpnext-files.tar --with-private-files /home/bitnami/yyyymmdd_hhmmss-erpnext-private-files.tar
542 57 Jeremias Keihsler
bench --site erpnext migrate
543 5 Jeremias Keihsler
</code></pre>
544 1 Jeremias Keihsler
545
h2. vanilla install based on Ubuntu
546 10 Jeremias Keihsler
547 11 Jeremias Keihsler
h3. backup and load into test-site
548 10 Jeremias Keihsler
549 44 Jeremias Keihsler
also have a look at: https://www.it-management-kirchberger.at/manuals-tutorials/server-centos-7/erpnext/todo.html
550
551 10 Jeremias Keihsler
To create a staging site from a production site backup:
552
553
<pre><code class="shell">
554
cd <frappe/erpnext Verzeichnis>
555
mkdir ~/backup/
556
557
bench --site prod.example.net set-maintenance-mode on
558
bench --site prod.example.net set-config pause_scheduler 1
559
bench --site prod.example.net backup --with-files --compress --backup-path ~/backup/ 
560
# notice: Database Public & Private from stdout
561
bench --site prod.example.net set-maintenance-mode off
562
563
restore into other Staging instance:
564
565
bench new-site staging.example.net
566
bench --site staging.example.net set-maintenance-mode on
567
568
bench --site staging.example.net restore ~/backup/YYYYMMDD_HHMMSS-prod.example.net-database.sql.gz
569
  --with-public-files  ~/backup/YYYYMMDD_HHMMSS-prod.example.net-files.tar.gz
570
  --with-private-files ~/backup/YYYYMMDD_HHMMSS-prod.example.net-private-files.tar.gz
571
  MySQL root password:
572
573
bench --site staging.example.net mute_emails true
574
bench --site staging.example.net set-maintenance-mode off
575
rm -r ~/backup/
576
</code></pre>