Importing Text Flat Files from Blosxom
Importing Text Flat Files from Blosxom
Hi
Im taking the plunge and moving away from a long-lived blosxom installation which is just insecure now. I have a directory full of text files (one file per blog post) and want to import them into FlatPress.
They are almost entirely straight text, with the odd bit of HTML introduced every now and then, along with hyperlinks and embedded images. In the first instance Id just be happy with getting all the text imported and can do some regex manipulation along the way.
Whats the easiest way to move the existing files to FlatPress?
thanks
mike
Im taking the plunge and moving away from a long-lived blosxom installation which is just insecure now. I have a directory full of text files (one file per blog post) and want to import them into FlatPress.
They are almost entirely straight text, with the odd bit of HTML introduced every now and then, along with hyperlinks and embedded images. In the first instance Id just be happy with getting all the text imported and can do some regex manipulation along the way.
Whats the easiest way to move the existing files to FlatPress?
thanks
mike
Re: Importing Text Flat Files from Blosxom
Mike, welcome to FlatPress
How does Blosxom store its entries' metadata (such as the date, subject etc.)?
FlatPress has the entries as text files under fp-content/content/[year]/[month]. The file name contains the entry's date formatted as entry[yy][mm][dd]-[hh][ii][ss].txt. Looking into the file, you see some metadata ahead of the content: VERSION is the FlatPress version the entry was created under, SUBJECT is, well, the subject , and CONTENT is the entry content with BBCode (HTML will be parsed as well).
A simple way to see that all in action is just to set up a test blog with FP and fiddle around with the text files.
For migrating, you'd need a script that creates the file structure under fp-content/content/[year]/[month]. (If your entries don't spread over too many years, you could just create this structure manually.) When all entry files are created in their respective year/month subfolder, you'd just copy the whole file structure into your FlatPress directory. To let FP know about its new contents, rebuild the index in die Admin Panel (Maintain > Rebuild index).
Let us know if you need further help and how migration works out for you!
(The greatest outcome for the community would be a converter Blosxom-FlatPress to be used by anyone.)
All the best
Arvid
How does Blosxom store its entries' metadata (such as the date, subject etc.)?
FlatPress has the entries as text files under fp-content/content/[year]/[month]. The file name contains the entry's date formatted as entry[yy][mm][dd]-[hh][ii][ss].txt. Looking into the file, you see some metadata ahead of the content:
Code: Select all
VERSION|fp-1.1|SUBJECT|The entry subject|CONTENT|The content...
A simple way to see that all in action is just to set up a test blog with FP and fiddle around with the text files.
For migrating, you'd need a script that creates the file structure under fp-content/content/[year]/[month]. (If your entries don't spread over too many years, you could just create this structure manually.) When all entry files are created in their respective year/month subfolder, you'd just copy the whole file structure into your FlatPress directory. To let FP know about its new contents, rebuild the index in die Admin Panel (Maintain > Rebuild index).
Let us know if you need further help and how migration works out for you!
(The greatest outcome for the community would be a converter Blosxom-FlatPress to be used by anyone.)
All the best
Arvid
Project blogββ Docsββ Twitterββ Mastodonββ Forum RSS feedββ Project blog RSS feedββ Donate
FlatPress 1.3 "Andante" is released!
How to rework your themes and plugins for FlatPress 1.3 / Smarty 4
FlatPress 1.3 "Andante" is released!
How to rework your themes and plugins for FlatPress 1.3 / Smarty 4
Re: Importing Text Flat Files from Blosxom
Thanks for the help! Im working on some import instructions for Blosxom. One query...
-each file is appended with:
|AUTHOR|miksmith|DATE|1566926569|CATEGORIES|1,2|
How is the DATE calculated?
thanks
-each file is appended with:
|AUTHOR|miksmith|DATE|1566926569|CATEGORIES|1,2|
How is the DATE calculated?
thanks
Re: Importing Text Flat Files from Blosxom
Hi,
1566926569 would be 2019-08-27, 17:22:49 (UTC).
Regards
Arvid
This is the UNIX time stamp (seconds since 1970-01-01) of the entry's creation date. (check https://www.unixtimestamp.com/).
1566926569 would be 2019-08-27, 17:22:49 (UTC).
Regards
Arvid
Project blogββ Docsββ Twitterββ Mastodonββ Forum RSS feedββ Project blog RSS feedββ Donate
FlatPress 1.3 "Andante" is released!
How to rework your themes and plugins for FlatPress 1.3 / Smarty 4
FlatPress 1.3 "Andante" is released!
How to rework your themes and plugins for FlatPress 1.3 / Smarty 4
Re: Importing Text Flat Files from Blosxom
We now have a working Blosxom to Flatpress converter The process is broadly this:
-download your Blosxom files, including all the sub-directories for categories, but make sure to maintain the date/time filestamp of individual files - this is used to timestamp the entry for Flatpress. WinSCP does this (Filezilla doesnt)
-make sure the categories only ONE DIRECTORY DEEP. Move any sub-sub-directories up to the top level
-rename all the directories to numbers. These are used to tag the entries and can then be recreated within FlatPress
-copy the script.py and template files to the directory the folders are stored in
-edit the template file to have the header/footer you want. The content, date and categories will be changed for the entries
-run the script
-a new fp-content directory will be created with all your entries
-copy this to your flatpress site and rebuild the index
The script does the following
-rename s the file to entry<date>-<time>.txt based upon the date modified date
-copies the file to a new subfolder in FlatPress /content folder based upon year and month
-cuts the first line from the file (and deletes the first line break)
-prefixes the file with:
VERSION|fp-1.1|SUBJECT|<first line from file>|CONTENT|
-suffixes with:
|AUTHOR|miksmith|DATE|<1566926569>|CATEGORIES|<orig_dir_name>|
BIG shout out to James O'Connor for putting the script together after we'd worked out what to do!
-download your Blosxom files, including all the sub-directories for categories, but make sure to maintain the date/time filestamp of individual files - this is used to timestamp the entry for Flatpress. WinSCP does this (Filezilla doesnt)
-make sure the categories only ONE DIRECTORY DEEP. Move any sub-sub-directories up to the top level
-rename all the directories to numbers. These are used to tag the entries and can then be recreated within FlatPress
-copy the script.py and template files to the directory the folders are stored in
-edit the template file to have the header/footer you want. The content, date and categories will be changed for the entries
-run the script
-a new fp-content directory will be created with all your entries
-copy this to your flatpress site and rebuild the index
The script does the following
-rename s the file to entry<date>-<time>.txt based upon the date modified date
-copies the file to a new subfolder in FlatPress /content folder based upon year and month
-cuts the first line from the file (and deletes the first line break)
-prefixes the file with:
VERSION|fp-1.1|SUBJECT|<first line from file>|CONTENT|
-suffixes with:
|AUTHOR|miksmith|DATE|<1566926569>|CATEGORIES|<orig_dir_name>|
BIG shout out to James O'Connor for putting the script together after we'd worked out what to do!
- Attachments
-
- script.7z
- (862 Bytes) Downloaded 328 times
Re: Importing Text Flat Files from Blosxom
Small bug fixed which concerned the CATEGORY tag and variances between OSs
- Attachments
-
- script.7z
- (870 Bytes) Downloaded 341 times
Re: Importing Text Flat Files from Blosxom
I felt free to add the importer tool to our fp-extras repository: https://github.com/flatpressblog/flatpr ... r/fp-tools
Project blogββ Docsββ Twitterββ Mastodonββ Forum RSS feedββ Project blog RSS feedββ Donate
FlatPress 1.3 "Andante" is released!
How to rework your themes and plugins for FlatPress 1.3 / Smarty 4
FlatPress 1.3 "Andante" is released!
How to rework your themes and plugins for FlatPress 1.3 / Smarty 4
Who is online
Users browsing this forum: No registered users and 93 guests