Like what we’re doing? Star us on GitHub!

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

Tom
2 weeks ago
29

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?

image.png
  • thisisnotchris
    2 weeks 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

  • Tom
    2 weeks ago

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

  • thisisnotchris
    2 weeks ago

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



    (until refreshing a bunch of times)

  • Tom
    2 weeks ago

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

  • thisisnotchris
    2 weeks ago

    any errors?

  • Tom
    2 weeks ago

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



    No errors

    image.png
  • thisisnotchris
    2 weeks ago

    Odd



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



    Wonder if it is related

  • Tom
    2 weeks ago

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



    Naturally our content editors are freaking out 😅

  • zubricks
    Payload Team
    2 weeks 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

  • Tom
    2 weeks 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
  • thisisnotchris
    2 weeks ago

    crossenv issue?



    @Tom 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 .........
  • zubricks
    Payload Team
    2 weeks ago

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

  • dribbens
    Payload Team
    2 weeks 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.


    @Tom 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.

  • Tom
    2 weeks 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

  • zubricks
    Payload Team
    2 weeks ago

    Amazing!



    Glad to hear it!

Open the post
Continue the discussion in Discord
Can't find what you're looking for?
Get help straight from the Payload team with an Enterprise License.Learn More