When working on localhost the URLs have begun with http://localhost/~macuser/example.com/
and the file paths have begun with a local file path.
What is the best way to deploy a site once it is finished?
ExpressionEngine® Answers is a question and answer site for administrators, end users, developers and designers for ExpressionEngine® CMS. It only takes a minute to sign up.
Sign up to join this communityWhen working on localhost the URLs have begun with http://localhost/~macuser/example.com/
and the file paths have begun with a local file path.
What is the best way to deploy a site once it is finished?
IMHO, I suggest you start with a config file that will work irrespective of where your current environment is - there's a good gist here: https://gist.github.com/1329538
There's also a version of it here, but I haven't tested this one: http://ee-garage.com/nsm-config-bootstrap
After that, you'll want to get a good deploy workflow going. I suggest using GiT for your version control and Capistrano for the deploy phase. There is a really good guide on hive logic that should get you started: http://hivelogic.com/articles/deploying-expressionengine-github-capistrano
Finally, if you're migrating a db over, I suggest you look into REElocate plugin: http://devot-ee.com/add-ons/reelocate which is good for changing path variable in the database. This is a good way of uploading your database to the live server and then changing the values.
This is probably the best deploy setup I've come across so far for ExpressionEngine - most of the things that can usually get screwed up if you do them by hand are automated, and you can even roll back if something gets messed up during deploy.
It's a lot to learn if you've not used these technologies before, but well worth it! I heartily recommend learning as much as you can about both GiT and Capistrano! Good luck!
If you're not currently using version control or config overrides to manage your paths... then I highly recommend, Deploy Helper by Hop Studios. It places almost all the configuration parameters you want or need to change on a single screen. Which makes transition from one server to the next, much easier. This works, when you just need to move the site to a new location, regardless if its an official deploy or you just changed development servers.
REElocate by Esp:resso is also a deployment helper. It works similar to Deploy Helper and was done by the same company that produces Store.
There is also Master Config by Focus Labs. Master config works a bit differently. It gives you a process to set-up and deploy to multiple environments. It's worth having in your toolkit, and can be used for a completed project, but probably works best when you are starting a project. At least that's my opinion, others may disagree.
There are a growing number of articles around using version control
with ExpressionEngine, especially around Git. That's not something you want to get into in the middle of a deploy, but definitely something to look into. We're going to be using our first GitHub, ExpressionEngine deploy and management for a project that will launch in January.
If that is of interest to you (and it should be), then here are some recommended starting points:
(!)This one is my favorite reference point, just because its very close to how I want my set-up to be— local MAMP, Git, BeanStalk and Mountee.
I've been keeping a list of resources on the topic that I've found beneficial, you can access it here on Kippt. Hope this is helpful.
I like to add this System Config Override variable to my config.php file...
$config['site_url'] = "http://localhost:8000/";
...then change it depending on your environment. This way at least I have one less thing to update in the database between environments. I prefer that type of configuration to be in PHP anyway.
Perhaps using more of the Config Overrides can remove the need for any configured URLs in the database.
EE 3 reference:
https://docs.expressionengine.com/v3/general/system_configuration_overrides.html