Migrate Your Notion Database to Airtable Without Losing Relations

Transition your Notion Relations to Airtable Linked Records without losing valuable connections. We'll show you how it works step by step.

Written by
Matt Jasinski
and
Tom Nassr

October 16, 2023

If you’re making the switch from Notion to Airtable, you might be worried about losing all of the useful Relations that keep your databases linked. 

Luckily, with a couple super easy formulas, you can quickly convert all of your Notion Relations into Linked Records in Airtable. 

In this post, we’re going to show you how to quickly migrate your data without losing valuable connections. 

We’ll start by showing you how to export a Notion database and import it into Airtable. Then, we’ll walk you through a couple of quick formulas and field edits that will let you automatically re-establish your Relations from Notion as Linked Records in Airtable. 

Let’s get started!

One-time migration vs. synced databases

Before we show you the entire process for exporting your data and creating linked records, we just want to be clear that the setup we’re going to demonstrate is only suitable for a one-time transfer.

If you want to keep a permanent sync between Notion and Airtable, you should check out automation providers like Whalesync or Unito, that specialize in synchronizing databases between different apps. 

These apps will let you maintain parallel databases in Notion and Airtable, and update the appropriate records whenever you make an edit to either database. 

On our blog, you can find tutorials for syncing Notion and Airtable in either Whalesync or Unito.

However, if you just want to make a one-time switch from Notion to Airtable, the technique we demonstrate in this tutorial will be perfect. 

With all of that in mind, let’s take a look at the process for migrating your Notion databases and transforming your relations into linked records in Airtable. 

Overview

First, we’ll give you a quick overview of the whole process. Then, we’ll go into each step in detail. 

1. Open your Notion databases that are linked with a relation. 

To start, open up your Notion databases. We’ll call them Database A and Database B. It doesn’t matter which is which; we’re just using these labels to make it clear when we’re working in one vs the other. 

2. Add a unique ID to Database A

Add a new property to Database A. Choose “ID” as the type. Enter a name for this field, like “Notion ID”, and provide a prefix to use in the ID. 

NOTE: If you have a field in Database A with unique values for every record, you don’t need to add an ID. For instance, you might be able to use an “email address” field instead. However, adding this ID only takes a few moments, and ensures that you’ll have a unique value associated with each and every record. This will be essential when you’re creating linked records in Airtable. 

3. Add an ID rollup to Database B

Add a rollup to Database B to look up the ID field for each related record from Database A. 

4. Export your Notion databases

Export both of your databases as CSV files. You can find the “export” option in the three-dot menu in the top right. 

5. Import your databases in Airtable

Import the databases into Airtable as new tables, and adjust the field type during the import configuration.

Make sure the relation and rollup fields are set to “single line text”. 

6. Turn Database A’s primary field into a formula field

Then, duplicate the primary field in Database A, and change the original primary field into a formula. The formula will just display the contents of the Notion ID field. Alternatively, you can use the formula to point to any other field that will have a unique value for each record. 

7. Convert Database B’s former rollup field into a linked record

Open up Database B. 

Convert the old rollup field into a linked record. 

Airtable will now treat the text in these fields as names of records in Database A, and since you changed the primary field to display a unique ID, it should find the correct matching records. 

8. Delete unused fields and update the primary field

Now the link has been rebuilt, you just need to delete any old unused fields, and change the primary field in Database A to something that makes it easier for a human to identify each record. 

For instance, we’ll just change it so it includes the name and title of each contact.

That’s how the transfer works in a nutshell, but you can read on for more detail about each step. 

Preparing your Notion databases for export

To start, open up the related Notion databases you want to export. 

On the Notion page pictured below, we have two related databases that we want to export to Airtable: Contacts, or ‘Database A’, and Companies, or ‘Database B’. A two-way relation connects each contact to a company. 

We’ve put both databases on the same page for convenience, but it’s OK if your databases are on different pages. 

Before you can export your databases, you’ll just need to add a couple fields to make sure you can easily rebuild the relations as linked records. 

Add an ID field to Database A

In Database A, add a new property and choose “ID” as the type. Then, enter a prefix to use. For instance, each record in our Contacts base will have an ID of “CON”, then a number. 

