diff --git a/plinth/backup.py b/plinth/backup.py
deleted file mode 100644
index 7930062e4..000000000
--- a/plinth/backup.py
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# This file is part of FreedomBox.
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-"""
-Utility methods for providing backup information.
-"""
-
-
-def validate(backup):
- """Validate the backup' information schema."""
- assert isinstance(backup, dict)
-
- assert 'config' in backup
- assert isinstance(backup['config'], dict)
- _validate_directories_and_files(backup['config'])
-
- assert 'data' in backup
- assert isinstance(backup['data'], dict)
- _validate_directories_and_files(backup['data'])
-
- assert 'secrets' in backup
- assert isinstance(backup['secrets'], dict)
- _validate_directories_and_files(backup['secrets'])
-
- assert 'services' in backup
- assert isinstance(backup['services'], list)
-
- return backup
-
-
-def _validate_directories_and_files(df):
- """Validate directories and files structure."""
- assert 'directories' in df
- assert isinstance(df['directories'], list)
- assert 'files' in df
- assert isinstance(df['files'], list)
diff --git a/plinth/modules/backups/backups.py b/plinth/modules/backups/backups.py
index 14f9532ce..bd7812135 100644
--- a/plinth/modules/backups/backups.py
+++ b/plinth/modules/backups/backups.py
@@ -30,6 +30,36 @@ import collections
from plinth import actions, action_utils, module_loader
+def validate(backup):
+ """Validate the backup' information schema."""
+ assert isinstance(backup, dict)
+
+ assert 'config' in backup
+ assert isinstance(backup['config'], dict)
+ _validate_directories_and_files(backup['config'])
+
+ assert 'data' in backup
+ assert isinstance(backup['data'], dict)
+ _validate_directories_and_files(backup['data'])
+
+ assert 'secrets' in backup
+ assert isinstance(backup['secrets'], dict)
+ _validate_directories_and_files(backup['secrets'])
+
+ assert 'services' in backup
+ assert isinstance(backup['services'], list)
+
+ return backup
+
+
+def _validate_directories_and_files(df):
+ """Validate directories and files structure."""
+ assert 'directories' in df
+ assert isinstance(df['directories'], list)
+ assert 'files' in df
+ assert isinstance(df['files'], list)
+
+
class Packet:
"""Information passed to a handlers for backup/restore operations."""
diff --git a/plinth/modules/dynamicdns/manifest.py b/plinth/modules/dynamicdns/manifest.py
index c09a9e684..9e47581f2 100644
--- a/plinth/modules/dynamicdns/manifest.py
+++ b/plinth/modules/dynamicdns/manifest.py
@@ -15,7 +15,7 @@
# along with this program. If not, see .
#
-from plinth.backup import validate as validate_backup
+from plinth.modules.backups.backups import validate as validate_backup
backup = validate_backup({
'config': {
diff --git a/plinth/modules/ejabberd/manifest.py b/plinth/modules/ejabberd/manifest.py
index d460ffb0d..983424929 100644
--- a/plinth/modules/ejabberd/manifest.py
+++ b/plinth/modules/ejabberd/manifest.py
@@ -17,7 +17,7 @@
from django.utils.translation import ugettext_lazy as _
-from plinth.backup import validate as validate_backup
+from plinth.modules.backups.backups import validate as validate_backup
from plinth.clients import store_url, validate
from plinth.modules.jsxc import manifest as jsxc_manifest
diff --git a/plinth/modules/ikiwiki/manifest.py b/plinth/modules/ikiwiki/manifest.py
index 2a95b712d..10c8701b7 100644
--- a/plinth/modules/ikiwiki/manifest.py
+++ b/plinth/modules/ikiwiki/manifest.py
@@ -17,7 +17,7 @@
from django.utils.translation import ugettext_lazy as _
-from plinth.backup import validate as validate_backup
+from plinth.modules.backups.backups import validate as validate_backup
from plinth.clients import validate
clients = validate([{
diff --git a/plinth/modules/infinoted/manifest.py b/plinth/modules/infinoted/manifest.py
index 74b73807d..07cd96139 100644
--- a/plinth/modules/infinoted/manifest.py
+++ b/plinth/modules/infinoted/manifest.py
@@ -18,7 +18,7 @@
from django.utils.translation import ugettext_lazy as _
from plinth import cfg
-from plinth.backup import validate as validate_backup
+from plinth.modules.backups.backups import validate as validate_backup
from plinth.clients import validate
from plinth.utils import format_lazy
diff --git a/plinth/modules/matrixsynapse/manifest.py b/plinth/modules/matrixsynapse/manifest.py
index f29ae4713..b14d45d51 100644
--- a/plinth/modules/matrixsynapse/manifest.py
+++ b/plinth/modules/matrixsynapse/manifest.py
@@ -17,7 +17,7 @@
from django.utils.translation import ugettext_lazy as _
-from plinth.backup import validate as validate_backup
+from plinth.modules.backups.backups import validate as validate_backup
from plinth.clients import store_url, validate
_android_package_id = 'im.vector.alpha'
diff --git a/plinth/modules/mediawiki/manifest.py b/plinth/modules/mediawiki/manifest.py
index cd0d27008..8c0fa9679 100644
--- a/plinth/modules/mediawiki/manifest.py
+++ b/plinth/modules/mediawiki/manifest.py
@@ -17,7 +17,7 @@
from django.utils.translation import ugettext_lazy as _
-from plinth.backup import validate as validate_backup
+from plinth.modules.backups.backups import validate as validate_backup
from plinth.clients import validate
clients = validate([{
diff --git a/plinth/modules/minetest/manifest.py b/plinth/modules/minetest/manifest.py
index 0f44d528d..1a9e31a5c 100644
--- a/plinth/modules/minetest/manifest.py
+++ b/plinth/modules/minetest/manifest.py
@@ -17,7 +17,7 @@
from django.utils.translation import ugettext_lazy as _
-from plinth.backup import validate as validate_backup
+from plinth.modules.backups.backups import validate as validate_backup
from plinth.clients import store_url, validate
clients = validate([{
diff --git a/plinth/modules/radicale/manifest.py b/plinth/modules/radicale/manifest.py
index a4ca0a5c6..22f8b446e 100644
--- a/plinth/modules/radicale/manifest.py
+++ b/plinth/modules/radicale/manifest.py
@@ -17,7 +17,7 @@
from django.utils.translation import ugettext_lazy as _
-from plinth.backup import validate as validate_backup
+from plinth.modules.backups.backups import validate as validate_backup
from plinth.clients import store_url, validate
clients = validate([{
diff --git a/plinth/modules/repro/manifest.py b/plinth/modules/repro/manifest.py
index 9171fd376..e640eb009 100644
--- a/plinth/modules/repro/manifest.py
+++ b/plinth/modules/repro/manifest.py
@@ -17,7 +17,7 @@
from django.utils.translation import ugettext_lazy as _
-from plinth.backup import validate as validate_backup
+from plinth.modules.backups.backups import validate as validate_backup
from plinth.clients import store_url, validate
_jitsi_package_id = 'org.jitsi.meet'