Creating a local environment from an existing GAE installation - google-app-engine

I have a website that is currently running under GAE... unfortunately, I, nor anyone on the team, does not have access the local environment that it was created from.... Is it possible to create a local environment or at least get a copy of the application files and database from an existing GAE installation?

What you need is the application source code, not the "local environment".
Ideally this source code would be on a version control system (ie GIT,SVN), Google cloud platform provides free GIT repositories for your projects so you might try looking there first. There's also a tool for both Java and python that allow you to download the source of a deployed version, provided you are authenticated as either the dev who uploaded it or a project owner. EDIT: as stated by Dan Cornilescu this feature can be disabled.
As for the database info there's plenty of tools available to "export" your GAE datastore info, just consider for your project that it might be easier to do the queries manually than actually implementing this tools.

Thanks for help... But unfortunately, this code is not in GIT. Furthermore,
being new to Google hosting, I wasn't clear on my setup... My web instance is actually running within Compute Engine not Application Engine. Be that as it may, with some additional search, I was first able to find out how to browse my filesystem by accessing the VM Instances menu option under the Compute Engine section of the Google Cloud Platform interface. On the VM Instances page, it will show your instance and an option to the left side of the instance to connect with a drop down box that will allow you to open a browser window that shows the instance's file system. In addition to this, I found this link https://www.youtube.com/watch?v=9ssfE6ODpak that shows how to configure Filezila FTP client to access your server instance - very helpful. From there, I was able to download all of my site files from the var/www directory. Now, onto extracting my data... Thanks again!

Related

Downloading App Engine source code

So it seems from a few SO questions I've seen that this is a problem among other users. Recently one of our head dev's left and I inherited a lot of his projects. One of which, is a website that what seems like lives on an app engine from google cloud platforms. From the App Engine documentation, to download source code you use the appcfg.py download_app command. Which I did, however the only results I get back from that call is:
Fetching file list...
Fetching files...
And then it just ends. No error message or any kind of message at all, and of course, it did not download the source code into the output dir I specified.
Scratching my head and looking at various SO posts, someone mentioned something about going into the google cloud vm directly and doing the same command, and to my surprise finding the same exact behavior that I did in my local terminal.
This made me realize it must be something else at play. I took a look at my versions tab in the App Engine dashboard on GCP. I see my instance running, it correctly says Serving and if I click the link it brings me to the website which loads fine. However, under Size it says 0 B which made me think perhaps this is why the download_app isn't downloading anything, because the version is 0 B?
What I'm trying to figure out is why it says 0 B for the version, when clearly the site runs fine and how I can get the source code for this. Here's a screenshot for reference
And screenshot of my terminal (local). Obviously I omitted the -A and -V flags, but they are correctly set and if I purposely make them incorrect I do indeed get an error message.
EDIT
Just so everyone is aware, I also made sure my user had the correct permissions. Owner, App Engine Owner... and some others. I don't think that's the problem.
When you deploy an App Engine Flexible application, the source code is uploaded to Cloud Storage on your project in a bucket named staging.<project-id>.appspot.com. You can navigate in this bucket and download the source code for a specific version as a .tar file.
Alternatively, you can find the exact Cloud Storage URL for your source code by going to Dev Console > Container Registry > Build History and select the build for your version. You'll find the link to your source code under Build Information.
One thing to note however is that the staging... bucket is created by default with a Lifecycle rule that deletes files older than 15 days automatically. You can delete this rule if you want so that all versions' source code is kept indefinitely.
In your case I believe that may not have helped since files may have been deleted already but it's worth knowing you can get the source code from there (source code isn't pushed to Source Repository by default, your developer had to configure it manually).
Posting this since none of the listed methods on the web didn't take me to the code (by June 2021)
Note: appcfg.py is deprecated by Google
You could try accessing your source code through;
Google Cloud Platform > Debugger > choosing the version of the
Application from combo at top.
This will list the files of that version on the left pane. There is no way to download code automatically but you can copy-paste the code.
Advice: Push your code to a Git repository to avoid this hassle next time.
Hope you will find this helpful.
In the developer console you can select the respective project and check:
on the Services page - which services, AKA modules - as they used to be (and still are) called in various places, you app has deployed
on the Versions page - which versions for each of the services are deployed
This information is what appcfg.py download_app expects. See also:
the various appcfg.py options using its --help flag
How do I download a specific service's source code off of AppEngine?
You can also access the deployed source code live (if everything else fails it could still be a last resort method to get the code, but tedious), see my answer to Google Cloud DataStore automatic indexing
Update:
I just now noticed in your screenshot that it's a flexible environment app. The appcfg.py docs are in the standard environment section, I suspect it's not applicable to the flexible environment, for which what's deployed is actually a docker image built during the deployment operation. From Deploying your application:
Deploy your app to App Engine using the gcloud app deploy
command. This command automatically builds a container image by using
the Container Builder service and then deploys that image to the
App Engine flexible environment. The container will include any local
modifications that you've made to the runtime image.
It might be possible to access the code on the actual GCE instance running the app, by connecting to the running instance and starting a shell in your app container, see Connecting to the instance

