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

default discord avatar
Tom
6 months 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?

  • default discord avatar
    thisisnotchris
    6 months 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
    Tom
    6 months ago

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

  • default discord avatar
    thisisnotchris
    6 months ago

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



    (until refreshing a bunch of times)

  • default discord avatar
    Tom
    6 months ago

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

  • default discord avatar
    thisisnotchris
    6 months ago

    any errors?

  • default discord avatar
    Tom
    6 months 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
  • default discord avatar
    thisisnotchris
    6 months 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
    Tom
    6 months ago

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



    Naturally our content editors are freaking out 😅

  • discord user avatar
    zubricks
    Payload Team
    6 months 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
    Tom
    6 months 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
    thisisnotchris
    6 months 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 .........
  • discord user avatar
    zubricks
    Payload Team
    6 months ago

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

  • discord user avatar
    dribbens
    Payload Team
    6 months 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.

  • default discord avatar
    Tom
    6 months 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
    zubricks
    Payload Team
    6 months ago

    Amazing!



    Glad to hear it!

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.