Sync Environments
This document provides detailed information about the Sync Environments job type, which allows users to synchronize data and settings between two environments within an organization in Codex.
Table of Contents
Overview
Syncing environments involves ensuring that the data and settings between two environments within an organization are consistent. This process helps maintain data integrity and ensures that both environments are up to date. In the Sync Environments job, the data from the base environment is cloned into the target environment, replacing the existing data in the target environment.
To perform environment synchronization, you need to create a Sync Environments job.
Usage
To create a Sync Environments job, complete the Create New Job form. When selecting the Sync Environments job type, it will display the necessary form fields:
Name
The Name field is a text input that requires you to provide a descriptive and meaningful name for the job. This name will be displayed in the listing of the Jobs tab, helping you and others identify the job's purpose. For instance, you can use Synchronize Main with Staging
as the job name, indicating that it syncs data from the main environment to the staging environment, assuming you have a staging environment.
Job Type
The Job Type dropdown allows you to select the type of job. For environment synchronization, choose Sync Environments as the job type.
Select Base Environment
The Select Base Environment dropdown lets you choose the base environment from which data will be synchronized. This environment serves as the data and settings source for the synchronization process.
Select Target Environment
The Select Target Environment dropdown allows you to specify the target environment where the data from the base environment will be cloned. The existing data in the target environment will be replaced with the data from the base environment.
Scheduling
You have the option to schedule the synchronization job. You can choose to run it immediately or schedule it to run at specific intervals, such as hourly, daily, weekly, or with custom intervals.
- Run Now: Executes the job immediately, and the job run appears in the Jobs tab listing.
- Schedule: Allows you to set up recurring jobs that will run automatically at the specified intervals. These recurring jobs can be managed in the Recurring Jobs ta, where you can pause or resume a recurring job.
Job Details
After creating a Sync Environments job, if you choose to run now, you will be redirected to the Job Details page. This page provides more information about the job and its progress.
You can manually run only a single environment job (Create/Sync) at a time, in a Codex organization.
When you schedule a recurring job, if the job doesn't have any job runs, it doesn't redirect you to the job details page. The moment when a job run is created from a recurring job, then clicking on it will redirect you to the job details page of the latest job run of it.
When you sync environments, data like Webhooks, Integrations, Entry Versions, Presets, Jobs and Teams are not synced into your new environment.
Job Run Summary
At the top section of the page, you'll find a summary of the job run. This includes:
- Status: Indicates the current status of the job, whether it's in progress or completed.
- Total Logs: The total number of logs related to this job run.
- Total Errors: The number of errors encountered during the execution of the job.
- Total Warnings: The number of warnings generated during the job run.
- Elapsed Time: Displays the time that has elapsed since the job started.
- Created By: Shows the user who created the job.
Job Tasks
The bottom section of the page presents a list of job tasks. In the Sync Environments job, there are two tasks:
Sync Database Data Task
- Database data clone progress: x%: The current progress of the job task, as percentage.
- Replication completed successfully.: Indicates that the job task has completed.
Sync Indexed Data Task
- Creating Snapshot Progress: x%: Shows the progress of creating a snapshot of the data, represented as a percentage.
- Restoring Snapshot Progress: x%: Indicates the progress of restoring the snapshot, also as a percentage.
- Indexed Data Synced Successfully: This message signifies that the indexed data synchronization has been successfully executed.
You can expand or collapse each task to view its logs in real-time. These logs provide detailed information about the progress of the task and any encountered errors.
When performing environment synchronization, keep in mind that the data in the target environment is replaced with the data from the base environment to ensure data consistency between the two environments. Also, when a sync environments job is in progress, the corresponding target environment will be unusable until the sync job has finished.
When syncing environments, keep these dos and don'ts in mind:
Do:
- Choose a parent environment as the base environment to sync from.
- Make sure the base and target environments are in a parent-child relationship.
Don't:
- Select the same environment as both base and target.
- Select the main environment as the target.
- Attempt to sync environments that are not parent and child.
- Try to sync data to a parent environment from a child. Data flows downhill from parent to child only.