SankalpIT – Plugins for Automate
It is essential for your business to have backups of your IT environment. Lost data can cause a noteworthy emergency, lost income and extremely unhappy customers.
Info! This document gives well-ordered instructions to restore your Automate system from backup. We recommend you do not skip any step. If you are feeling uncomfortable performing the restore, do not hesitate to Contact us.
You must be interested to know how ConnectWise Automate does the backup of database.
Info:
ConnectWise Automate perform backup operation during the 3AM maintenance.
Note:
You may know the “RootPassword” by using batch script called ”
KnowYourRootPassword.bat“. And, edit the following files and replace the word ”
ProvideYourPasswordHereWithoutQuotes” with your root password.
- Drop and Create ConnectWise Automate Database.bat
- Import Data to Database.bat
- Import Structure to Database.bat
See screenshot.
Note :
Note:
You just copied mysql.exe file’s full path. Open the following script files in notepad and provide path to “MySQLexe” variable (
without Quotes ).
- Drop and Create ConnectWise Automate Database.bat
- Import Data to Database.bat
- Import Structure to Database.bat
See screenshot.
Important: :
- Drop and Create ConnectWise Automate Database.bat
- Import Data to Database.bat
- Import Structure to Database.bat
Use the following Powershell command to stop ConnectWise Automate critical services
Get-service LabMySQL,LTAgent,LTService,LTSvcMon,LTRedirSvc | ?{$_.status -eq 'running'}|stop-service
Info!
Please verify that all above services’ status manually by opening services.msc
Unzip ConnectWise Automate databse “Structure” and “Data” to “Labtech.1” folder on your desktop!
Open to C:\Program Files (x86)\LabTech\mysql\data folder and delete the following log files and a folder.
Note:
If you don’t find these files and given folder there then check “Program Files” directory.
Before proceeding further, Please make sure LabMySQL is running. If not, open the command prompt and run the following command.
Download File: Start LabMySQL Service.bat
net start LabMySQL
Now, you need to drop “ConnectWise Automate” database and create it again.Use the following batch script to recreate MySQL database called “LabTech”. Replace ProvideYourPasswordHereWithoutQuotes with root password in the following script.
Download File: Drop and Create LabTech Database.bat
@echo off
SET rootuser=root
SET rootPassword=ProvideYourPasswordHereWithoutQuotes
SET MySQLexe=”c:\program files (x86)\labtech\mysql\bin\mysql.exe”
%MySQLexe% –user=%rootuser% –password=%rootPassword% –execute=”drop database labtech;”
Echo ……………….Dropped ConnectWise Automate Database………………
Echo.
pause > nul
Echo ……………….Creating ConnectWise Automate Database……………….
Echo.
%MySQLexe% –user=%rootuser% –password=%rootPassword% –execute=”create database ConnectWise Automate;”
Echo ConnectWise Automate Database has been created successfully……………….
echo.
pause > nul
After re-creating database, you need to import MySQL “Tables”, “Views”, “Triggers” and “Procedures” into database. Use the following batch script.
Download File:
Import Structure to Database.bat
@echo off
SET rootuser=root
SET rootPassword=ProvideYourPasswordHereWithoutQuotes
SET MySQLexe=”c:\program files (x86)\labtech\mysql\bin\mysql.exe”
SET sourceFolder=%USERPROFILE%\Desktop\Labtech.1
%MySQLexe% –user=%rootuser% –password=%rootPassword% -b labtech < “%sourceFolder%\DBaseTable.sql”
echo.
Echo ……………….Imported LabTech Tables structure………………
Echo.
%MySQLexe% –user=%rootuser% –password=%rootPassword% -b labtech < “%sourceFolder%\DBaseViews.sql”
echo.
Echo ……………….Imported LabTech Views………………
Echo.
%MySQLexe% –user=%rootuser% –password=%rootPassword% -b labtech < “%sourceFolder%\DBaseTrigger.sql”
echo.
Echo ……………….Imported LabTech Triggers………………
Echo.
%MySQLexe% –user=%rootuser% –password=%rootPassword% -b labtech < “%sourceFolder%\DBaseProc.sql” echo. Echo ……………….Imported LabTech Procedures……………… Echo. Echo ——————— Press any key to Exit———————- Pause > nul
Now, we need to import data in LabTech database. Use the following batch script for that.
Download File: Import Data to Database.bat
@echo off
SET rootuser=root
SET rootPassword=ProvideYourPasswordHereWithoutQuotes
SET MySQLexe=”c:\program files (x86)\labtech\mysql\bin\mysql.exe”
SET sourceFolder=%USERPROFILE%\Desktop\Labtech.1
FOR /f %%a IN (‘dir /b %sourceFolder%\*.sql’) DO “%MySQLexe% –user=%rootuser% –password=%rootPassword% -b labtech < “%sourceFolder%\%%a” Echo. Echo ……………….Imported LabTech data in database……………… Echo ——————— Press any key to Exit———————- pause > nul
Log in to the
Control Center
and verify that all agents are there, and then wait approximately 10 minutes for
the agents to begin to check in