IIS 8.5 Batch Update Folder Paths - migration

We currently have a web farm of three servers and the application code is held on a fileshare on a separate device. We are running a project to migrate the applications to a separate storage device which will ultimately have a different root UNC file path.
We previously managed a similar operation on IIS 6 by simply modifying the metabase.xml file, however I don't believe this is a possibility in IIS 8.5
What is the best way to manage this migration considering that the web farm is running 200+ applications? Is there a convenient migration tool or configuration file?

After a bit more digging and running some tests on a Dev server, I found a fairly straightforward solution:
Run cmd
Navigate to the inetsrv folder: cd %systemroot%\system32\inetsrv
Run the following command to output a list of directories: appcmd list vdir /config /xml > C:\VDirOutput.xml
You can now edit the C:\VDirOutput.xml file manually using your favourite text editor to change the directory paths as required.
Import the new settings by running this command in cmd: appcmd set vdir /in < C:\VDirOutput.xml

Related

Deploy problem with project with an access database integrated

I´ve been having problems with my project and the database it has. I have created a simple project and I created an access database in it, the database is in the project folder. This is the connection string specified in the App.config:
<connectionStrings>
<add name="Project.My.MySettings.BaseDeDatosConnectionString"
connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\Recursos\Datos\BaseDeDatos.accdb"
providerName="System.Data.OleDb" />
</connectionStrings>
But when I publish my project, install it in my computer and executed it I get the error:
'C:\Users\USER_NAME\AppData\Local\Apps\2.0\Data\6QPXHXGQ.ZM0\MVT91HXD.V1B\simu..tion_0000000000000000_0001.0000_49edcdec2714f7aa\Data\Resources\Data\Database.accdb' is not a valid path . Make sure that the path is spelled correctly and that you are connected to the server where the file is located.
And of course the program remains useless. I´ve checked the folder and indeed there is no data base in there, I didn't even knew it would create a file there (I know nothing related to databases and deployment, I am just following tutorials). I was using a SQL data base before and it worked fine after installation, but I had to change it. What could I be missing?
I am using VS 2015 in spanish and VB.NET.
If you are using the Publish functionality in VS then you are using ClickOnce. ClickOnce apps have a dedicated folder to which "|DataDirectory|" resolves at run time. It is NOT the program folder. If you want to use "|DataDirectory|" in your connection string then you have to specify that the data file is indeed a data file via the properties, so that it will be placed in that folder. I don't really use ClickOnce but I believe that, to do that, you need to open the Publish page of the project properties, click the Application Files button and then set the Publish Status of that file to Data File. I'm not sure whether the subfolders for the source file will be honoured after publishing or not but you can test that.
Note that, if you simply copy the application files to the target machine or use some installer technology other than ClickOnce then "|DataDirectory|" will resolve to the program folder. For the record, it resolves to the App_Data folder for ASP.NET apps (possibly only Web Forms, not sure).

Pass runtime arguments to grails project on tomcat server

