Migrate Drive Tables to Cloud SQL

Drive Tables are no longer supported in App Maker as of May 15, 2019. You can still switch your apps to Cloud SQL with the migration tool, but you can't export data from Drive Tables to import into Cloud SQL. When you migrate the app from Drive Tables, all preview instances of this app share the same Cloud SQL database.

Before you begin

  1. If your organization isn't already using Cloud SQL, ask your G Suite admin to set up a default Cloud SQL database.
  2. Make sure no other developers are working on the app.
  3. Identify and delete any unneeded data in your Drive Tables to make migration quicker and more reliable.
  4. Click Settings settings chevron_right Database and verify that your app is set to use the default Cloud SQL database. App Maker can't migrate data to a custom Cloud SQL database.
  5. If needed, republish the latest deployment to make sure any pending changes in App Maker are deployed.
  6. Test the app to verify the latest deployment works as expected.

Migrate your app to Cloud SQL

  1. Click Data to open your data models.
  2. Click Upgrade to Google Cloud SQL to migrate the models in your app.
  3. Leave the page open and do not reload or close your browser until the migration is complete.

    If your migration doesn’t complete or reports an error, try the migration again. If migration still doesn’t work, contact support.

  4. Preview your app and make sure it works as expected.

  5. Follow the steps in the next section to migrate your deployments to Cloud SQL.

Migrate your deployments to Cloud SQL

  1. Publish the latest revision to your deployment, which triggers the database migration for the deployment.
  2. Leave the page open and do not reload or close your browser until the migration is complete.
  3. Repeat the steps for any more deployments.

(Optional) Migrate from default to custom Cloud SQL

After you migrate your app from Drive Tables to a database on the default Cloud SQL instance, you can switch to a custom Cloud SQL instance. A custom Cloud SQL instance can be dedicated to your production deployment database. Choose this setup if you need a high-performance database that can support a lot of users and data, or a database that can be shared between apps. Contact your Google Cloud Platform admin to have the database set up.

To switch to a custom Cloud SQL database:

  1. Publish your app and make sure that it is working correctly. Tag the revision so you know which one was the last to use the default Cloud SQL database in case you need to revert to it.
  2. If your app has data in the default Cloud SQL instance database, that data isn't migrated when you switch to the database on the custom Cloud SQL instance. Export the data from the default Cloud SQL database to Cloud Storage as a SQL dump file. Learn how.
  3. If you want your preview instances to use a database on the custom Cloud SQL instance, update the Cloud SQL database settings for your app:
    1. Click Settings settings chevron_right Database chevron_right Switch to a custom Cloud SQL database.
    2. Enter the address with the format for your instance type:
      • First generationprojectName:instanceName/databaseName
      • Second generationprojectName:regionName:instanceName/databaseName
    3. Click Update.
  4. If you want a deployment to use a database on the custom Cloud SQL instance, update the Cloud SQL database settings for your deployment:
    1. Click Publish chevron_right Edit deployments.
    2. Click the down arrow keyboard_arrow_down chevron_right Edit.
    3. Select Use Custom Cloud SQL database and enter the address with the format for your instance type:
      • First generationprojectName:instanceName/databaseName
      • Second generationprojectName:regionName:instanceName/databaseName
    4. Click Save.
    5. Repeat for any other deployments that you want to use a database on the custom Cloud SQL instance.
  5. If you exported data from the database on the default Cloud SQL instance, import the SQL dump file to your custom Cloud SQL database. Learn how.