You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 1, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+16-16Lines changed: 16 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@
6
6
## Prerequisites
7
7
8
8
- A Google account (G Suite accounts may require administrator approval)
9
-
- A Google Cloud Platform project with an active billing account
9
+
- A Google Cloud Platform (GCP) project with an active billing account
10
10
- Familiarity with operating system terminal/shell commands
11
11
- General skills in [Python](http://python.org) 2 and/or 3
12
12
- Familiarity with the App Engine Python 2 runtime
@@ -15,7 +15,7 @@ The intended audiences of this tutorial and corresponding video content are Info
15
15
16
16
## Cost
17
17
18
-
Use of Google Cloud Platform (GCP) products & APIs is not free. While you may not have needed to enable billing with early App Engine applications, all applications now require an active billing account. App Engine's [pricing](https://cloud.google.com/appengine/pricing) and [quota](https://cloud.google.com/appengine/quotas) information should be referenced. App Engine and other GCP products have an ["Always Free" tier](https://cloud.google.com/free/docs/gcp-free-tier#always-free). Users only incur billing when these daily/monthly quotas are exceeded. The migration exercises in these tutorials should not incur any billing so long as you stay within the limits described above.
18
+
Use of GCP products & APIs is not free. While you may not have needed to enable billing with early App Engine applications, all applications now require an active billing account. App Engine's [pricing](https://cloud.google.com/appengine/pricing) and [quota](https://cloud.google.com/appengine/quotas) information should be referenced. App Engine and other GCP products have an ["Always Free" tier](https://cloud.google.com/free/docs/gcp-free-tier#always-free). Users only incur billing when these daily/monthly quotas are exceeded. The migration exercises in these tutorials should not incur any billing so long as you stay within the limits described above.
19
19
20
20
## Support for Python 2 & 3
21
21
@@ -32,24 +32,24 @@ We present a very basic first-generation Python 2.7 App Engine app and walk deve
32
32
The sample app does not address complexities in your apps but serves as a guide to give you an idea of what is required for each of the migrations. The baseline sample is a Python 2.7 (Gen1) app built on the `webapp2` micro web framework and uses the `ndb` App Engine Datastore library.
33
33
34
34
> **NOTE:**
35
-
> 1. It is also possible your app does not have a user interface, i.e., mobile backends, etc., so migrating the web framework (step 1) can be skipped.
36
-
> 1. Users interested in bringing back their dead apps that originally ran on the [deprecated Python 2.5 runtime](http://googleappengine.blogspot.com/2013/03/python-25-thanks-for-good-times.html)(shutdown in 2017) need to[migrate from `db` to `ndb`](http://cloud.google.com/appengine/docs/standard/python/ndb/db_to_ndb) before attempting the techniques shown in this tutorial.
35
+
> - If your app does not have a user interface, i.e., mobile backends, etc., you still need to migrate to the Flask web framework to handle mobile app requests. An alternative is to use Cloud Endpoints or migrate your app to the [Firebase mobile & web app platform](https://firebase.google.com) where you can port your App Engine "API handlers" to [Cloud Functions for Firebase](https://firebase.google.com/products/functions).
36
+
> - Users interested in bringing back their dead apps that originally ran on the original Python 2.5 runtime ([deprecated in 2013](http://googleappengine.blogspot.com/2013/03/python-25-thanks-for-good-times.html)and [shutdown in 2017](https://cloud.google.com/appengine/docs/standard/python/python25) must[migrate from `db` to `ndb`](http://cloud.google.com/appengine/docs/standard/python/ndb/db_to_ndb) before attempting the techniques shown in this tutorial.
37
37
38
38
As mentioned above, some steps are more critical while others are *optional*. We recommend incremental updates. We designed each step to be relatively easy, so you experience each migration individually. However, there are some of you for whom the migration process may be easier where you may be able to take larger migration leaps.
39
39
40
40
We suggest considering where you want to end up eventually, playing with each migration step, then choose how you want to migrate your application then plan your path forward accordingly. For your app, determine how much migration you want to do, execute it, ensure all your unit tests & CI/CD work perfectly, and get to a stable place before taking the next step.
41
41
42
42
## Table of Contents
43
43
44
-
Each major migration step has its own codelab & corresponding overview video. The step numbers correspond to their own folders, and generally each have folders for Python 2 & 3 ports. Some have an alternative or secondary succeeding migration&emdash;these end with "a", i.e., "Step 2a".
44
+
Each major migration step has its own codelab & corresponding overview video. The step numbers correspond to their own folders, and generally each have folders for Python 2 & 3 ports. Some have an alternative or secondary succeeding migration&emdash;these end with "a", i.e., "Step 3a".
45
45
46
46
1. Migrate from `webapp2` to [Flask](https://flask.palletsprojects.com/)
47
-
-Stongly recommended if you have a web UI
47
+
-Strongly recommended if you have a web UI
48
48
- You can use another web framework as long as it supports routing
49
49
1. Migrate from App Engine NDB to Cloud NDB
50
50
- Stongly recommended
51
51
- Can migrate from Python 2 to 3 after this step
52
-
- Can migrate directly to Cloud Run after this step (see Step 2a below)
52
+
- Can migrate directly to Cloud Run after this step (see Step 4 below)
53
53
- Remaining datastore migration steps optional
54
54
1. Migrate from Cloud NDB to Cloud Datastore
55
55
- Cloud NDB works on both Python 2 & 3 App Engine runtimes (old & new), so it is optional
@@ -60,7 +60,7 @@ Each major migration step has its own codelab & corresponding overview video. Th
60
60
- It's for those who **must have** Firestore's (new) Firebase features
61
61
1. Migrate from App Engine to Cloud Run
62
62
- Migrate your app to a container with Docker
63
-
- Alternative container migration with Buildpacks (see Step "4a" below)
63
+
- Alternative container migration with Buildpacks (see Step 4a below)
[`step3-flask-datastore-py2`](/step3-flask-datastore-py2) | ⇓ or ⇒ or ⤓+º | [`step3-flask-datastore-py3`]('step3-flask-datastore-py3) | Migrate to Cloud Datastore
75
75
[ª`step4-cloudndb-cloudrun-py2`](/step4-cloudndb-cloudrun-py2) | ⇒ | [`step4-cloudds-cloudrun-py3`](/step4-cloudds-cloudrun-py3) | Migrate to Cloud Run (with Docker)
76
76
77
-
* We recommend users complete what we consider the minimum migration (Steps 1 & 2).
78
-
* If you a Python 2 App Engine app you want to modernize by containerizing, you can jump over Step 3 straight to Step 4 and stay there forever if desired.
79
-
* Step 3's migration to Cloud Datastore is most useful if you have other apps using Cloud Datastore; you can make your codebase consistent by migrating from Cloud NDB to Cloud Datastore so all your Datastore access is consistent, possibly lowering your maintenance costs.
80
-
* Migrating to Step 4 is only useful if you wish to containerize your app and run it serverlessly with Cloud Run. The Python 2 app uses Cloud NDB while the Python 3 equivalent uses Cloud Datastore.
77
+
- We recommend users perform the minimal migration of Steps 1 & 2.
78
+
- To modernize a Python 2 App Engine app by containerizing, jump over Step 3 and go straight to Step 4 then stay there forever if desired.
79
+
- Step 3's migration to Cloud Datastore is most useful if you have other apps using Cloud Datastore; you can make your codebase consistent by migrating from Cloud NDB to Cloud Datastore so all your Datastore access is consistent, possibly lowering your maintenance costs.
80
+
- Migrating to Step 4 is only useful if you wish to containerize your app and run it serverlessly with Cloud Run. The Python 2 app uses Cloud NDB while the Python 3 equivalent uses Cloud Datastore.
81
81
82
82
There are several alternatives to consider to the main steps above: 1) migrating to Cloud Firestore for those who desire to take advantage of the next-generation of Cloud Datastore that has features from the Firebase real-time database, and 2) an alternative to building containers using [Cloud Buildpacks](https://github.com/GoogleCloudPlatform/buildpacks) instead of Docker.
83
83
84
84
### Alternatives
85
85
86
-
Cloud Firestore is the next generation of Cloud Datastore, inheriting features from the Firebase real-time database. However, use of Cloud Datastore and Cloud Firestore are mutually-exclusive, meaning applications (Google Cloud projects) can only use one, and once data has been entered, it cannot switch to the other, so migrating to Firestore requires you to "host" your application on a completely different project. It is only for users where those new Firebase features are a **must-have**. This migration's tutorial is Step 3a. There are two ways to deploy containerized apps to Cloud Run: Docker or Buildpacks. Those who don't want to learn Docker or don't want to be dependent on a single company like Docker would employ Buildpacks as an option. Step 4a represents the alternative to the Docker Step 4 tutorial by using Cloud Buildpacks. Both these alternatives are only available in Python 3.
86
+
Cloud Firestore is the next generation of Cloud Datastore, inheriting features from the Firebase real-time database. However, use of Cloud Datastore and Cloud Firestore are mutually-exclusive, meaning applications (GCP projects) can only use one, and once data has been entered, it cannot switch to the other, so migrating to Firestore requires you to "host" your application on a completely different project. It is only for users where those new Firebase features are a **must-have**. This migration's tutorial is Step 3a. There are two ways to deploy containerized apps to Cloud Run: Docker or Buildpacks. Those who don't want to learn Docker or don't want to be dependent on a single company like Docker would employ Buildpacks as an option. Step 4a represents the alternative to the Docker Step 4 tutorial by using Cloud Buildpacks. Both these alternatives are only available in Python 3.
87
87
88
88
Python 2 | Next | Python 3 | Description
89
89
--- | --- | --- | ---
@@ -114,6 +114,6 @@ Links to a more complete, canonical sample app will be provided if available. Ex
0 commit comments