I'm trying to pass in a variable at runtime to my application to configure where my external config files are stored.
I need external config files so that the config can be changed without having to deploy a new release every time the config changes, and want to be able to define the location of these at run time so the applications is more portable and the team deploying the application can follow their existing rules on where to store config.
I have read answers like this:
How to add custom "-Djava" arguments to Grails app? - but I'm not sure how this relates to me from the point of having the war file on my local machine, to deploying this with the param being passed in. I have been using the Tomcat Web Application Manager to simply select the war file to upload, and clicking delpoy - the file is uploaded and automatically exploded out and launched.
https://grails.github.io/grails-doc/latest/ref/Command%20Line/war.html - This suggests that the arguments have to passed in at the point of creating the war file which is not what I'm after.
In my code I have:
grails.config.locations = ["${System.properties['configFolder']}/application-config.properties"]
and I am looking for a way to include arguments when deploying from the Application Manager, or a command something like
deploy myApp.war -DconfigFolder="/usr/share/tomcat5/.grails/myApp/conf/application-config.properties"
EDIT
Turns out you're meant to pass in the runtime parameters when you start the tomcat server (or just after), not when you deploy the application.
The command needed is:
export CATALINA_OPTS="-DconfigLocation=/usr/share/tomcat5/.grails/TAPaS/"
or whatever params/values you want.
This can either be entered manually once the server has been started, or you can create a setenv.sh file containing that command within the CATALINA_HOME directory. This can be found out using the echo $CATALINA_HOME. Another way to find it is to use the start command below, and view the response, e.g.
bash catalina.sh start
Using CATALINA_BASE: /opt/apache-tomcat-7.0.61
Using CATALINA_HOME: /opt/apache-tomcat-7.0.61
Using CATALINA_TMPDIR: /opt/apache-tomcat-7.0.61/temp
Using JRE_HOME: /usr
Using CLASSPATH: /opt/apache-tomcat-7.0.61/bin/bootstrap.jar:/opt/apache-tomcat-7.0.61/bin/tomcat-juli.jar
If you have added the command to the setenv.sh file, use the command bash catalina.sh start to start the server. bash catalina.sh stop is used to stop it. You will need to use the path to .sh file if you're not in the directory of them.
As far as I can work out, this is not possible.
Whenever a .war file is dropped into the appBase
if autoDeploy attribute is "true" then the application will automatically be deployed while the Tomcat server is running
else, the application will be deployed when there Tomcat server is started
bash /opt/apache-tomcat-7.0.61/bin/shutdown.sh
bash /opt/apache-tomcat-7.0.61/bin/startup.sh
will shutdown and the start up the server again and any .war files that are in the appBase will be deployed.
The only instance I can see where an actual command is needed to deploy is when using the Client Deployer Package. More information on Tomcat Deployment found at: https://tomcat.apache.org/tomcat-8.0-doc/deployer-howto.html

can I install wamp twice in different folders?

I'm facing a problem due to the folder name "Program Files" in which my wamp is installed.
I'm using Yii Framework to create a web app.
While running a command
yiic webapp c:\Program Files\wamp\www\YiiApp
it gives error due to the white space in the folder name.
The error is as below:
C:\Program Files\wamp\www\yii-1.1.13.e9e4a0\framework>yiic webapp c:\Program Fil
es\wamp\www\YiiApp
Error: Unsupported VCS specified. Currently only git and hg supported.
USAGE
yiic webapp <app-path> [<vcs>]
DESCRIPTION
This command generates an Yii Web Application at the specified location.
PARAMETERS
* app-path: required, the directory where the new application will be created.
If the directory does not exist, it will be created. After the application
is created, please make sure the directory can be accessed by Web users.
* vcs: optional, version control system you're going to use in the new project.
Application generator will create all needed files to the specified VCS
(such as .gitignore, .gitkeep, etc.). Possible values: git, hg. Do not
use this argument if you're going to create VCS files yourself.
What should I do? Please suggest me something.
The second install will have superceeded the first. In other words Wampmanager and Apache and MySQL will be being started out of the new folder.
As per your question on wamp forum, copy wwww/subfolders into the new location and then copy ONLY YOUR databases from mysqlx.y.z/data into the same place in the new location.
Then delete the folders from program files.
You only need one wamp ( Apache/MySQL) per system.
I tried something else:
Without moving the previously installed wamp's content just read the
"uninstall_services.bat" file
just uninstall these services from that wamp directory which you want to disable.
Still the another wamp's services won't start. So install those services mentioned in "uninstall_services.bat" file manually from respective directories.
Now Restart All Services from the tray icon. The required wamp will be enabled.
If won't, try it again. No need to reinstall wamp.

Change Hippo repository path

