Moving/deploying a project involving Filer without breaking the files

Currently I like to deploy like this:
I finish the project on my local PC and then upload the entire project on to the hosting server. This mostly works fine, except when a project uses Filer, all the files break.

This is how I go about it:
I upload the project code. I do the migrating, eventually load the data into the database. I upload the static files and do the collecting. I also upload all the contents of the media folder.

The result is that my project is running just fine, except all the images managed by Filer are gone. The concerned project is a Django CMS project. When I go to a page including a Filer image, the page will not open. I get a 500 Server Error instead. The same thing happens when I try to use the backend to delete an image. I get to the first level of the file browser, but when I get to the folder with the images, I also get a 500.

I have not found any way to fix this through the user interface. It is possible to delete all the database entries relating to the image and to delete the page including the image. When I recreate the page and upload the image on the server instance of the project, evrything works fine. However, every time I move the project from the server to local or the other way around, the images will break again.

My impression is that it might have to do with the hash named folders that Filer creates to store images in. Any suggestions what I can do to make Filer fully plug’n’play?

First, I’d verify the simple stuff.

Make sure that the file ownership and permissions of the files you’re uploading match what’s being assigned when you upload through the site.

Then, you might want to check a sample file or two at the database level to see if there is any difference in the database entries being made for those two fields.

This might be a problem with a fairly simple solution.

(I’ve never used filer, but I have moved sites with user-uploaded content. It does work.)