Upload types Files deleted after second deployment

default discord avatar
godoyms
3 months ago
6

Hello. I kindly ask for your help with an issue in my deployment phase. I'm deploying my Payload cms app to digital ocean in App Platform service. The thing is that when I first successfully deployed and upload some images to my collections everything worked as expected. However, when I just deployed a second version of my app with very few changes, all the previous upload files were deleted . Thanks in advance

  • default discord avatar
    r3pwn
    3 months ago

    If you're not using any kind of cloud storage plugin, I believe this is expected, as those images live in temporary storage in each deployment, so if you were to deploy again, all of your current images will be lost, as well



    These deployments don't have any kind of "permanent" storage, so you'll want to switch to using some kind of cloud storage plugin in Payload. I use the Google Cloud Storage plugin, and my bill is a whopping $0.00 because cloud storage is insanely cheap.



    https://github.com/payloadcms/plugin-cloud-storage#gcs-adapter
  • default discord avatar
    godoyms
    3 months ago

    Thanks a lot

  • default discord avatar
    r3pwn
    3 months ago

    No problem! 🙂

  • default discord avatar
    techinverted
    3 months ago

    @r3pwn how about the local storage plugin? Is that persistent?

  • default discord avatar
    donfabrizio
    3 months ago

    It is persistent if you use a VPS for example, so a Virtual machine that you manage (Digital Ocean Droplets...). If you use a fully automated deployment service (Vercel, DO App cloud, Heroku...) you most likely won't have a permanent fiel system so the local storage plugin will work, but every deploy will see your media deleted.

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.