Give this property a name, and save it. 

Add a rollup in Database B to look up the ID

Then, open up Database B and add a Rollup property. Select the relation to Database A, and give it a descriptive name. Then, set the rollup to look up the “ID” field you just created in Database A. 

By giving each record in Database A a unique ID, you can ensure that Airtable will be able to find the correct record to link to later - even if you have multiple records with the same or similar names. 

For instance, you might have two contacts both named “John Smith”, so using the name alone would produce inaccurate results. 

By searching for the unique ID instead, you should avoid the vast majority of potential errors. 

Alternatively, you could skip adding the ID to Database A if it already has a field with a unique value for each and every record. In many cases, an ‘email address’ field might work for this purpose. 

However, using a dedicated ID field is a foolproof solution that will work for any context, so that’s what we’ll demonstrate.  

Once your Notion databases are set up with unique IDs, you can go ahead and export them.

Export your Notion databases as CSV files

To export a database, open it up as a full page. 

Then, click on the three dots menu in the top right corner of the screen, and select “Export”. 

The “export” option will let you export the entirety of your currently selected page, including any databases on that page. When you open the database as a full page, the database is the only item that will be exported. 

Configuring your export settings

Export format

By default, the “Export format” should already be set to “Markdown & CSV”, which is what you’ll want to use. 

Include databases

For every exported database, Notion will create two CSVs. One of these files will always include all of the records in the database. 

The “Include Databases” setting will let you choose whether you want the other CSV to include the current view you’ve selected or the default view of your database. 

Choosing “Current view” will just make it so the other CSV uses your currently selected view. If you select “Default view”,the other CSV will use whatever view you’ve designated as the default view for the database. 

Include content

The “include content” option allows you to choose whether or not you want to include images in your export (if any are present on the page).

Include subpages and Create folders for subpages

For a database export, you can usually leave “include subpages” unchecked. 

If you are including subpages, you can also choose whether or not to create folders for those subpages. 

With all of your settings configured, click on “Export” to save your database. The exporting process can sometimes take a while as Notion creates the necessary files and compresses them into a .ZIP archive. 

Once your export is ready, you can save it to your computer. 

The randomly generated title isn’t very descriptive, so you’ll probably want to rename the archive. 

When you uncompress it, you’ll see a folder with two CSV files. Both will have the name of your database, and one will also say “All”. 

The “All” CSV will include every record in your database, and is the CSV you’ll usually want to use. The other will include the default view, or the “current” view, as you selected during the exporting process. 

Import your databases into Airtable

To import your database into Airtable, open up an Airtable base you’d like to use. Click “Add or import”.

Then select “CSV file”. Upload your CSV exported from Notion for Database A. 

Then, choose whether to create a new table, or to add the data to an existing table. We’d recommend always creating a new table, unless you already have a table formatted with all of the fields you need. 

Next, you’ll need to adjust your import. Airtable will try to set appropriate field types automatically, but you’ll usually need to adjust its selections a bit. 

As you’re adjusting the fields, be sure to set the former relation field from Notion AND the ID field to “Single line text”.

Under “Other settings”, make sure that “use first row as headers” is checked to use the first row in your CSV as field titles instead of making it a record. 

Once your configuration is all set, click “Import”. 

Reviewing and adjusting your imported database

Repeat the same process to import Database B. Then, make sure to give both databases descriptive names in Airtable. 

Note that the data in the old relation fields in our databases look a little different than they did in Notion. Each record includes the Notion URL for its related page. 

This is another reason why we want to use an ID to find each record instead. With the added URLs, these records in Database B don’t exactly match the names listed in the “Contacts” table. 

If we just converted this old relation field into a linked record, it would create new records that would include the name and Notion URL as the person’s name - and every other field would be blank. 

To help prevent confusion later on, I’d recommend renaming your old relation fields from Notion. For instance, you can just add an {OLD} tag to the fields for the time being. 

Now, let’s use some simple formulas to rebuild your relations as linked records. 

Rebuilding relations as linked records in Airtable

First, go back to Database A - for us, that’s “Contacts”. Then, duplicate the “primary field”. That’s what Airtable calls this first field on the left that acts as a label for each record. 