How to export a project from IBM Bluemix PaaS to anywhere else as a Docker?

I lead a web/mobile project and I still need to know the tools we will be using for development.
We have a 6 months access to IBM Bluemix, and its security check tools, CloudFoundry, and others may appear really useful.
However, we don't want to rely on a solution that would trap our project without any possibility of migration if needed.
I looked up on the internet how to export a project from Bluemix as a docker, with elements created from IBM. I didn't find anything relevant (I might be bad at googling, but all I can find is "how to export to Bluemix/how to work locally").
Does Bluemix allow to export the entire project onto another hoster, does it depend on the services we used in the project ?
Thank you in advance.
If you package your application in a container you can run it on any provider that supports Docker. That could be another cloud, in a local datacenter or on your own laptop.
If you are planning to use Bluemix services as part of that application then you will have two options if moving your application off Bluemix.
Keep using the services in Bluemix but connect to them remotely from wherever you're now hosting your appliaction. This will require internet connectivity and you'll have to hard code the service credentials in to your application (not good practice).
Migrate the services as well as the application. This will only be possible for the non-unique services IBM offer e.g. Redis, Mongo, Elasticsearch etc.. You'll need to refactor your application to accept the new provider of these services.
If your service/app is dockerized, and is being hosted as a container on Bluemix.
You can pull the container image of your service/app in your own docker enabled cloud or local environment. Following steps can be followed for the same:
install bluemix-container cli package https://www.ng.bluemix.net/docs/containers/container_cli_ov.html
do cf ic login using your bluemix credentials
check for your images using cf ic images command
pull the image in your environment using docker pull <image-registry-url>
run the container with required parameters using docker run
Hope it helps. Thanks.

Azure Clickonce publishing

