Base migration script from the old database
This commit is contained in:
parent
352985a13f
commit
1204a70cb5
1 changed files with 21 additions and 0 deletions
21
scripts/migrate.py
Normal file
21
scripts/migrate.py
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
"""
|
||||||
|
Script to perform the migration from the old blog database
|
||||||
|
to the lektor file format.
|
||||||
|
"""
|
||||||
|
|
||||||
|
import os.path
|
||||||
|
|
||||||
|
import dataset
|
||||||
|
|
||||||
|
|
||||||
|
SQLITE = os.path.expanduser('~/NextCloud/Backups/blog/v2/database.sqlite')
|
||||||
|
LEKTOR = os.path.expanduser('~/Developer/fmartingr-lektor/content')
|
||||||
|
|
||||||
|
db = dataset.connect('sqlite:///' + SQLITE)
|
||||||
|
|
||||||
|
posts = db['blog_entry']
|
||||||
|
projects = db['projects_project']
|
||||||
|
project_images = lambda x: db['projects_projectimage'].filter(project_id=x)
|
||||||
|
get_project_group = lambda x: db['projects_group'].filter(id=x)
|
Loading…
Add table
Add a link
Reference in a new issue