Help me please!
My web application running on the server with Ubunta. Jenkins takes the code shown on Bitbucket, and then sets it and manually loads the war files in the Tomcat, that's not deployed by cargo. The problem is in the fact that when I manually brush my folder with the web application, then the next time when i install, all data from the repository( settings, users) disappear. I tried to configure auto export in the console, but the button is not active and press on the checkbox in the Configuration/ Modules/Autoexport also does not help. On the local machine everything works, button is active and data exported to the folder 'bootstrap' to the folder with the project. But on the server is no folders with the project, it on the Bitbucket. And the inclusion of auto exports to the configuration pom.xml file in the cargo.run plugin too does not fit, that's Jenkins not deployed through the cargo, and loads the war files in the Tomcat. Is there another way to change the Hippo repository path?
You can use -Drepo.path startup option. For more options please see this link:
Repository Deployment Settings
Automatic export functionality is there to help you during development, so on your local machine. It is started when configuring it in the cargo.run profile. This profile is typically not used on production servers.
More info on Automatic Export can be found here: http://www.onehippo.org/7_8/library/development/automatic-export-add-on.html
-Drepo.path = /path
-Drepo.Config = /repository.xml -> for database config http://www.onehippo.org/7_7/library/deployment/configuring/configuring-hippo-7-for-mysql.html

how do deploy an msbuild zip package locally or remotely without requiring IIS involvement

I am in the process of creating an application to allow the automation of application deployments, (https://github.com/twistedtwig/AutomdatedDeployments#readme).
The idea being that everything is in source control, application files, application configuration as well as IIS configuration. My application allows the solution to auto deploy, (adding a post build setp to the sln / proj file), after a build to the dev machine. It will allow the CI server to auto deploy to its machine for testing as well as the CI Server pushing successful builds to QA / Test / production servers. One of the issues I have with msdeploy is the requirement of IIS to be setup with the website / application before hand, (which my app is trying to get around).
So far I can create, update and remove, app pools, websites and applications via config files automatically. I can sync files and folders fine. The last step was to use the /target:package switch in msbuild to create clean file structures for web deployments. For example I would run a command like:
msbuild.exe myMvcSite.csproj /target:clean /target:package /p:Configuration=Release /p:_PackageTempDir=C:\websites\mySite /p:PackageLocation=C:\dropLocation\mySite.zip
This creates a nice zip file with the internal file path of "C_C\wbesites\mySite" ready (as I understand it) to be sync'd to the production server.
My issue is how I deploy this zip file. I want it to be independent of any IIS information, i.e. I am simply pushing the files / folders to a location, (either on the local machine for developers, or remote for testing etc). The setup of IIS with app pools and sites etc would be taken care of separately. Some of the commands (and their output) I have tried are below:
"C:\Program Files\IIS\Microsoft Web Deploy v2\msdeploy.exe" -verb:sync -source:package="C:\Temp\deploy\installer\test\testPackage.zip" -dest:auto
Info: Adding sitemanifest (sitemanifest).
Error: The application pool that you are trying to use has the 'managedRuntimeVersion' property set to 'v2.0'. This application requires 'v4.0'.
Error count: 1.
and
"C:\Program Files\IIS\Microsoft Web Deploy v2\msdeploy.exe" -verb:sync -source:package="C:\website\installer\testPackage.zip" -dest:contentpath=C:\temp\mytest
Error: Source (sitemanifest) and destination (contentPath) are not compatible for the given operation.
Error count: 1.
The first command I am trying to let it unpack the files with the structure it has. It seems to be upset about app pool stuff though, (which I don't want it to touch).
The second I am trying to get around the "auto" bit but this isn't happy either.
I am struggling to find much information about this process.
The only way I can see how I might achieve this at the moment is to not use msdeploy for it, but to create my own task to integrate the file structure and do the file syncing my self, (not ideal).
I ended up coding around this issue, rather than being able to solve it.
I take the zip package:
unzip in a temp location
find the final path it will be going to (normally from archive.xml)
check to see if I am merging the folders or doing a clean install, (i.e. do I delete the destination folder first).
copy / push files to end location, (normally with msdeploy).
I open sourced my solution to this: https://github.com/twistedtwig/AutomatedDeployments