we are working on a WPF application which we want to publish as a click once smart client application.
We are able to publish the application on local machine using Visual Studio 2012 and configured it in IIS.
Now we want to upload the published smart client installer to windows Azure Virtual Machine with Windows Server 2012 and IIS 8. We cannot upload the locally published components as the URL configuration in the manifest and deployment file is that of local server. We tried to edit the entries using text editor but once we do the editing the files become unused and it shows xml parsing error when we try to install from the location.
we tried to publish the application direct to the Virtual Machine but it shows an error as Front Page Extension is needed in IIS. We tried to find Front Page extension but couldn't find an version for IIS 8 in Windows Server 2012.
Can any one help us to publish the application in Azure Virtual Machine.
The problem you are having has nothing to do with Azure per se.
In the first case (of editing the XML files), you can do that but it's best to use MageUI to do the edit, because you can then re-sign the manifests. If you just edit the files, it messes up the security on them, and they will not work (as you have found). If you want to edit them with a text editor, you can do that, but then you must re-sign them (using mage); you can create a script to change the installation URL.
Or you can use MageUI. You need to do it in this order:
Open the application manifest in the versioned folder and then save it, re-signing it with your signing certificate.
Open the deployment manifest (yourapp.application) in the top deployment folder. Change the Start Folder to be the right Installation URL. Go to the "Application Reference" tab and re-select the application manifest in the versioned folder. (I know, it hasn't changed, but trust me, you have to do this.) Save this manifest and sign it with your signing certificate.
Copy the deployment manifest from the top folder to the versioned folder. It's always good to keep a copy, so you can go backwards a version if you need to.
NOW you can copy the files to your VM and they will work fine.
In the second case, the Front Page Extensions are required if you are using HTTP to publish the application, yet they are no longer available past about Windows Server 2008(?). So don't use HTTP. Use FTP. Set the publish file location using FTP, like ftp://myserver.mycompany.com/myfolder and set the Installation URL to the HTTP equivalent of it. Then publish it. It will put the files on your VM (assuming FTP is enabled on both sides), and the HTTP link should work.
By the way, you can also host your deployment in Azure blob storage. It is dirt cheap, and you can use something like Cerebrata Cloud Storage Studio or even write your own code to publish it (which I did). This article explains how to put the files out there, what the MIME types need to be, etc. If you do this, then it will work even if you need to replace your VM or redeploy it or the VM becomes unavailable for some reason.
here is a reference to Avkash Chauhan's blog post explaining in detail How to deploy ClickOnce Application using Windows Azure Storage in very simple steps?
http://blogs.msdn.com/b/avkashchauhan/archive/2011/05/09/how-to-deploy-clickonce-application-using-windows-azure-storage-in-very-simple-steps.aspx
He also gives an code example of a windows form (using Wpf) that he shows how to deploy on azure using one click deployment.
hope this helps

DNN / WebMatrix / Localhost / Multiple Sites

It seems that DNN is undergoing an upgrade and I cannot access the forums or many of the docs. Needing an answer soon, and Google providing too many varied types of hits (none of which are helpful or most of which post to the DNN site that is undergoing that upgrade), I had a few questions about setting up DNN.
First, I am coming from Orchard. There I was able to use Webmatrix - I downloaded the web version, opened as administrator, created modules, messed with themes, etc. Using the Orchard Docs, I was able to set up a multi-tenant site and run it on local host (IIS express through Webmatrix) - this included modifying the host/config files to view the multi-tenant sites. I could then publish to my own server running IIS 7. On the server I set up the landlord site then bound the tenants with no problem.
Being new to DNN (and things not being readily available at the moment on their site), I was hoping I could get some guidance on how to set up DNN similar to what I did with Orchard.
First question is obviously whether or not that is possible (i.e., no IIS, only IIS Express (Webmatrix) on my local machine).
Here would be my other questions:
If I can run it locally, can I just download the 7.1.0 new install package, and open Webmatrix (as Admin) on the folder I unzipped it in?
Assuming I just "Run" the website, I will then set up the "Landlord" instance of DNN on the following screens, correct? (i.e., where it asks for credentials and what DB setup I can use)
Can I then go ahead and create sub-tenant sites (alias/portal)? If so, do I go about manually updating my host/config files to run those tenants (depending on the port)?
Assume all of the above is correct, do I have to "reinstall" the 7.1.0 package on my webserver, or will a simple publish from Webmatrix do (with the proper credentials in Settings)? If so, I can handle pointing to the landlord on my server and then binding my subtenants in IIS.
Sorry for the n00b questions. Thanks!
On the Download page on dnnsoftware.com, there's a link to click which will start the install process within WebMatrix: http://www.microsoft.com/web/gallery/install.aspx?appsxml=www.microsoft.com%2fweb%2fwebpi%2f2.0%2fWebApplicationList.xml&appid=106
When you create a new portal, you can specify that it uses a URL which is a subdirectory of the current URL (i.e. a child portal alias), so that you don't have to use different ports. I'm not especially familiar with IIS Express, so I would expect that you could point multiple ports to the site, and map those as different portal aliases, but not sure exactly how you could do that, if you don't want to make use of child portal aliases.
To publish a site, you should just need to push the file system and database, and setup IIS.

connection between postgresql db and application(jsf+hibernate) running on cloudfoundry

The application(JSF+hibernate) is been deployed using the vmc commands as on the cloudfoundry site. able to see the welcome page. postgreSQl service is binded with the application but the application is not able to connect with the database.
And also viewed about the VCAP_SERVICES using java but dont know much about it rather how to create it.
Cloud Foundry uses auto-reconfiguration if you have one service (either MySQL or Postgres) bind to your application. That means you don't need to touch your code at all!
Please review the following article on our docs site:
http://docs.cloudfoundry.com/frameworks/java/spring/spring.html#using-cloud-foundry-services-in-spring-applications
If you still have issues, go ahead and upload a war file of your app and we can take a look.

Resources