mt2publ
A tool to (partially) convert a Movable Type website for use with Publ.
Basic usage
Currently only SQLite databases are supported (although adding direct support for MySQL and Postgres isn't too hard). If you have a MySQL database dump you can convert it to SQLite via mysql2sqlite, and for Postgres you can follow these instructions.
pip install mt2publ
mt2publ -b BLOG_ID -c /path/to/site/content database.db
If you don't specify -b then it will dump all entries and category metadata from the MT database, which is probably not what you want if you have multiple blogs configured on the dashboard. You can find the specific blog ID by looking at its URL from the dashboard.
Current status
It has been tested successfully to extract entries and categories from a single Movable Type 4.21 website.
Features
What's supported
- Markdown, Rich Text, and HTML entries (both with and without "convert linebreaks" set), with both intro and extended text
- Publication status:
- "Draft" and "Scheduled" supported directly
- "Review" becomes "HIDDEN"
- "Spam" becomes "GONE"
- "Published" tries to do the right thing with Publ's scheduling model
- Category metadata
- Blog metadata (stored on the root category)
- Multiple categories with some limitations:
- It tries to infer the actual category based on the entry's primary category and what other subcategories an entry is in
- All category placements are set in metadata headers, allowing manual cleanup (and fancy template logic if you so choose)
- Sets path aliases of "entry" and "page" assets based on the original template mappings
- Preserves the original entry ID as
Import-ID Entry-Typefor entry vs. pageAtom-Tagfor the original, inferior atom<id>elements
What won't be supported
- Asset relocation
- Converting HTML/richtext entries to Markdown (use Pandoc if you're feeling brave)
- Native multiple categories (unless those become supported by Publ)
- Things which are absolutely too complicated to get right, such as:
- Full automated template conversion
What's feasible
- Limited template conversion as a starting point
- Limited category path alias support
- Native support for MySQL, Oracle, and Postgres databases
- Tags
- Output backends for other blogging systems (Jekyll, Pelican, etc.)
- Comment export (probably using the WordPress comment dump format, since many hosted comment systems support that, notably Disqus)
Data compatibility notes
Entry dates
The Date and Last-Modified are based on local time, since Movable Type only provides a single global timezone offset (not even a locale!) for the entire blog.
Feed <id>s
Atom-Tag potentially leaks data and shouldn't be used, unless you are really worried about Atom feed subscribers seeing duplicate entries. If you still want to use this feature, the appropriate XML fragment would be:
{% if entry['Atom-Tag'] %}
<id>{{entry['Atom-Tag']}}</id>
{% else %}
<id>urn:uuid:{{entry.uuid}}</id>
{% endif %}
Metadata
Release files for mt2publ 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mt2publ-0.1.1.tar.gz | 8.7 kB | Without provenance | Details for mt2publ-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mt2publ-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for mt2publ-0.1.1-py3-none-any.whl |
Total release size: 19.6 kB
Release files / mt2publ-0.1.1.tar.gz
| Download URL | mt2publ-0.1.1.tar.gz |
|---|---|
| Size | 8.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
742369d7adda3d7ca66cf3ffc9bb23f2227bb82b9ded9e3f66cbf543997fe766
|
|
BLAKE2b-256 checksum How to use checksums |
273ee7e48985604a0360cc2d7e6d196e153eee9935061b77c1d9bf83691504a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.0
|
Release files / mt2publ-0.1.1-py3-none-any.whl
| Download URL | mt2publ-0.1.1-py3-none-any.whl |
|---|---|
| Size | 10.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
517bc3caa69ac77960feed1492a60346705c394bcf54fa8347478ccc5e17bb66
|
|
BLAKE2b-256 checksum How to use checksums |
1248aa0125d7a92b99044cc6b80722114e32509ca3ad01633e827d5f5e47d5f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.0
|
Security for mt2publ 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.