Mupx blows away my .uploads folder every time i deploy


#1

Hi All,

Wanted to ask if anyone has encountered this situation. Every time I deploy the new version of my app using mupx deploy. All the images in my .uploads folder dissappears. I have setup mupx again, initialized etc, nothing seems to work. Any suggestions to fix this issue will be greatly appreciated


#2

Every time you deploy using mupx it re-creates the docker container where the app is running and with it your upload directory is gone too.

To persist your data you have to use Docker volumes https://docs.docker.com/engine/tutorials/dockervolumes/.
You will have to customize the mupx code to add volumes to your container, at least thats how we do it.

In mupx source in templates/linux/start.sh modify the docker run command by adding

This will create a docker data volume that will persist during deployments.
Hope this helps :slight_smile:


#3

Another option is to consider storing your uploads externally (on another server, in a database, in the cloud, etc.). This will not only make sure they aren’t touched when you redeploy with mup, but will also prepare you for the future in-case you need to start load balancing your app across multiple servers. Take a look at packages like edgee:slingshot and lepozepo:cloudinary for a great way to handle uploads using cloud servers (S3, Google, etc.).


#4

Just checked out the latest iteration of Meteor Up https://github.com/kadirahq/meteor-up. It seems that it is now the recommended release and you can create docker volumes from the config file without modifying the source.


#5

@od1k So you are saying mup not mupx is the way to go now? I never had this problem with mup, so i guess i will try it out again


#6

There are three separate versions of mup right now, hence the confusion. First there was mup (nowadays sometimes called “classic mup”), which is deprecated. Then there’s mupx which is the current “stable” version, and finally kadirahq/meteor-up or just mup, which is the current development version, but many people already use it in production.

Classic mup: https://github.com/arunoda/meteor-up
MupX: https://github.com/arunoda/meteor-up/tree/mupx
New mup: https://github.com/kadirahq/meteor-up

I still use classic one btw, but I’m a dinosaur :smile:. As they say: if it ain’t broke, don’t fix it.


#7

I was using the classic one until i ran into some problems a couple months ago. I might go back to it and try it again


#8

If you want to use classic one on Meteor 1.3 or higher you might want to check out my fork which is fixed to work with these. Original version is not compatible with Meteor 1.3.


#9

Ah good one. I rember i had issues after upgrading but not sure what the source was


#10

Thanks. you have saved me after three days of searching :joy: :innocent: