Migrate blog post from pyro 2.5 to 3
Created 7 years ago by jerry

Hi, how can i migrate blog tag and custom field types? example:

{{ blog:posts category="category-slug" limit="3" }}
   < img src=" {{ photo:image }} " alt="" >
   {{ title }}
   {{ intro }}
 {{ /blog:posts }}
ryanthompson  —  7 years ago

You would need to write a seeder for migrating from your old to new database most likely.

If I were you - I would setup the new posts module the way you need it - then write a small script to migrate it over using the newer tools.

Setup a second connection for your old database and have a modal like OldPostModel use that connection to retrieve them.

Does that make sense?

jerry  —  7 years ago

Sorry, I made the question wrong, its my first pyro 3 installation, and i would like to know how to put correctly tags to display post by category and field types...
pyro 2.5:

{{ blog:posts category="category-slug" limit="3" }}....{{ /blog:posts }}

pyro 3
?

ryanthompson  —  7 years ago

This is done for you - ie:

https://pyrocms.com/posts/tags/ecommerce

https://pyrocms.com/posts/categories/releases

And you can edit those views by overloading them: https://pyrocms.com/videos/series/extending-pyrocms/overriding-views

OR.. if you wanna plop this code in custom somewhere-ness you can do something like this:

{% category = entries('posts', 'categories').findBySlug('foo') %}

{% for post in entries('posts').whereCategory(category.id).recent().take(5).get() %}
    {{ post.title }} - {{ post.custom_field }}
{% endfor %}