Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Updated to latest version and enabled drafts made all my entries disappear

default discord avatar
toms02 years ago
15

Hey everyone, interesting one, but all my entries have disappeared after enabling drafts and updating to the latest version of Payload.



The API still gives the correct results:


https://cms.productionpark.co.uk/api/news

However the CMS shows as per screenshot. Is there a way to get the articles back?

  • default discord avatar
    notchr2 years ago

    This happened to me



    I had to refresh the page like 10 times



    And then they showed up



    Wondering if that will work for you

  • default discord avatar
    toms02 years ago

    I'll try that, maybe it's client side cache

  • default discord avatar
    notchr2 years ago

    For me, my Admin would say "2 Pages", but no pages would be listed



    (until refreshing a bunch of times)

  • default discord avatar
    toms02 years ago

    Yea, not working for me unfortunately, even tried incognito mode

  • default discord avatar
    notchr2 years ago

    any errors?

  • default discord avatar
    toms02 years ago

    I can access it if I copy and paste the ID into the URL. But the list will not show it.



    No errors

  • default discord avatar
    notchr2 years ago

    Odd



    Some other people were posting recently about data existing but not showing in admin components



    Wonder if it is related

  • default discord avatar
    toms02 years ago

    Possibly! First time something like this has happened to me.



    Naturally our content editors are freaking out 😅

  • discord user avatar
    seanzubrickas
    2 years ago

    Hey Tom - We actually had a breaking change in 1.6.1 that required migration of document versions.



    Here is more info and the migration script:


    https://github.com/payloadcms/payload/blob/master/CHANGELOG.md#-versions-may-need-to-be-migrate

    this is likely the case

  • default discord avatar
    toms02 years ago

    Hey I updated from 1.6.13 to 1.6.17 which caused them to disappear. I'll try run that script though I am concerned about data corruption



    Script is giving the error


    PAYLOAD_CONFIG_PATH=src/payload.config.ts : The term 'PAYLOAD_CONFIG_PATH=src/payload.config.ts' is not recognized as the name of a cmdlet, function, script file, or 
    operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
    At line:1 char:1
    + PAYLOAD_CONFIG_PATH=src/payload.config.ts npx ts-node -T ./migrateVer ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : ObjectNotFound: (PAYLOAD_CONFIG_...yload.config.ts:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException
  • default discord avatar
    notchr2 years ago

    crossenv issue?



    @183581008677961728

    Try putting

    cross-env

    at the start of the cmd



    might work? the dev command and serve commands start with it



    cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts .........
  • discord user avatar
    seanzubrickas
    2 years ago

    Hey

    @183581008677961728

    did you get this sorted or could you use an assist here?

  • discord user avatar
    dribbens
    2 years ago

    That migration script isn't going to be what you need I'm afraid.


    That helps you go update payload on collections that already had versions with the breaking changes.


    @183581008677961728

    What you're seeing is different. Your database had documents in the normal collection location (why you can access them via the id). The list queries the _collectionname_versions table in mongo to show both draft + published results.


    You need a migration script that resaves all documents which will create the version collection documents for the list to work.

  • default discord avatar
    toms02 years ago

    Hey, I did thanks guys yeah, for some reason I had to put it in my package.json and run it from there with cross-env, that finally got it working, appreciate all the help

  • discord user avatar
    seanzubrickas
    2 years ago

    Amazing!



    Glad to hear it!

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.