# Migrate to Cloud Code for IntelliJ

This document describes how to migrate your IntelliJ-based App Engine project
to Cloud Code for IntelliJ.

> [!CAUTION]
> **Caution:** As of January 31, 2024, Java 8 support for App Engine has ended, and will be deprecated on January 31, 2026. As a result, Cloud Code disables App Engine by default. To enable App Engine in your IDE, navigate to **Settings** \> **Google
> Cloud Code** \> **App Engine** . For more information about the runtime support schedule for App Engine, see [Runtime support schedule](https://docs.cloud.google.com/appengine/docs/standard/lifecycle/support-schedule).

## Before you begin

- If your project is Maven or Gradle based and uses the older
  App Engine SDK based plugins (e.g.
  `com.google.appengine.appengine-maven-plugin` and
  `com.google.appengine:gradle-appengine-plugin`), you should first migrate to
  the new gcloud CLI based
  [Maven](https://docs.cloud.google.com/appengine/docs/standard/java/tools/migrate-maven)
  and
  [Gradle](https://docs.cloud.google.com/appengine/docs/standard/java/tools/migrate-gradle)
  plugins.

- The new plugin does not support Datanucleus enhancement. If you depend on
  this feature, you will have to manually configure Datanucleus
  ([JDO](https://docs.cloud.google.com/appengine/docs/standard/java/datastore/jdo/overview-dn2),
  [JPA](https://docs.cloud.google.com/appengine/docs/standard/java/datastore/jpa/overview-dn2))
  enhancement for your project to migrate to Cloud Code.
  You should use
  [Objectify](https://docs.cloud.google.com/appengine/docs/legacy/standard/java/datastore#using_objectify_with)
  as your ORM layer when reading/writing to Datastore.

## Install the new plugin

If you haven't already, install the plugin by doing the following:

- Ensure you have the supported IDE version, JetBrains IDE version 2022.3+ (such as IntelliJ Ultimate/Community, PyCharm Professional/Community, WebStorm, GoLand), on the `PATH` of your machine.
- Open IntelliJ IDEA (or any supported JetBrains IDE).
- Open the plugins marketplace window using **File** \> **Settings** \> **Plugins** . For Mac OS X, use **IntelliJ IDEA** \> **Preferences** \> **Plugins**.
- Search for the 'Cloud Code' plugin and install it.

  You may be prompted to restart your IDE to activate the plugin.

## Configure IntelliJ and your project

After installing the plugin, configure IntelliJ and your project to use the new
plugin as follows:

1. When notified that the new plugin conflicts with the existing
   App Engine integration, click the link in the prompt.

2. In the following Disable Plugin prompt, select 'Disable and Restart' to
   disable the App Engine plugin and restart the IDE for the plugin
   configuration changes to take effect.

3. When notified that your project is in an old format, click the option to
   **Convert** your project to the new format.

4. You should delete your existing App Engine Server and Cloud
   instances and recreate them using the new gcloud CLI.

   1. Navigate to **Settings** \> **Build, Execution, Deployment** \>
      **Application Servers**.

   2. Select your **App Engine Dev** instances and click
      **Delete** (-).

   3. Click **Add** (+) and select **Google App Engine Dev Server**.

   4. Navigate to **Settings** \> **Build, Execution, Deployment** \>
      **Clouds**.

   5. Select your **Google App Engine** cloud instances and click
      **Delete** (-).

   6. Click **Add** (+) to configure an App Engine cloud deployment
      target.

5. If you have any App Engine local server run configurations, then
   you must update them to use the newly configured Application Server.

6. Navigate to **Tools** \> **Cloud Code** \> **App Engine** to see the list of actions
   available to you for running and deploying your application, or view
   [the documentation](https://docs.cloud.google.com/code/docs/intellij/how-to) for more information.

7. For Maven or Gradle-based projects, ensure that you are using the latest
   version of the Gradle and Maven App Engine plugins.

## Configuring IntelliJ-specific projects

For IntelliJ-specific projects only (i.e., projects that have manually configured
project settings with the old App Engine facet and are not synced from
Gradle or Maven), update your App Engine dependencies.

Your App Engine dependencies are still configured as
'External Libraries' and provided by your old App Engine SDK
installation. If you delete your App EngineSDK installation, your
application will not compile.

To remove this dependency on the old App Engine SDK, configure your
App Engine API dependencies using the App Engine Facet
library import feature as follows:

1. Users of the old plugin's Datanucleus JDO/JPA enhancement feature need to
   port their applications to Maven or Gradle as Datanucleus enhancement is not
   supported by the Cloud Code plugin.

2. From the IntelliJ Project Structure UI, navigate to your App Engine
   Standard module's dependencies tab.

3. Remove all App Engine related libraries.

4. In the same Project Structure UI, navigate to your App Engine
   module's **Google App Engine** facet.

5. In the **Libraries** panel, select the App Engine dependencies you
   are using.

   This action will automatically retrieve these dependencies from Maven
   Central and add them to your module classpath.
6. Run locally and deploy to verify your new configuration is working.

7. At this point, you can safely delete your old App Engine SDK.

## Get support

To submit feedback or report an issue in your IntelliJ IDE, go to **Tools** \> **Cloud Code** \> **Help / About** \> **Submit
feedback or report an issue** to report an issue on [GitHub](https://github.com/GoogleCloudPlatform/cloud-code-intellij/issues).