Click on the primary field, and select “duplicate field” to make a copy to the right. 

Then, give the newly copied field a new name to distinguish it from the primary field - like “Contact name”. 

Use a formula to display the Notion ID as the primary field

Next, change the primary field to a formula instead of just a text field. Click on the primary field, and select “edit field”. 

Then, change the field type to “formula”. 

Don’t worry; this formula’s going to be very easy. All you need to do is display the contents of the “Notion Contact ID” field - or whatever you’ve named your field that holds the Notion ID you created earlier. 

Just start typing the field name, and select it from the list when it pops up.


Click on Save to commit your changes, and click “Convert” on the warning about changing field types. 

With your formula set, the primary field for every record will display exactly the same value as the Notion ID field. 

Note that this isn’t a permanent change. It’s just a step towards rebuilding the relations as linked records with these two newly imported tables. We can (and will) change the formula again later. 

Convert the old rollup field into a linked record

Open up Database B - for us, that’s Companies. The old relation field that linked database B to Database A in Notion is called “Contacts”.

We’d recommend changing its name to avoid any confusion - we’re just keeping it here for reference, and we’ll delete it later anyway. We’ll add an {OLD} tag at the beginning.  

The “Contact ID” field was a rollup in Notion - it looked up the Notion ID for the linked contact. 

As such, it lists an ID for each related contact. 

If we convert this field to a linked record connected to the Database A - Contacts table in Airtable, then Airtable will automatically look for any records with these IDs in the primary field. 

That’s why we updated the primary field in the Contacts Database to use each record’s Notion ID instead of the name. 

Change this field’s name to something that reflects the database you want to link to (like “Contacts”) and change the field type to linked record. 

Pick Database A (e.g., our “Contacts” table), ensure that “allow linking to multiple records” is enabled, and save the changes. 

Once again, you need to confirm that you want to change the field type. 

And you can skip adding any lookup fields for now. 

If you’re working with a larger database with thousands of records, this might take a minute or two. 

But with a small database like the one in our example, the change happens immediately. 

The “Contact ID” field is now a linked record connecting Contacts to Companies. 

Of course, these Notion IDs don’t make for the best labels. Not for humans to read, anyway. So to wrap things up, just go back to Database A - Contacts, and change the primary field formula to directly reference the “Contact Name” field instead of the Contact ID field. 

We’ll also include their title. 

Feel free to format your primary field however you’d like. You can concatenate any data you want from each record into the primary field with a formula. 

With the primary field updated, let’s go back to Database B - Companies, and check the linked record. Instead of IDs, we see names and titles now. 

And when you compare the new linked record field to the old relation field, you should see the names all match up. 

You can confidently delete the old relation field from both tables, and you’re all set to use your new Airtable database with linked records! 

Check out our Airtable beginner’s guides to learn about adding automation, interfaces and more to your new Airtable system. 

The importance and utility of primary fields in Airtable

Before we wrap up this post, we just want to note how useful the primary field in Airtable can be, and to emphasize a point we bring up often in Airtable tutorials. 

It is always a great idea to use a formula as the primary field instead of static text. 

In this case, using a formula lets us give our records one label that works well for rebuilding links, and immediately switch it to another label that’s easier for people to read. 

And if we want to change this primary field again in the future, we just need to edit the formula once, and every record will reflect the new format instantly. 

Setting up a formula for your primary field is just one small aspect of organizing your database, but it can pay huge dividends when you need to edit your data. Just keep that in mind as you add new bases, and tables to your Airtable Workspace. 

Data migration made simple with Airtable formulas

Moving your data from one app to another can be a pain. Luckily, a simple CSV export and import will take care of migrating your fields, and with Airtable, preserving your Notion relations just takes a few more steps. 

With a simple formula in Airtable and a couple quick field edits, you can rebuild as many linked records as you want in a matter of seconds. If you’d like to learn more about managing your data in apps like Notion and Airtable, be sure to check out our blog or our YouTube channel. You can also follow XRay on Twitter, Facebook, or LinkedIn.

Similar Blog Posts

Not sure where to start with automation?

Hop on a 15-minute call with an XRay automation consultant to discuss your options and learn more about how we can help your team to get more done.

Schedule a 15-Minute Call