Files
bruteratel/BruteRatel-v2.1.2/adhoc_scripts/migrate.sh
T
2026-08-27 11:22:43 -06:00

37 lines
2.7 KiB
Bash

#!/bin/bash
# Brute Ratel versions support seamless updates between minor versions, preserving all data
# Major versions, like 1.7, 1.8, 1.9, demonstrate significant changes
# Minor versions, such as 1.7.1, 1.8.1, 1.9.1, or 1.9.2, maintain compatibility within the same major version.
# Updating from, for example, 1.9.0 to 1.9.8 doesn't result in data loss, ensuring cross-compatibility among all badgers and servers.
# Deploying badgers from minor version (eg: 1.9.0) alongside another minor version (1.9.8) server remains seamless and functional.
# This script facilitates safe updates between minor versions, ensuring preservation of badgers, logs, and downloaded data.
# Prior to execution, please adhere to the following steps. For this example, we will assume the old package is 1.9.0 and the update version is 1.9.2
# 1. Download 1.9.2 tar.gz package from bruteratel.com and extract/activate it
# 2. Copy this `migrate.sh` script to the 1.9.2 package
# 3. Ensure all badgers are idling (sleeping) and not actively executing any commands or sending responses during migration.
# 4. A recommended suggestion would be to synchronize all your badgers and put them to sleep for a minimum of 5 minutes, so that the badgers do not check in during the following operations
# 5. Close the Commander and allow your Server to remain idle for a minimum of 2 minutes before proceeding with the following operation. This allows time for Ratel server to autosave the latest server metadata to autosave.profile which is executed every 30 seconds
# 6. After the badgers and the server is set to idle, backup your server profile using `scratchpad` or just backup the `autosave.profile`, and then terminate the old server (1.9.0) using Ctrl+C
# 7. Navigate to the new package (1.9.2), and execute the `migrate.sh` with full path of the old package as the commandline argument. Example: ./migrate.sh /home/noob/Documents/bruteratel_1.9.0
# 8. Make note that your current working directory should be the new package directory when you are executing the script.
# 9. Run the new package using './brute-ratel-linx64 -ratel -r autosave.profile' command.
echo "!!! NOTE: Make sure this script is stored in the new package directory !!!"
if [ $# -eq 0 ]; then
echo "Error: No argument provided. Please provide full path of the old package"
else
oldPackage=$1
newPackage=`pwd`
echo "[+] Old package path: $oldPackage"
echo "[+] New package path: $newPackage"
cp -rf "$oldPackage/logs" $newPackage
cp -rf "$oldPackage/hosted" $newPackage
cp -rf "$oldPackage/downloads" $newPackage
cp -rf "$oldPackage/uploads" $newPackage
cp -rf "$oldPackage/autosave.profile" $newPackage
echo "[+] Update complete. Execute the new package with: './brute-ratel-linx64 -ratel -r autosave.profile'"
fi