Skip to content

Commit 5471562

Browse files
Docs: How to restore backup #190
1 parent 12821ca commit 5471562

File tree

3 files changed

+120
-5
lines changed

3 files changed

+120
-5
lines changed

docs/faq.rst

+52
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,58 @@ The gas meter positions are only be updated once per hour (for DSMR v4).
171171
The Status page will give you insight in this as well.
172172

173173

174+
How do I restore a database backup?
175+
-----------------------------------
176+
177+
.. warning::
178+
179+
Restoring a backup will replace any existing data stored in the database and is irreversible!
180+
181+
.. note::
182+
183+
Do you need a complete reinstall of DSMR-reader as well?
184+
Then please :doc:`follow the install guide<installation>` and restore the database backup **using the notes at the end of chapter 1**.
185+
186+
Only want to restore the database?
187+
188+
- This asumes you are still running the same application version as the backup was created in.
189+
190+
- Stop the application first with ``sudo supervisorctl stop all``. This will disconnect it from the database as well.
191+
192+
For **PostgreSQL** restores::
193+
194+
sudo sudo -u postgres dropdb dsmrreader
195+
sudo sudo -u postgres createdb -O dsmrreader dsmrreader
196+
197+
# Either restore an uncompressed (.sql) backup:
198+
sudo sudo -u postgres psql dsmrreader -f <PATH-TO-POSTGRESQL-BACKUP.sql>
199+
200+
# OR
201+
202+
# Restore a compressed (.gz) backup with:
203+
zcat <PATH-TO-POSTGRESQL-BACKUP.sql.gz> | sudo sudo -u postgres psql dsmrreader
204+
205+
206+
For **MySQL** restores::
207+
208+
sudo mysqladmin create dsmrreader
209+
sudo mysqladmin drop dsmrreader
210+
211+
# Either restore an uncompressed (.sql) backup:
212+
cat <PATH-TO-MYSQL-BACKUP.sql.gz> | sudo mysql -D dsmrreader --defaults-file=/etc/mysql/debian.cnf
213+
214+
# OR
215+
216+
# Restore a compressed (.gz) backup with:
217+
zcat <PATH-TO-MYSQL-BACKUP.sql.gz> | sudo mysql -D dsmrreader --defaults-file=/etc/mysql/debian.cnf
218+
219+
220+
- Start the application again with ``sudo supervisorctl start all``.
221+
222+
.. note::
223+
224+
In case the version differs, you can try forcing a deployment reload by: ``sudo su - dsmr`` and then executing ``./post-deploy.sh``.
225+
174226

175227
Feature/bug report
176228
------------------

docs/locale/nl/LC_MESSAGES/faq.mo

1.91 KB
Binary file not shown.

docs/locale/nl/LC_MESSAGES/faq.po

+68-5
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: DSMR Reader v1.x\n"
1010
"Report-Msgid-Bugs-To: Dennis Siemensma <github@dennissiemensma.nl>\n"
11-
"POT-Creation-Date: 2016-01-01 00:00+0100\n"
12-
"PO-Revision-Date: 2017-01-01 00:00+0100\n"
11+
"POT-Creation-Date: 2017-01-03 19:56+0100\n"
12+
"PO-Revision-Date: 2017-01-03 20:01+0100\n"
1313
"Last-Translator: Dennis Siemensma <github@dennissiemensma.nl>\n"
1414
"Language-Team: Dennis Siemensma <github@dennissiemensma.nl>\n"
1515
"MIME-Version: 1.0\n"
@@ -417,15 +417,78 @@ msgstr ""
417417
"sowieso slechts een keer per uur bijgewerkt (voor DSMR v4). De Status-pagina "
418418
"geeft je hier overigens ook inzicht in."
419419

420-
#: ../../faq.rst:176
420+
#: ../../faq.rst:175
421+
msgid "How do I restore a database backup?"
422+
msgstr "Hoe zet ik een databaseback-up terug?"
423+
424+
#: ../../faq.rst:179
425+
msgid ""
426+
"Restoring a backup will replace any existing data stored in the database and "
427+
"is irreversible!"
428+
msgstr ""
429+
"Het herstellen van een back-up vervangt de bestaande data in de database en is "
430+
"onomkeerbaar!"
431+
432+
#: ../../faq.rst:183
433+
msgid ""
434+
"Do you need a complete reinstall of DSMR-reader as well? Then please :doc:"
435+
"`follow the install guide<installation>` and restore the database backup "
436+
"**using the notes at the end of chapter 1**."
437+
msgstr ""
438+
"Heb je tevens een complete herinstallatie van DSMR-reader nodig? :doc:`Volg "
439+
"dan de installatiehandleiding<installation>` en herstel de databaseback-up "
440+
"volgens **de notities aan het einde van hoofdstuk 1**."
441+
442+
#: ../../faq.rst:186
443+
msgid "Only want to restore the database?"
444+
msgstr "Wil je alleen een databaseback-up terugzetten?"
445+
446+
#: ../../faq.rst:188
447+
msgid ""
448+
"This asumes you are still running the same application version as the backup "
449+
"was created in."
450+
msgstr ""
451+
"Dit gaat er overigens wel van uit dat je dezelfde applicatie-versie draait als "
452+
"waarmee de back-up is gemaakt."
453+
454+
#: ../../faq.rst:190
455+
msgid ""
456+
"Stop the application first with ``sudo supervisorctl stop all``. This will "
457+
"disconnect it from the database as well."
458+
msgstr ""
459+
"Stop als eerste de applicatie met ``sudo supervisorctl stop all``. Dit zorgt "
460+
"er ook voor dat de databaseverbinding van de applicatie verdwijnt."
461+
462+
#: ../../faq.rst:192
463+
msgid "For **PostgreSQL** restores::"
464+
msgstr "Voor herstellen van **PostgreSQL**::"
465+
466+
#: ../../faq.rst:206
467+
msgid "For **MySQL** restores::"
468+
msgstr "Voor herstellen van **MySQL**::"
469+
470+
#: ../../faq.rst:220
471+
msgid "Start the application again with ``sudo supervisorctl start all``."
472+
msgstr "Start de applicatie weer met ``sudo supervisorctl start all``."
473+
474+
#: ../../faq.rst:224
475+
msgid ""
476+
"In case the version differs, you can try forcing a deployment reload by: "
477+
"``sudo su - dsmr`` and then executing ``./post-deploy.sh``."
478+
msgstr ""
479+
"Mocht de versie toch verschillen, dan kun je proberen om de applicatie te "
480+
"herladen. Log in met: ``sudo su - dsmr`` en voer vervolgens ``./post-deploy."
481+
"sh`` uit."
482+
483+
#: ../../faq.rst:228
421484
msgid "Feature/bug report"
422485
msgstr "Verzoek/fout melden"
423486

424-
#: ../../faq.rst:177
487+
#: ../../faq.rst:229
425488
msgid "*How can I propose a feature or report a bug I've found?*"
426489
msgstr "*Hoe kan ik een verzoek indienen of een fout melden?*"
427490

428-
#: ../../faq.rst:181
491+
#: ../../faq.rst:233
429492
msgid ""
430493
"`Just create a ticket at Github <https://github.com/dennissiemensma/dsmr-"
431494
"reader/issues/new>`_."

0 commit comments

Comments
 (0)