Setting up project with local mirror and remote production server

I'm new to PHPstorm/Webstorm.

My first challenge is that the options for using existing files don't quite match my set up.. or perhaps they do but I'm not see in.

We have our production/live web server in San Fransciso. These public_html directories for several sites are the "root authority" and are mirrored down to our local server here on the network.

BUT, we do developement on the local server which are mounted volumes on the desktop (Mac OSX) because it saves time... once the local files are working we push them to the production server. If anyone do not push their files to the production server by the end of the day, they risk having their local files deleted. Don't ask my about this... it's a big of a snake pit.  We could probably do better, but that's the set up now.

So I'm not sure if I should set up the project by choose the remote server as the source  or if I should point the local mirror as the source files. Another way this can be talked about is  for working purposes: the local mirror is our development server (at least for the day) and the remote server is the distribution server.

so what is the best way to set up the project with this context?

3 comments
Comment actions Permalink

Hi there,

Just create new project from local files (as simple as "File | Open Directory..." .. or just "Open Directory" on Welcome screen). Once done -- you can configure the rest.

The uploading stuff is configured at "Preferences | Deployment" -- just create new entry of correct type and mark it as Default for this project.

To upload files to remote location just select files/folders and choose "Upload to xxx" from content menu .. or you can use "Deployment | Sync with Deployed..." to perform 2 way synchronisation (where you can preview all changes and decide what files you want to process and which way (upload or download, delete or do nothing)).

If anyone do not push their files to the production server by the end of the day, they risk having their local files deleted.

Wow. Just wow. And what will happen if file(s) where not tested enough yet?

I understand if files are kept intermediately somewhere (e.g. separate dev server), ... but requirement to upload possibly unfinished code to a production ...

BTW:
PhpStorm does not work great with files directly over network (e.g. network share/folder mounted as local; it works fine/acceptable for some and does not work well for others). It is highly recommended to have actually local files (on your physical HDD/SSD) -- devs do not accept bugs/performance issues with such setup (as IDE requires very fast (low latency) access to project files and may show random lags/temp freezes for no obvious reason -- mainly when project is big).

With files on your local disk, you can then set up automatic deployment to dev server/network share. With such set up you will have 2 Deployment entries -- one for dev (default) and one for production. For dev you can use jsut "Uplaod to XXX" and for production one use "Deployment | Upload to ..." where you can choose to what server upload to)

0
Comment actions Permalink

Thanks Andriy:

First, just so you don't think we are "nuts" most of the local "dev" is just staging of photos before pushing to WordPress on the distribution server and small edits of html files by lo-levels users who have simple auto-uploads set for the remote production server. The real serious work on Node.js, Php frameworks and complete new html/css page development is done on a remote development server on the same box as the distribution server and we sync when it's ready to go live. And more my "remote" dev's  have no access to the LAN here... they keep copies on their own hard drive.....hence the need to make that server the "root authority" for the mirrors because we have changes being made by people in several differen countries. it would be very rare that someone actually here does any indepth serious development on the local mirror volume here... Most things are handled within 20 minutes of the time someone adds or touches photos/files locally -- they get uploaded right away.

I myself tend to work "live" on the remote dev server and then sync to the production server.

But since I really can't set up a project on the remote dev server (you say this will not work because of latency issues) and since I may have some extensive development spanning several days...I think I will take your advice and set up  a

/Documents/Sites/my.website.com/public_html/

right on my own box and copy down just the folders/files I need.

But I really don't want to copy 20 GB of data from the web server to my machine! So I hope I can just mirror the directory structure, top level folders, and leave them mostly empty except for files I actually need. The present job involves XOOPS and so I'm thinking I just need to make a copy of

public_html/themes

on my hard drive  and then use that as my project...I'm not running apache on my box here (though I could...) so I'll have to preview after deployment to the dev server.

I'm looking forward to this... I've been using BBEdit for years and the Coda... and tried SublimeText... but still nothing quite does it for me, but one of my Devs says he loves PHPstorm... so we will see...

I hope you are warm in Russia!  I'm in Hawaii.

Thanks for your guidance...Mahalo!

0
Comment actions Permalink

But I really don't want to copy 20 GB of data from the web server to my machine! So I hope I can just mirror the directory structure, top level folders, and leave them mostly empty except for files I actually need.

Yes, you can do that.

If you have no local copy yet then:
1) Create brand new empty project locally
2) Setup deployment entry
3) Use "Remote Browser" and choose what files/folders to download

To avoid accidental uploading of unnecessary local folder or downloading remote folder, just add those paths to the excluded list (separate tab on Deployment settings). Remote exclude can be added directly when browsing remote site via context menu, local one needs to be added there manually.

I hope you are warm in Russia!  I'm in Hawaii.

No idea. But it's not too cold (+10) here in UK ;)

0

Please sign in to leave a comment.