Hi, I may be doing something wrong, however, i put the upload path in the settings for the web app, and run an update/deployment for Strapi v3. Lost all the links to the media fields
Not sure if the upload field can be updated after the initial deployment.
I previously deployed Strapi v4 using Cleavr before your team released the persistent storage feature for strapi and directus
I was uploading photos and videos from my app to strapi v4 with no problems
I am aware of the existing issue that uploads will be “unlinked” from strapi or directus when they are re-deployed using cleavr
When it was announced sometime last week of the persistent storage, i decided to try and see if it will affect my existing installtion
I reconfigured the build settings of FILE UPLOAD PATH to : public/uploads
after making sure the file upload path had the correct info, i redeployed the server using cleavr.
after a successful deploy, i accessed my application and all upload files were now broken links.
Thats why i was asking if FILE UPLOAD PATH should be configured before deploying strapi for the first time? or the process i did above should have kept the links together?
I’m afraid you’ll have to copy the files from an older deployment (which has files) to the directory where we store files. Let us know if you need any help with this (we can share with you some commands).
Except for that case, any deployments made after setting up the FILE UPLOAD PATH should persist files.
We’re already discussing how we can handle this edge case as well. Thank you for bringing it to our notice.
thank you for the information. So basically, for now, we need to define the upload path BEFORE initial deployment.
I would appreciate your help in moving the uploaded files to the current deployed instance with some commands. I have some linux skills so i think i can handle a few commands
@Karlomac01 you can use my unofficial persistent storage script. This also copies the files and dirs to a persistent storage dir from the previous deployment (which is linked by the way in the “current” folder until the current deployment finishes). You could adjust the arguments or reverse engineer it and make a own version that only copy the files to the official persistent storage dir. The script is here, I’ve been through this struggle already
Don’t know if this helps but i also have an upload folder that i want to keep outside the deploy versioning and i got help to create a deployment hook:
SHARED_DIR=upload
echo 'Checking the shared directory...'
if [ -d "{{ projectPath }}/$SHARED_DIR" ]; then
echo 'Found an existing shared directory.'
else
mkdir -p "{{ projectPath }}/$SHARED_DIR"
chown -R {{ username }}:www-data "{{ projectPath }}/$SHARED_DIR"
chmod -R 775 "{{ projectPath }}/$SHARED_DIR"
fi
# remove the storage folder if exists
if [ -d "{{ releasePath }}/public/$SHARED_DIR" ]; then
echo "Shared directory {{ releasePath }}/public/$SHARED_DIR is pushed. To make data persists across deployments, removing this directory and linking it to {{ projectPath }}/$SHARED_DIR instead."
rm -rf "{{ releasePath }}/public/$SHARED_DIR"
fi
echo 'Linking the shared folder...'
ln -s "{{ projectPath }}/$SHARED_DIR" "{{ releasePath }}/public/$SHARED_DIR"