Where are app files located? Deployed with MUPX [SOLVED]

I have deployed using mupx (multiple times) and the app is live. I lost my local files and I only have the files in the server.

Where are the app files located so that I can download?

Which files are you looking for? The bundled files should be in the /opt folder.

I’m looking for everything except .meteor folder

That’s tough. The files are bundled together when you use mupx. AFAIK, there wouldn’t be a way to access the original files once they are bundled…

shit… there are already people using the app and I have to somehow restore the files…

I know it doesn’t help now, but in the future, I strongly suggest something like github.

How did you lose the files?

1 Like

I copied and replaced to the wrong folder… and the mac “undo” just erases the files and doesn’t bring back the old ones.

Time machine? Or something similar? I think you would have better luck trying to get your local files back than trying to get anything useful from a mup deployment.

Not really. I have a back-up with Time Machine but from a month ago.

And that doesn’t have the files?

very old files… I worked on it almost everyday since then…

/opt/appName/current/bundle/programs/server/app seems to have all the server files put one after the other with nice commenting that describes the original file location, that’s a start

2 Likes

but client files seems to be minified…

Ah, yeah I forgot that the server files weren’t minified. Good catch!

1 Like

Where you using server side rendering by any chance (in which case your client files would be accessible from the server and should appear somewhere in the non minified code)

1 Like

Is there a way to reverse engineer source maps?

Unfortunately, I didn’t use SSR and the most important file I need is in client. I can rewrite everything but only one file would save my butt. I have my CSS, methods.js and the most important html file. I’m gonna check the server again just to be sure anyway.

weird, I don’t have anything under /opt/RPN/current/bundle/server
RPN is my app name

I mean, I have the folder but it doesn’t show anything when I type 'ls’
and ‘cd app’ says “app: No such file or directory”

Weird. We might be using different versions of mup(x) but you should have the server file somewhere and there’s no reason for it to be minified.
Yup getting the client only code will be a pain…

1 Like

You should be able to find the minified, concatenated client js file in /opt/RPN/app/programs/web.browser.

It’ll look something like this: 28db495099e91ab213198df35eab97aa9cf6253a.js (with different letters and numbers).

Take that minified/uglified client code, and run it through this: http://jsbeautifier.org/

It’ll still be a ton of work to beat back into its original shape (splitting it into the correct files and renaming variables), but at least it’ll be working code, which may be better than writing the whole client codebase again from scratch. Templates will already be compiled into js, so they’ll all need to be rewritten – that’s pretty soul-destroying right there.

You’ll find the server files in /opt/RPN/app/programs/server/app.

One issue you’re going to have is with shared code – removing it from the client files you’ve recreated and from the server folder and putting it in folders that are shared (like /lib in the app root directory). Luckily the server folder names should give a fairly clear indication of what’s needed where in terms of shared and server only code.

Good luck. You have my heartfelt sympathy.

My strongest recommendation: get a Github account set up asap.

2 Likes