Overview
This document outlines the steps required to update the MARS URL from “mars(dot)42gears(dot)com” to “mars.astrouploads.com” across different SureMDM Styx versions.
Applicable Versions
- Target Versions: v1.11.8, v1.11.9, v1.11.10, v1.11.11, v1.20.1, v1.20.2, v1.32.2
- Older Versions: v1.7.1, v7.35.8, v7.35.9
Section 1: Configuration Update (v1.11.8, v1.11.9, v1.11.10, v1.11.11, v1.20.1, v1.20.2, v1.32.2)
Steps:
- Download update_config.sh from the provided link.
- Place the script inside the k8sopinstaller directory.
- Execute the following:
sudo chmod +x update_config.sh
sudo bash update_config.sh
Section 2: Steps for Older Versions (v1.7.1, v7.35.8, v7.35.9)
Steps:
- Download mars_url_update_old.sh.
- Execute the script:
sudo chmod +x mars_url_update_old.sh
sudo bash mars_url_update_old.sh
Section 3: MongoDB Update (v1.7.1 / 7.35.8 / 7.35.9, 1.11.8, v1.11.9, v1.11.10, v1.11.11, v1.20.1, v1.20.2, v1.32.2)
Objective: Update all occurrences of the old MARS URL in job configurations.
Steps:
- Connect to MongoDB and switch to the suremdmdb database.
- Execute the following update command:
- use suremdmdb (First execute this command separately)
- Followed by the below command
use suremdmdb
db.jobtable.updateMany(
{ "job_json_jobtable.Job": { $exists: true } },
[
{
$set: {
"job_json_jobtable.Job": {
$arrayToObject: {
$map: {
input: { $objectToArray: "$job_json_jobtable.Job" },
as: "item",
in: {
k: "$$item.k",
v: {
$cond: {
if: {
$and: [
{ $eq: [{ $type: "$$item.v" }, "string"] },
{ $regexMatch: { input: "$$item.v", regex: /mars\.42gears\.com/ } }
]
},
then: {
$replaceOne: {
input: "$$item.v",
find: "mars.42gears.com",
replacement: "mars.astrouploads.com"
}
},
else: "$$item.v"
}
}
}
}
}
}
}
}
]
);
Section 4: MS SQL Update (v1.20.1, v1.20.2, v1.32.2)
Objective: Update the Linux agent runscript with the new MARS URL.
Steps:
- Connect to MS SQL Server and use the suremdmdb database.
- Run the following query:
USE suremdmdb
update runscript set script_runscript = '#!/bin/bash
NIX_DEFAULT_LOCATION="https://mars.astrouploads.com/support/inout/nixv%input~text%.tar.gz"
filename=$(basename "$NIX_DEFAULT_LOCATION")
if [ "$EUID" -ne 0 ]
then echo "Permission denied. Please run as root."
exit 126
fi
DPKG=$(type -p dpkg)
installDPKGs() {
#For Package integrity check
REQUIRED_PKG_DEBSUMS="debsums"
DEBSUMS_PKG_OK=$(dpkg-query -W --showformat=' + CHAR(39) + '${Status}\n' + CHAR(39) + ' $REQUIRED_PKG_DEBSUMS|grep "install ok installed")
if [ "" = "$DEBSUMS_PKG_OK" ]; then
apt-get --yes install $REQUIRED_PKG_DEBSUMS
fi
}
if [ ! -z $DPKG ]; then
installDPKGs
fi
if [ ! -f "/usr/share/java/nix/nix.jar" ]; then
echo "Cannot find existing nix @ /usr/share/java/nix/nix.jar"
echo "Nothing to upgrade. Exiting..."
exit 1
fi
rm nix*.tar.gz
rm -rf ./nix
if [ -z "$1" ]; then
wget $NIX_DEFAULT_LOCATION
else
wget $1
fi
if [ ! -f "$filename" ]; then
echo "Cannot Download Nix package. Please check your Internet connection or download URL."
echo "Exiting"
exit 1
fi
tar -xvzf nix*.tar.gz
# Backup Existing Nix Installation in-case something goes wrong -
BACKUP_FILE=$HOME"/nix_backup_date_"$(date ' + CHAR(39) + '+%d%b%Y_%H%M%S' + CHAR(39) + ')".tar.gz"
echo "Backing up to $BACKUP_FILE"
tar -zcvf $BACKUP_FILE /usr/share/java/nix/
if [ -f "$BACKUP_FILE" ]; then
echo "Nix backup location: $BACKUP_FILE"
else
echo "Could not create backup file $BACKUP_FILE. Exiting..."
exit 1
fi
SCRIPT_PATH="nix/upgradenixdynamic.sh"
source $SCRIPT_PATH
echo "Upgrade Complete"' where id_runscript = '30026'
Section 5: MS SQL Update (v1.7.1 / 7.35.8 / 7.35.9, v1.11.8, v1.11.9, v1.11.10, v1.11.11, 1.20.1, 1.20.2 and v1.32.2)
Objective: Update the Linux agent runscript with the new MARS URL.
Steps:
- Connect to MS SQL Server and use the suremdmdb database.
- Run the following query:
Use suremdmdb
UPDATE eamapplistdetails
SET appurl_eamapplistdetails =
REPLACE(
appurl_eamapplistdetails COLLATE SQL_Latin1_General_CP1_CI_AS,
'mars.42gears.com',
'mars.astrouploads.com'
)
WHERE appurl_eamapplistdetails COLLATE SQL_Latin1_General_CP1_CI_AS
LIKE '%mars.42gears.com%';
Impacted Areas
- QR Code for AFW Enrollment ( If the SureMDM Agent download is enabled from the 42Gears Website)

- Jobs containing MARS URL
- Mobile Threat Defense (MTD)
- Linux SureMDM Agent (Runscript)
Important Notes
- QR Codes: Existing QR codes for AFW Enrollment must be recreated.
- Backups: Take a full DB snapshot of MongoDB and MS SQL before proceeding.
- Environment: Deployment should be verified in a staging/UAT environment first.
Need more help? Here’s how to get help from our experts.
Was this helpful?
YesNo