Data Management

How To Migrate Data from Adalo to Xano

Summary

In this guide, we'll walk you through the process of migrating data from Adalo to Xano, a no-code platform that allows you to build and deploy backend services for web and mobile applications without writing code. We'll use Adalo's DateNight app template as an example, but the principles can be applied to any Adalo app.

Understanding the DateNight App

The DateNight app is a simple app that allows users to browse and favorite different date ideas categorized by theme (e.g., romantic, adventurous, anniversary). The app consists of three main collections:

  1. Users: Stores user information, including name, email, password, and profile picture.
  2. Categories: Stores different categories of date ideas, such as "Romantic" or "Adventurous."
  3. Dates: Stores individual date ideas, including name, image, description, location, and associated category.

Setting Up Xano Collections

The first step in migrating data from Adalo to Xano is to create corresponding collections in Xano. Here's how you can set up the collections for the DateNight app:

Categories Collection

  1. In Xano, create a new table called "Categories."
  2. Add the following columns:
  • `name` (text)
  • `adaloID` (integer)
  • `createdAt` (timestamp)
  • `updatedAt` (timestamp)
  • `picture` (storage image metadata)

Dates Collection

  1. Create a new table called "Dates."
  2. Add the following columns:
  • `name` (text)
  • `dateImage` (storage image metadata)
  • `tip` (text)
  • `location` (text)
  • `description` (text)
  • `category` (table reference to Categories)
  • `createdBy` (table reference to Users)
  • `favoritedBy` (table reference to Users)
  • `adaloID` (integer)
  • `createdAt` (timestamp)
  • `updatedAt` (timestamp)

Users Collection

  1. Create a new table called "Users."
  2. Add the following columns:
  • `fullName` (text)
  • `email` (text)
  • `password` (text)
  • `profilePicture` (storage image metadata)
  • `username` (text)
  • `adaloID` (integer)
  • `createdAt` (timestamp)
  • `updatedAt` (timestamp)

Establishing Relationships

One key difference between Adalo and Xano is how relationships between collections are handled. In Xano, you'll need to decide which table should store the relationship information.

In the DateNight app, the "Dates" table is the best place to store the relationship information because each date is associated with a category and can be created or favorited by multiple users. The "category" column in the "Dates" table is a table reference that links to the "Categories" table, while the "createdBy" and "favoritedBy" columns are table references that link to the "Users" table.

Migrating Data from Adalo to Xano

Now that you've set up the collections in Xano, you can migrate the data from Adalo. Xano provides several methods for data migration, including:

  1. Downloading data from Adalo as a CSV file and uploading it to Xano.
  2. Creating a button in Adalo that copies data from a collection to a Xano table.
  3. Using Xano's API to call Adalo's collections and pull the data directly.

In this guide, we'll focus on the third method, as it's the fastest and most efficient way to migrate data.

Setting Up Environment Variables

Before you start building API endpoints in Xano, you'll need to set up an environment variable to store your Adalo API key. This way, you don't have to include the API key directly in your code, which can be a security risk.

  1. In Adalo, navigate to the Settings* > *App Access section and copy your API key.
  2. In Xano, go to Settings* > **Manage** and click *Add Variable.
  3. Name the variable `adaloAPI` and paste the API key as the value.

Building API Endpoints

Adalo provides API documentation for each collection, including a cURL statement that you can use to create an endpoint in Xano. Here's how you can build the endpoints for the DateNight app:

#### Categories Endpoint

  1. In Xano, create a new API function.
  2. Add an External API Request to the function stack and paste the cURL statement from Adalo's API documentation for the "Categories" collection.
  3. Replace the `Authorization: Bearer` value with `concat(environment.adaloAPI, '')` to use the API key from the environment variable.
  4. Add a Stop and Debug step to verify that the API request is working correctly.
  5. Create a variable called `data` and use the `subpath` function to extract the `records` array from the API response.
  6. Iterate through the `data` array using a loop.
  7. Inside the loop, use the Add Record function to create a new record in the "Categories" table in Xano.
  8. Map the fields from Adalo to the corresponding columns in Xano, including the `name`, `adaloID`, `createdAt`, and `updatedAt`.
  9. For the `picture` column, use the Create File Resource* and *Create Image Metadata functions to upload the image to Xano and store the metadata in the `picture` column.

Repeat the same process for the "Dates" and "Users" collections, making sure to map the fields correctly and handle any relationships between collections.

Testing and Deployment

After building the API endpoints, you can test them by running the functions individually or as a whole. Xano's Run and Debug feature allows you to execute the functions locally and inspect the results at each step.

Once you've verified that the data migration is working correctly, you can deploy your Xano workspace to a production environment and start using it with your web or mobile applications.

Conclusion

Migrating data from Adalo to Xano can be a straightforward process if you follow the steps outlined in this guide. By understanding the structure of your Adalo app, setting up the corresponding collections in Xano, and building API endpoints to pull data directly from Adalo, you can easily transfer your data to Xano and take advantage of its no-code backend development capabilities.

This transcript was AI generated to allow users to quickly answer technical questions about Xano.

Was this helpful?

I found it helpful

I need more support
Sign up for XanoSign up for Xano

Build without limits on a secure, scalable backend.

Unblock your team's progress and create a backend that will scale for free.

Start building for free