Browse Source

Add notes about backup & restore; clean up some redundant imports.

Stefano Cossu 6 years ago
parent
commit
91ab42b9fe
4 changed files with 18 additions and 10 deletions
  1. 1 1
      README.md
  2. 17 3
      doc/notes/migration.md
  3. 0 2
      lakesuperior/migrator.py
  4. 0 4
      lakesuperior/model/ldpr.py

+ 1 - 1
README.md

@@ -160,7 +160,7 @@ meant to live as a community project.
 
 [Messaging](doc/notes/messaging.md)
 
-[Migration Guide](doc/notes/migration.md)
+[Migration, Backup & Restore](doc/notes/migration.md)
 
 [Command-Line Reference](doc/notes/cli.md)
 

+ 17 - 3
doc/notes/migration.md

@@ -1,7 +1,16 @@
-# Migration Guide
+# Migration, Backup & Restore
 
-A command-line utility is available as part of the `lsup-admin` suite
-to migrate contents from a Fedora implementation to LAKEsuperior.
+All LAKEsuperior data is by default fully contained in a folder. This means
+that only the data, configurations and code folders are needed for it to run.
+No Postgres, Redis, or such. Data and configuration folders can be moved around
+as needed.
+
+## Migration Tool
+
+Migration is the process of importing and converting data from a different
+Fedora or LDP implementation into a new LAKEsuperior instance. This process
+uses the HTTP/LDP API of the original repository. A command-line utility is
+available as part of the `lsup-admin` suite to assist in such operation.
 
 A repository can be migrated with a one-line command such as:
 
@@ -41,4 +50,9 @@ Two approaches to migration are possible:
    The resources can be indicated by their fully qualified URIs or paths
    relative to the repository root. (*TODO latter option needs testing*)
 
+## Backup And Restore
 
+A back up of a LAKEshore repository consists in copying the RDF and non-RDF
+data folders. These folders are indicated in the application configuration. The
+default commands provided by your OS (`cp`, `rsync`, `tar` etc. for Unix) are
+all is needed.

+ 0 - 2
lakesuperior/migrator.py

@@ -1,12 +1,10 @@
 import logging
 import shutil
 
-from io import BytesIO
 from contextlib import ContextDecorator
 from os import makedirs, path
 from urllib.parse import urldefrag
 
-import lmdb
 import requests
 import yaml
 

+ 0 - 4
lakesuperior/model/ldpr.py

@@ -1,5 +1,4 @@
 import logging
-import pdb
 
 from abc import ABCMeta
 from collections import defaultdict
@@ -7,12 +6,9 @@ from uuid import uuid4
 
 import arrow
 
-from flask import current_app
 from rdflib import Graph, URIRef, Literal
 from rdflib.resource import Resource
 from rdflib.namespace import RDF
-from rdflib.plugins.sparql.algebra import translateUpdate
-from rdflib.plugins.sparql.parser import parseUpdate
 
 from lakesuperior.env import env
 from lakesuperior.globals import (