Update from Kirby 2 to 4 best way?

Hi there,
I am totally new here. I would like to dive deeper into Kirby and a first project is to upgrade from Kirby 2 to Kirby 4.

As far as I understood, the best way would be to go the upgrade steps from version 2 to 3, right? We just bought a license for Kirby 4. I should download Kirby 3 and pretend to upgrade to version 3 at first, before we update to 4, right?

I will read the documentation and everything, but I would like to ask here, if I am missing anything in my thinking or plan.

Thanks in advance:)
Chris

Welcome :slight_smile:

Personally i would jump from K2 to K4 directly. I tend to create a new gitbranch for the upgrade so i can keep the old code somewhere.

It really just case of updating Kirby and seeing what happens… without knowing the fields and stuff you are using, or any custom code you might in the form of methods etc. When I upgrade i just take it a page template at a time and correct any issues as i go.

If you run into any hurdles along the way, either post a new question here on the forum (or search the forum incase its been answered before Forum posts are tagged for the most part with the Kirby version the apply to.). We are helpful bunch here :slight_smile:

You might find the Cookbooks helpful too (especially the Build a blog one as that exaplins a lot of mechanics you can use to build other sites.) Cookbook | Kirby CMS

There is also some video tutorials over here https://www.youtube.com/@KirbyCasts/videos

Have fun :slight_smile:

I agree, and the first step would be to check your plugins, if you are using any. If so, check what can be replaced with Kirby native stuff now. For those things that can’t, check if the plugins has been updated to work with Kirby 4. If not, do similar plugins exist, and if so, what do you have to change to make them work.

The migration steps from Kirby 2 to Kirby 3 should still be your guiding line, as these include the most important steps.

Thanks a lot for your help, I am on it and as soon I have questions I will get back here:)

Thanks for your answer, I started already and so far I am getting forward:)

So far I am making steps forward updating Kirby to the latest version, but from time to time I am running into problems.

Right now I have the fallowing problem: I would like to choose a picture from my uploaded images as a cover image for the story/project from my panel.

I had the option before, but now I cannot figure out wich fields and types I should choose in my blueprint to configure this functionality in my panel.

Here is my blueprint:

title: Project

columns:

  • width: 1/2
    sections:
    gallery:
    type: files

  • width: 1/2
    sections:
    info:
    type: fields
    fields:
    text:
    type: textarea
    tags:
    label: Tags
    type: tags

I would like to have a checkbox or toggle besides the images for choosing the image for the story/project cover.

I tried creating a checkbox within the gallery section but somehow a checkbox never showed up, doesn’t matter what I tried …

I wanted to look it up in the ressources but could not find a solution …

Thanks for any hint in advance:)

p.s.: will watch now the screencast from scratch

You need a files field to be able to select images, it cannot be done via sections: Files | Kirby CMS

Ok, the gallery is already a files field, right? can I add the files field within the gallery or do I have to create it outside the section gallery?

No, it’s a section, not a field, you need to create a field section to have fields mixed with other types of sections.

ah, okay - thanks. I should read more about sections :grimacing:

I changed the blueprint but I guess I have to get rid of the sections at all?

title: Project

sections:
  info:
    type: fields
    fields:
      text:
       type: textarea



  gallery:
    type: files

  fields:
    featured:
      label: Featured?
      type: files
      min: 1
      max: 3


  fields:
    fields:
      tags:
        label: Tags
        type: tags

(the old blueprint from Kirby 2)

#pages: false
#files:
#  sortable: true
#  fields:
#    featured:
#      label: Featured?
#      type: checkbox
#      text: In Header-Gallery auf Startseite anzeigen?
#      default: false
#    focalpoint:
#      label: Fokaler Punkt
#      type: text
#      default: 50% 50%
#    caption:
#      label: Caption
#      type: text
#fields:
#  title:
#    label: Title
#    type:  text
#  text:
#    label: Text
#    type:  textarea
#  featured:
#    label: Featured?
#    type: checkbox
#    text: Cover zum Projekt auf Startseite anzeigen (unter Header-Gallery)?
#    default: false
#  cover:
#    label: Projekt Cover
#    type:
#    mode:  multiple
#    types:
#      - image
#  tags:
#    label: Tags
#    type:  tags

Not really sure what your final result should look like, but if I had to recreate your original blueprint, it would look something like this:

title: Project

columns:
  main:
    width: 2/3
    sections:
      content:
        type: fields
        fields:
          text:
            type: textarea

  sidebar:
    width: 1/3
    sections:
      meta:
        type: fields
        fields:
          featured:
            label: Featured?
            type: toggle
            text: Show cover on homepage
          cover:
            label: Cover iamge
            type: files
          tags:
            label: Tags
            type: tags
      files:
        type: files
        label: File Upload sections
        template: projectimage

Please, when posting code, wrap it within three backticks like so, thanks!

backticks

1 Like