LookML Projects and Database Migrations

  • 10 May 2022
  • 0 replies

Userlevel 3

Looker will not be updating this content, nor guarantees that everything is up-to-date. 


The Problem

I am migrating to a new database, but my existing LookML projects are currently configured to my old database connection. I don't want to lose my projects, and I don't want to have to rewrite them from scratch for the new database connection. Is there a way to update the existing LookML to work with the new database connection?

The solution below outlines a high-level workflow for adapting LookML projects to a new database connection.

The Solution

Communicate with your developers and freeze all development during the migration process to avoid large-scale merge conflicts. Only one developer or admin, with development permissions for all affected projects, should make the changes described in this article.
  1. After you have secured and configured your new database, connect it to Looker. Select your database from the Looker Dialects documentation page for dialect-specific configuration instructions.
  2. Switch on Development Mode. Select one LookML project to update from the Develop menu.
  3. In the appropriate model files, change the connection name to the new database connection.
  4. Run the LookML Validator and fix any resulting LookML syntax errors.
    If your database migration resulted in a SQL dialect change, be sure to check SQL syntax in all sql-based parameters, such as sql_always_where and sql_on, as well as sql for fields and Native Derived Table derived_columns. Also be sure to check the SQL in any SQL-based derived tables to determine whether any syntax updates are needed.
  5. Select Content Validator from the Develop panel. In the Content Validator, click the Validate button.
  6. If there are any resulting errors, click one of the affected Looks or dashboards listed under Content.
  7. Select Explore from Here from a Look or the three-dot menu of a dashboard tile displaying an error to find which field or function is the error source.
  8. Search the LookML project for that field or function.
  9. Fix the errors across the project.
  10. Repeat Steps 5-9 to validate content as needed.
  11. Commit and push the LookML changes to production once there are no more errors.
  12. Repeat the process above as necessary for any remaining projects.

Now your projects are ready for use with your new database connection!

This topic has been closed for comments