Setup DEV / CLIENT environment and prepare SVN files

UpdateCase includes a client that makes the process of setting up staging / testing websites very easy. With the click of a button you can quickly copy all the live files from the LIVE website to DEV / CLIENT testing locations. 

This helps to:

  • Test out new code before showing to the client or going LIVE
  • Upload code to be approved from the client before going LIVE
  • Allow project management staff to launch changes opposed to technical staff -> which saves valuable resources

There is a password to login to the client which you can get from our support staff.
-> However we are happy to affirm even access to the client cannot disrupt a website, since you can only prepare testing locations and launch. It is NOT possible to take a website offline using our client. 

# 1 > Download the client

Logon to UpdateCase.com and click on the side menu
-> Click download client
-> This will download to your downloads folder on your computer

NOTE: Some browsers protect you and change the file to .html -> simply rename the file to ensure it ends with .php

# 2 > Logon to your control panel

Now logon to your control panel for your website
-> If you do not have this information simply contact our support team

First time you need to prepare the test location for our DEV and CLIENT locations
-> Click to 'subdomains'

If the test locations are already setup you can skip ahead

# 3 > Create the test & backup subdomains

Create a subdomain 'test' which will hold all the test websites.

Also create a 'backup' folder -> We keep backups each time a website is launched so you can revert if any issues arise. 

You will now be able to access your test folder by:
-> The username and servername are included with the hosting subscription information. 

# 4 > File manager

From the home screen of your control panel
-> Click on file manager

# 5 > Change to test

You are now viewing all the subdomains of your website
-> www - is your live website 
-> backup - holds all the backups each time you launch an update
-> test - is where we store all your DEV / CLIENT versions of the website
-> dev - this is optional: there are time you need to have a test website on the root: this means you can access by dev.yourwebsite.com -> so in this case you would also need to create a separate FTP entry to point to this location (see docs for more information)

# 6 > Setup

You are now inside the 'test' subdomain of your website. 
-> Create a folder 'dev' -> this is used by programmers to test before the client see's any changes
-> Create a folder 'client' -> this is used to show changes to a client before we go live.
-> Click 'browse' => find the client you downloaded from updateCase in your downloads directory -> upload
               -> After the file uploads change the permissions to: 775


If you want to hosting MORE then one website on a server you will need to prepare the subdomains to match
Create a NEW subdomain 
- testanothersite.domain.com 
-> within create dev / client
Also create the LIVE location
This will allow to setup mutiple sites on a server
Then you need to modify your code on the WWW subdomain so it redirects to the correct subdomain based on the domain name 

# 7 > Multiple websites on a single server (optional)

If you want to host MORE then one website on a server you will need to prepare the subdomains to match

Create a NEW subdomain 
- ensure it is prefixed with 'test' EG: testanothersite.yourdomain.com *

After it is created using the file manager create dev / client

Now create the LIVE subdomain
- This needs to match the test location WITHOUT the prefixed 'test' EG: anothersite.yourdomain.com *

Next you need to create a redirect on the WWW subdomain that checks the domain name and directs to the appropriate subdomain
- Create index.php file on WWW subdomain OR integrate this script into the website that is located on the WWW subdomain
- In the example below if the domain name is 'yourdomain.com' it will redirect to 'anothersite.yourdomain.com' *

