Welcome to the comprehensive guide on managing bulk data in RebelMouse through importing.
This article explains how to import your online content, like images, posts, and significant sections, to ensure your most essential documents stay the same when you move from your previous content management system (CMS) to RebelMouse.
Before going through our tutorial, please ensure that you've read our previous documentation first: Set up Your Import Files. It will help you make sense of the importing process and ensure that your data is streamlined for success!
The following are the types of imports you can complete and the objects that are supported:
- You can createand updateUsers and Posts
- You can create, but not update, Sections and Images
- Getting Started
- Upload File or Choose Feed
- Mapping Step
- One-to-One Mapping
- Code Mapping (Advanced)
- Reusing the Most Used Functions
- Reusing the Same Mapping
- Ready With Your Mapping? Move to Validate
- Let's Import
Once you've exported the data from your previous CMS and you've set up your files in the expected format, follow the instructions below to import into RebelMouse:
- Go to your Importer Dashboard by entering yourdomain.com/r/tasks/importer in your web browser's URL address bar.
Once there, you will see the following screen:
- You can choose any of the available objects to start the import process. As we mentioned in our previous setup article, we suggest starting with images.
- In this example, we'll start with images:
Upload File or Choose Feed
You have two options to import data from:
- Uploading a File
- Using a Feed
Review the requirements and technical limits for any limitations.
In this step you can choose to upload one of your files by clicking on the blue area. If your file is properly formatted (not broken), then once the file has been uploaded you will see the following green screen:
After uploading, continue to the Mapping Step.
If you receive the following error, please contact email@example.com.
Note: We currently only accept JSON Feeds.
If you select the option to import from a feed URL, you will need to add the details of the feed you want to pull data from:
- URL path for the feed
- Pagination param (optional)
- Pagination type is either offset or page
- Basic Auth User (if any)
- Password (if any)
Note: Offset pagination involves specifying a numerical offset to start retrieving data from a certain position in a dataset, allowing you to fetch a specific number of items after that offset.
For example, if you have a list of 100 items and you set an offset of 20, you would then retrieve items 21–40.
Page pagination divides the dataset into fixed-size pages, and users request specific pages to navigate through the data in a structured manner.
For example, if you have a list of 100 items and the pagination is set to be pages of 20 items each, you would find items 21–40 by adding "page=2" as a parameter.
Once your file has been successfully uploaded, or your URL feed has been validated, it's time to move on to mapping:
Goal: The goal of this step is to map each property (field) coming from the original input source (i.e., the feed you've connected or the file you've uploaded) to the RebelMouse-accepted format for each object.
This can be achieved using two different methods:
- One-to-One Mapping: This is where one field is mapped directly to another field. This assumes that the property you are mapping to has the same property type as the RebelMouse destination property, and that it's ready to be imported as is.
For this goal to be achieved, we have three main areas on the screen you need to use:
Input Properties (left area)
The area on the left will contain a random sample of 20 records that were pulled from the files you've uploaded or the URL feed you've chosen to help visualize and configure the mapping.
Object Properties (middle area): Actual Mapping
The area in the middle is where you will define if you want to use the One-to-One Mapping or Code Mapping method, and which input field (or fields) will be mapped to which RebelMouse property.
Preview Area (right area)
Once you perform your mapping in the middle area, you can then click on the Preview All Fields button to see a preview of what the destination object will look like for your sample records.
Let's work through some examples.
Example: Simple Image CSV
Import images using One-to-One Mapping.
Imagine a CSV file that looks like the following:
After importing it and reaching the mapping step, the screen will look like this:
We'll only map Image_url (since it's required) and alt text:
Click the Preview All Fields button to view the entire property layout.
What happens if the data is not prepared for importing, or is a different file type than what the destination accepts? In that case, you will need to use Code Mapping.
Code Mapping (Advanced)
To access Code Mapping , click Choose a Tool and then Code:
Using the same example above, where the input field has been prepared and specified for a particular RebelMouse property, we can replicate the One-to-One Mapping's results as follows:
Here's the same approach in GIF format:
It's important to note that:
- Each code area already tells you which data type it expects:
In this case, image_url needs to use the data type "string."
And if you return a different data type, the code will let you know:
In this example, Type "number" is not assignable to type "string."
Now, let's try a harder example.
Code Mapping (Advanced)
In this example, we have a CSV file that contains only one column: image_tags. And it also contains all of the information we need for our mapping, such as image_url, alt text, caption, etc.
So when we upload it, it looks like this:
As a result, we'll want to use code to extract the image URL and the image alt text from the HTML string coming from the input property image_tags.
The way to do that is as follows:
If no errors are displayed, you can then test the results by previewing them by clicking the Preview All Fields button:
Note: You can use as many input fields as you want, including the entire input object. You can also call as many functions as you need.
- You cannot use external libraries or DOM libraries.
- You are not allowed to do external HTTP requests.
Reusing the Same Mapping
If you have a large import task, preparing your data may take some time.
Don’t worry though, because we have a feature that enables you to easily download or upload your mapping work. This way you can save your progress and pick up where you left off later. It also allows you to share the work with different colleagues.
And finally, if you have a blocker and need RebelMouse's support team to assist you, please send over both the object file (e.g., users, images) that you're importing and the related mapping file to firstname.lastname@example.org.
To download your current mapping, click the download arrow icon. To upload a saved mapping, lick the upload arrow icon.
Ready With Your Mapping? Move to Validate
The validation step ensures that your uploaded data is properly structured and all of the transformations you've specified in the previous step work well. If any data record doesn't conform as needed, such as a field having an incorrect or untreated data type that disrupts the mapping logic, an error will appear to prevent import problems.
If you encounter an error during the validation step, we recommend that you download the error CSV and try to understand how to fix the flagged issue before continuing to import.
If the validation process goes smoothly and there are no errors, you're good to proceed with the import step. During import, we transfer your carefully prepared, mapped, and transformed data to RebelMouse through our public API. Should any issues arise during this phase, it may be due to API limitations. You can find additional information about API limits in our documentation located at https://apis.rebelmouse.dev.
Please note that handling large files may extend the process duration. You can monitor progress on the initial import page, and once the import is complete, it will be visible in the import history section.
Please email email@example.com for more direction on the following if needed:
- Your import file
- The last mapping file you've downloaded using the importer tool