if (in_array($_SERVER['HTTP_HOST'], array('yourdomain.com', 'www.yourdomain.com'))) {
header("Location: http://anothersite.yourdomain.com/"); exit;

*yourdomain.com would be the domain name you have purchased

# 8 > Access the UpdateCase client

You can now access the UpdateCase Client to prepare files and launch website changes easily. 
-> Use your browser to access: 


username and servername -> are given with the hosting information

Password: This is given by our support team


# 9 > Make changes

The website is now configure:

After you login to the updateCase client you can do the following:

createDevFromCLIENT -> Copies the CLIENT website to the DEV website -> allowing you to make changes without uploading all your local files

createDevFromLIVE -> Copies the LIVE website to the DEV website -> ensures the DEV is exactly like the LIVE website

prepareCLIENTfromDEV -> When changes have been finished on the DEV website, this copies the changes TO CLIENT and you can then show the client the changes. 

prepareCLIENTfromLIVE -> Copy the LIVE to CLIENT -> ensures the CLIENT site looks the same as the LIVE website

launchDEV -> if changes were completed on the DEV website and are ready to go LIVE -> This will move DEV TO LIVE (LIVE will be moved to backup)

launchCLIENT -> After the customer approves the changes on the CLIENT website this moves the changes LIVE (What is on LIVE will be moved to backup)

restoreRecent -> If you launch and change that has adverse effects / causes issues you can quickly restore the more recent LIVE (You will need to prepare/create DEV / CLIENT after doing this)

cleanUpBackup -> If you are running out of space on your server you can clean up some old backups. This removes all backsup EXCEPT a few recent versions

DEV -> click to view the dev website

CLIENT -> cliek to view the client website

svnList / svnTest / log -> reserved for programmers only

TROUBLESHOOTING: If you ever push and you see a white screen, re-enable debugging to fix


# 10 > Prepare files / Upload

You are now ready to upload all the source files to the 'DEV' location and begin the project

We either create a new project from a template OR duplicate a previous project and modify according to the new project follow this url to proceed:

Now you can upload all these files to the DEV location using fileZilla

The password is available from our project management system 'passwords'

# 11 > View DEV/CLIENT

You now have all the files uploaded and you can view the DEV website

In the control panel you can find the information which is needed to create the link to access DEV

test = this is the subdomain (you created in the control panel)
username = This is the username of the account
server.com = this is written when you are logged into the control panel
dev = this is the folder in the test subdomain

dev can also be client = this is the link that you send to the clients for review

# 12 > Connect UpdateCase 1/2

UpdateCase is a system where all the content is PUSHED to the website
-> You need to configure both the sources files AND updateCase -> Variant

-> Click Websites
-> Click Variants
-> Edit the variant you are using
-> Add the urls 
LIVE: This is the live domain name that is used after the site goes LIVE
TEST (client): This is what the client views after we complete updates
NOTE: replace 'username' and 'server' with the correct info from the control panel 

DEV: This is used internally to work on updates
NOTE: replace 'username' and 'server' with the correct info from the control panel 

Click SAVE

# 13 > Connect UpdateCase 2/2

Next we need to modify the source files for our website to ensure it is connected to the correct revision within updateCase

Open 'AppController' this affects the entire website and it normally set here
-> find Configure::write("UpdateCase.variant_id", '###');
and replace ### with the VARIANT NUMBER withint UpdateCase

NOTE: occassionally this settings might also be within another controller EG PagesController

Upload this file and now the website and UpdateCase are connected
-> Make a change and click 'DEV' and you should see the DEV website update and change 

# 14 > SSH

You can update the files on DEV or CLIENT, using SSH

to login to SSH get the username and servername from your hosting information:

ssh username@server.com

Enter the password used for your hosting. 

NOTE: if you get a message that it is not activated then follow up with support to ensure SSH is activated on your server

Now change your directory to the test location and delete all the files before we re-export them
->NOTE this will erase all files on the directory in question, be careful you have chosen the correct directory. 

cd www/test
cd dev
rm -r *
rm -r .*

We can now export our files into this empty directory 

svn export --force https://svn.undologic.com/PROJECT/trunk/. . --username YOUR_USERNAME

NOTE: Allow the password to be written to the harddrive type yes

# 15 > Before Going Live - change the css files location

When you are ready to upload files to LIVE site, 
Do the following 2 steps before uploading to LIVE

   -> Navigate to view->layout->default.ctp ( the layout page you are using)
   -> Look for css file reference (change the letter to a new letter) eg style_e.css => style_f.css

Then change the file name in app/webroot/css/style_f.css

Now your browser will NOT require a refresh and all new styles will appear.